aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
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;