diff options
Diffstat (limited to 'mail/folder-browser-factory.c')
-rw-r--r-- | mail/folder-browser-factory.c | 93 |
1 files changed, 77 insertions, 16 deletions
diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index 3dd7a1eafd..9a33b407fe 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -133,33 +133,95 @@ msg_composer_cb (BonoboUIHandler *uih, void *user_data, const char *path) gtk_widget_show (composer); } +static void +check_cb (BonoboUIHandler *uih, void *user_data, const char *path) +{ + printf ("Yow! I am called back!\n"); +} -static void -control_add_menu (BonoboControl *control) + +static void +control_activate (BonoboControl *control, BonoboUIHandler *uih) { Bonobo_UIHandler remote_uih; - BonoboUIHandler *uih; + GtkWidget *toolbar; - uih = bonobo_control_get_ui_handler (control); - g_assert (uih); - remote_uih = bonobo_control_get_remote_ui_handler (control); bonobo_ui_handler_set_container (uih, remote_uih); - - bonobo_ui_handler_menu_new_item (uih, - "/File/New", N_("_Mail"), NULL, -1, - BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, 0, 0, - msg_composer_cb, NULL); - + + bonobo_ui_handler_menu_new_item (uih, "/File/Mail", N_("_Mail"), + NULL, -1, + BONOBO_UI_HANDLER_PIXMAP_NONE, NULL, + 0, 0, msg_composer_cb, NULL); + + toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, + GTK_TOOLBAR_BOTH); + + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "New mail", + "Check for new mail", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_MAIL_RCV), + check_cb, NULL); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Send", + "Send a new message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_MAIL_SND), + check_cb, NULL); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Find", + "Find messages", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_SEARCH), + check_cb, NULL); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Reply", + "Reply to the sender of this message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_MAIL_RPL), + check_cb, NULL); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Reply to All", + "Reply to all recipients of this message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_MAIL_RPL), + check_cb, NULL); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Forward", + "Forward this message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_MAIL_FWD), + check_cb, NULL); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Print", + "Print the selected message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_PRINT), + check_cb, NULL); + gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), "Delete", + "Delete this message", NULL, + gnome_stock_new_with_icon (GNOME_STOCK_PIXMAP_TRASH), + check_cb, NULL); + gtk_widget_show_all (toolbar); + + bonobo_ui_handler_dock_add (uih, "/Toolbar", + bonobo_object_corba_objref (bonobo_control_new (toolbar)), + GNOME_DOCK_ITEM_BEH_LOCKED | + GNOME_DOCK_ITEM_BEH_EXCLUSIVE, + GNOME_DOCK_TOP, + 1, 1, 0); } +static void +control_deactivate (BonoboControl *control, BonoboUIHandler *uih) +{ + bonobo_ui_handler_menu_remove (uih, "/File/Mail"); + bonobo_ui_handler_dock_remove (uih, "/Toolbar"); +} static void control_activate_cb (BonoboControl *control, gboolean activate, gpointer user_data) { - control_add_menu (control); + BonoboUIHandler *uih; + + uih = bonobo_control_get_ui_handler (control); + g_assert (uih); + + if (activate) + control_activate (control, uih); + else + control_deactivate (control, uih); } @@ -198,9 +260,8 @@ folder_browser_factory (BonoboGenericFactory *factory, void *closure) return NULL; } - gtk_signal_connect (GTK_OBJECT (control), "activate", control_activate_cb, NULL); - - + gtk_signal_connect (GTK_OBJECT (control), "activate", + control_activate_cb, NULL); bonobo_control_set_property_bag (control, |