From 9483369aa04a5d2c4dc5c0034a3e4431153d9c99 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 28 Apr 2000 04:23:19 +0000 Subject: Made Evolution OAF-compatible. svn path=/trunk/; revision=2673 --- shell/ChangeLog | 13 +++++++++++++ shell/e-shell-view.c | 30 ++++++++++++++++++++++-------- shell/main.c | 37 ++++++++++++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 8f4a622cc5..d680b9eb22 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,16 @@ +2000-04-27 Ettore Perazzoli + + * e-shell-view.c: OAFized. + (get_view): If `bonobo_widget_new_control()' fails for the + calendar, don't try to get the property bag and stuff and thus + prevent a segfault. + + * main.c + (corba_init): Removed Bonobo initialization. Implemented OAF + version for the case in which `USING_OAF' is #defined. + (init_bonob): New function. + (main): Call `init_bonobo()'. + 2000-04-26 Matt Loper * e-shell-view.c (bonobo_widget_is_dead): Helper function to see diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index 838bc6ccb8..b6d74276e5 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -21,12 +21,25 @@ #include #include +#ifdef USING_OAF + +# define MAIL_CONTROL_ID "OAFIID:control:evolution-mail:833d5a71-a201-4a0e-b7e6-5475c5c4cb45" +# define ADDRESSBOOK_CONTROL_ID "OAFIID:control:addressbook:851f883b-2fe7-4c94-a1e3-a1f2a7a03c49" +# define CALENDAR_CONTROL_ID "OAFIID:control:calendar:dd34ddae-25c6-486b-a8a8-3e8f0286b54c" + +#else + +# define MAIL_CONTROL_ID "control:evolution-mail" +# define ADDRESSBOOK_CONTROL_ID "control:addressbook" +# define CALENDAR_CONTROL_ID "control:calendar" + +#endif + #define PARENT_TYPE gnome_app_get_type () static GtkObjectClass *parent_class; -struct _EShellViewPrivate -{ +struct _EShellViewPrivate { /* a hashtable of e-folders -> widgets */ GHashTable *folder_views; GtkWidget *notebook; @@ -150,11 +163,11 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih) switch (e_folder_type) { case E_FOLDER_MAIL : - w = bonobo_widget_new_control ("control:evolution-mail", uih); + w = bonobo_widget_new_control (MAIL_CONTROL_ID, uih); break; case E_FOLDER_CONTACTS : - w = bonobo_widget_new_control ("control:addressbook", uih); + w = bonobo_widget_new_control (ADDRESSBOOK_CONTROL_ID, uih); break; case E_FOLDER_CALENDAR : { @@ -162,7 +175,7 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih) BonoboPropertyBagClient *pbc; BonoboControlFrame *cf; - w = bonobo_widget_new_control ("control:calendar", uih); + w = bonobo_widget_new_control (CALENDAR_CONTROL_ID, uih); if (w) { cf = bonobo_widget_get_control_frame (BONOBO_WIDGET (w)); @@ -191,8 +204,7 @@ get_view (EShellView *eshell_view, EFolder *efolder, Bonobo_UIHandler uih) return NULL; } - if (w) - { + if (w) { Evolution_ServiceRepository corba_sr; BonoboObjectClient *server = bonobo_widget_get_server (BONOBO_WIDGET (w)); @@ -347,8 +359,10 @@ e_shell_view_set_view (EShellView *eshell_view, EFolder *efolder) int new_page_index; folder_view = get_view (eshell_view, efolder, uih); - if (!folder_view) + if (!folder_view) { + /* FIXME: Report failure. */ return; + } gtk_notebook_append_page (notebook, folder_view, NULL); new_page_index = gtk_notebook_page_num (notebook, diff --git a/shell/main.c b/shell/main.c index d03c925b44..9fa59a6ee0 100644 --- a/shell/main.c +++ b/shell/main.c @@ -5,15 +5,23 @@ * Miguel de Icaza (miguel@helixcode.com) * */ + #include + #include -#include #include #include #include #include /* for e_setup_base_dir */ #include #include + +#ifdef USING_OAF +#include +#else +#include +#endif + #include "e-shell.h" #include "e-shell-view.h" @@ -29,6 +37,21 @@ const struct poptOption shell_popt_options [] = { { NULL, '\0', 0, NULL, 0 } }; +#ifdef USING_OAF + +static void +corba_init (int *argc, char *argv []) +{ + gnomelib_register_popt_table (shell_popt_options, "Evolution shell options"); + + gnome_init_with_popt_table ("Evolution", VERSION, *argc, argv, + oaf_popt_options, 0, NULL); + + oaf_init (*argc, argv); +} + +#else /* USING_OAF */ + static void corba_init (int *argc, char *argv []) { @@ -39,8 +62,14 @@ corba_init (int *argc, char *argv []) "Evolution", VERSION, argc, argv, shell_popt_options, 0, &ctx, GNORBA_INIT_SERVER_FUNC, &ev); CORBA_exception_free (&ev); - - if (bonobo_init (gnome_CORBA_ORB (), NULL, NULL) == FALSE){ +} + +#endif /* USING_OAF */ + +static void +init_bonobo (void) +{ + if (bonobo_init (CORBA_OBJECT_NIL, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL) == FALSE){ e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("Failed to initialize the Bonobo component system")); exit (1); @@ -96,6 +125,8 @@ main (int argc, char *argv []) textdomain (PACKAGE); corba_init (&argc, argv); + init_bonobo (); + gui_init (); evolution_boot (); -- cgit v1.2.3