diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-04-28 12:23:19 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-04-28 12:23:19 +0800 |
commit | 9483369aa04a5d2c4dc5c0034a3e4431153d9c99 (patch) | |
tree | b52233be1d2618e4af4a919800422774133b4998 /shell | |
parent | 02ed4a60f394f53de32b10459c959ad6a1f7b887 (diff) | |
download | gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.gz gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.tar.zst gsoc2013-evolution-9483369aa04a5d2c4dc5c0034a3e4431153d9c99.zip |
Made Evolution OAF-compatible.
svn path=/trunk/; revision=2673
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 13 | ||||
-rw-r--r-- | shell/e-shell-view.c | 30 | ||||
-rw-r--r-- | shell/main.c | 37 |
3 files changed, 69 insertions, 11 deletions
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 <ettore@helixcode.com> + + * 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 <matt@helixcode.com> * 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 <libgnorba/gnorba.h> #include <gtk/gtkprivate.h> +#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 <config.h> + #include <gnome.h> -#include <libgnorba/gnorba.h> #include <bonobo.h> #include <e-util/e-gui-utils.h> #include <e-util/e-cursors.h> #include <e-util/e-setup.h> /* for e_setup_base_dir */ #include <glade/glade.h> #include <glade/glade-xml.h> + +#ifdef USING_OAF +#include <liboaf/liboaf.h> +#else +#include <libgnorba/gnorba.h> +#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 (); |