diff options
author | Dan Winship <danw@src.gnome.org> | 2000-06-10 09:52:51 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-06-10 09:52:51 +0800 |
commit | 88b0244b327a951ea96687aaab1ed51439c23976 (patch) | |
tree | 3dce22ab5b2fab8ecb09f252a3ea06bdfc724365 /mail/folder-browser-factory.c | |
parent | 66cfad20330cf8a2b5f56b5637064b481b3ac233 (diff) | |
download | gsoc2013-evolution-88b0244b327a951ea96687aaab1ed51439c23976.tar.gz gsoc2013-evolution-88b0244b327a951ea96687aaab1ed51439c23976.tar.zst gsoc2013-evolution-88b0244b327a951ea96687aaab1ed51439c23976.zip |
Add a serial number to FolderBrowser.
* folder-browser.c (folder_browser_new): Add a serial number to
FolderBrowser.
* folder-browser-factory.c (control_activate, control_deactivate):
Include fb serial number in the name of the Bonobo toolbar to
prevent problems with disappearing toolbars. This is a kludge and
should go away.
svn path=/trunk/; revision=3501
Diffstat (limited to 'mail/folder-browser-factory.c')
-rw-r--r-- | mail/folder-browser-factory.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index d4629d6e17..540119d3fd 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -24,7 +24,7 @@ #else #define CONTROL_FACTORY_ID "control-factory:evolution-mail" #endif - + static void random_cb (GtkWidget *button, gpointer user_data) { @@ -53,11 +53,13 @@ static GnomeUIInfo gnome_toolbar [] = { }; static void -control_activate (BonoboControl *control, BonoboUIHandler *uih) +control_activate (BonoboControl *control, BonoboUIHandler *uih, + FolderBrowser *fb) { Bonobo_UIHandler remote_uih; BonoboControl *toolbar_control; GtkWidget *toolbar, *toolbar_frame, *folder_browser; + char *toolbar_name = g_strdup_printf ("/Toolbar%d", fb->serial); remote_uih = bonobo_control_get_remote_ui_handler (control); bonobo_ui_handler_set_container (uih, remote_uih); @@ -111,23 +113,28 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih) gtk_widget_show_all (toolbar_frame); toolbar_control = bonobo_control_new (toolbar_frame); - bonobo_ui_handler_dock_add (uih, "/Toolbar", + bonobo_ui_handler_dock_add (uih, toolbar_name, bonobo_object_corba_objref (BONOBO_OBJECT (toolbar_control)), GNOME_DOCK_ITEM_BEH_EXCLUSIVE | GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL, GNOME_DOCK_TOP, 1, 1, 0); + g_free (toolbar_name); } static void -control_deactivate (BonoboControl *control, BonoboUIHandler *uih) +control_deactivate (BonoboControl *control, BonoboUIHandler *uih, + FolderBrowser *fb) { + char *toolbar_name = g_strdup_printf ("/Toolbar%d", fb->serial); + bonobo_ui_handler_menu_remove (uih, "/File/Mail"); bonobo_ui_handler_menu_remove (uih, "/Tools/Expunge"); bonobo_ui_handler_menu_remove (uih, "/Tools/Filter Druid ..."); bonobo_ui_handler_menu_remove (uih, "/Tools/Virtual Folder Druid ..."); bonobo_ui_handler_menu_remove (uih, "/Tools/Mail Configuration ..."); bonobo_ui_handler_menu_remove (uih, "/Tools/Forget Passwords"); - bonobo_ui_handler_dock_remove (uih, "/Toolbar"); + bonobo_ui_handler_dock_remove (uih, toolbar_name); + g_free (toolbar_name); } static void @@ -139,11 +146,11 @@ control_activate_cb (BonoboControl *control, uih = bonobo_control_get_ui_handler (control); g_assert (uih); - + if (activate) - control_activate (control, uih); + control_activate (control, uih, user_data); else - control_deactivate (control, uih); + control_deactivate (control, uih, user_data); } static void @@ -175,7 +182,7 @@ folder_browser_factory_new_control (void) } gtk_signal_connect (GTK_OBJECT (control), "activate", - control_activate_cb, NULL); + control_activate_cb, folder_browser); gtk_signal_connect (GTK_OBJECT (control), "destroy", control_destroy_cb, folder_browser); |