aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/main.c2
-rw-r--r--src/plugin.c14
-rw-r--r--src/plugin.h1
-rw-r--r--src/summaryview.c3
4 files changed, 20 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index fa725de5..97667b18 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1159,6 +1159,8 @@ static void plugin_init(void)
mainwin->folderview->news_factory);
syl_plugin_add_symbol("summaryview", mainwin->summaryview);
+ syl_plugin_add_symbol("summaryview_popup_factory",
+ mainwin->summaryview->popupfactory);
ADD_SYM(summary_select_by_msgnum);
ADD_SYM(summary_select_by_msginfo);
diff --git a/src/plugin.c b/src/plugin.c
index e428898c..85da3f10 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -31,6 +31,7 @@ enum {
PLUGIN_LOAD,
PLUGIN_UNLOAD,
FOLDERVIEW_MENU_POPUP,
+ SUMMARYVIEW_MENU_POPUP,
COMPOSE_CREATED,
COMPOSE_DESTROY,
LAST_SIGNAL
@@ -107,6 +108,17 @@ static void syl_plugin_class_init(SylPluginClass *klass)
G_TYPE_NONE,
1,
G_TYPE_POINTER);
+ plugin_signals[SUMMARYVIEW_MENU_POPUP] =
+ g_signal_new("summaryview-menu-popup",
+ G_TYPE_FROM_CLASS(gobject_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET(SylPluginClass,
+ summaryview_menu_popup),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_POINTER);
plugin_signals[COMPOSE_CREATED] =
g_signal_new("compose-created",
G_TYPE_FROM_CLASS(gobject_class),
@@ -433,6 +445,8 @@ static GtkItemFactory *get_item_factory(const gchar *path)
ifactory = syl_plugin_lookup_symbol("folderview_imap_popup_factory");
else if (strncmp(path, "<NewsFolder>", 12) == 0)
ifactory = syl_plugin_lookup_symbol("folderview_news_popup_factory");
+ else if (strncmp(path, "<SummaryView>", 13) == 0)
+ ifactory = syl_plugin_lookup_symbol("summaryview_popup_factory");
else
ifactory = syl_plugin_lookup_symbol("main_window_menu_factory");
diff --git a/src/plugin.h b/src/plugin.h
index 5ec55af5..6632f8e5 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -60,6 +60,7 @@ struct _SylPluginClass
void (* plugin_unload) (GObject *obj, GModule *module);
void (* folderview_menu_popup) (GObject *obj, gpointer ifactory);
+ void (* summaryview_menu_popup) (GObject *obj, gpointer ifactory);
void (* compose_created) (GObject *obj, gpointer compose);
void (* compose_destroy) (GObject *obj, gpointer compose);
diff --git a/src/summaryview.c b/src/summaryview.c
index b7bedbe2..b703b847 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -84,6 +84,7 @@
#include "colorlabel.h"
#include "inc.h"
#include "imap.h"
+#include "plugin.h"
#define STATUSBAR_PUSH(mainwin, str) \
{ \
@@ -5645,6 +5646,8 @@ static gboolean summary_button_pressed(GtkWidget *treeview,
return TRUE;
} else if (event->button == 3) {
/* right clicked */
+ syl_plugin_signal_emit("summaryview-menu-popup",
+ summaryview->popupfactory);
gtk_menu_popup(GTK_MENU(summaryview->popupmenu), NULL, NULL,
NULL, NULL, event->button, event->time);
if (is_selected) {