aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-06 08:12:20 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2010-07-06 08:12:20 +0000
commit99bac05ea5d0dc7a7aefdfe1e6066c31170824cb (patch)
tree22d16310ef202ade10133651a9bd7753ed055cac /plugin
parent3ae0b30d7ebba63f15ef7b9ec0aff2a4c8b19e41 (diff)
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
Diffstat (limited to 'plugin')
-rw-r--r--plugin/test/test.c38
1 files changed, 33 insertions, 5 deletions
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("<SummaryView>", "/---", NULL, NULL);
+ syl_plugin_add_factory_item("<SummaryView>", "/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;