From 99bac05ea5d0dc7a7aefdfe1e6066c31170824cb Mon Sep 17 00:00:00 2001 From: hiro Date: Tue, 6 Jul 2010 08:12:20 +0000 Subject: added new plug-in APIs for manipulating the summary view popup menu. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2601 ee746299-78ed-0310-b773-934348b2243d --- plugin/test/test.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) (limited to 'plugin') diff --git a/plugin/test/test.c b/plugin/test/test.c index bd42fb4b..07b2112e 100644 --- a/plugin/test/test.c +++ b/plugin/test/test.c @@ -34,8 +34,14 @@ static SylPluginInfo info = { static void init_done_cb(GObject *obj, gpointer data); static void app_exit_cb(GObject *obj, gpointer data); -static void menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, - gpointer data); + +static void folderview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, + gpointer data); +static void summaryview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, + gpointer data); + +static void menu_selected_cb(void); + static void compose_created_cb(GObject *obj, gpointer compose); static void compose_destroy_cb(GObject *obj, gpointer compose); @@ -75,12 +81,18 @@ void plugin_load(void) g_signal_connect(syl_app_get(), "app-exit", G_CALLBACK(app_exit_cb), NULL); syl_plugin_signal_connect("folderview-menu-popup", - G_CALLBACK(menu_popup_cb), NULL); + G_CALLBACK(folderview_menu_popup_cb), NULL); + syl_plugin_signal_connect("summaryview-menu-popup", + G_CALLBACK(summaryview_menu_popup_cb), NULL); syl_plugin_signal_connect("compose-created", G_CALLBACK(compose_created_cb), NULL); syl_plugin_signal_connect("compose-destroy", G_CALLBACK(compose_destroy_cb), NULL); + syl_plugin_add_factory_item("", "/---", NULL, NULL); + syl_plugin_add_factory_item("", "/Test Plug-in menu", + menu_selected_cb, NULL); + g_print("test plug-in loading done\n"); } @@ -109,12 +121,28 @@ static void app_exit_cb(GObject *obj, gpointer data) g_print("test: %p: app will exit\n", obj); } -static void menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, - gpointer data) +static void folderview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, + gpointer data) { g_print("test: %p: folderview menu popup\n", obj); } +static void summaryview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory, + gpointer data) +{ + GtkWidget *widget; + + g_print("test: %p: summaryview menu popup\n", obj); + widget = gtk_item_factory_get_item(ifactory, "/Test Plug-in menu"); + if (widget) + gtk_widget_set_sensitive(widget, TRUE); +} + +static void menu_selected_cb(void) +{ + g_print("test: menu selected\n"); +} + static void compose_created_cb(GObject *obj, gpointer compose) { gchar *text; -- cgit v1.2.3