aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--PLUGIN.ja.txt7
-rw-r--r--PLUGIN.txt7
-rw-r--r--plugin/test/test.c9
-rw-r--r--src/plugin.c7
-rw-r--r--src/plugin.h3
-rw-r--r--src/sylpheed-marshal.list2
-rw-r--r--src/textview.c6
8 files changed, 40 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index c20361a4..d92ae3c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2011-01-24
+ * version 3.1.0rc
+
+2011-01-24
+
+ * src/sylpheed-marshal.list
+ src/textview.c
+ src/plugin.[ch]
+ plugin/test/test.c: added MsgInfo argument to "textview-menu-popup"
+ signal.
+
+2011-01-24
+
* src/summaryview.c: fixed warnings about non-string literal format.
2011-01-21
diff --git a/PLUGIN.ja.txt b/PLUGIN.ja.txt
index 341c1fc5..5090b8cf 100644
--- a/PLUGIN.ja.txt
+++ b/PLUGIN.ja.txt
@@ -175,17 +175,20 @@ void (* textview_menu_popup) (GObject *obj,
GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
- const gchar *selected_text);
+ const gchar *selected_text,
+ MsgInfo *msginfo);
TextView でコンテキストメニューをポップアップするときに発行される
シグナルです。ここで渡された GtkMenu に対して任意のメニュー項目を
追加することができます。
-メニューオブジェクトは閉じられると自動的に破棄されます。
+メニューオブジェクトはメニューを開くたびに作成され、閉じられると自動的に
+破棄されるため、毎回メニュー項目を追加する必要があります。
menu: コンテキストメニューオブジェクト
textview: GtkTextView オブジェクト
uri: URI の上でメニューを表示した場合その URI 文字列
selected_text: テキストビューでテキストが選択されている場合、その文字列
+msginfo: テキストビューで表示されているメッセージの MsgInfo オブジェクト
-------------------------------------------------------------------------
* libsylph-0
diff --git a/PLUGIN.txt b/PLUGIN.txt
index 11fd51ef..990e23b8 100644
--- a/PLUGIN.txt
+++ b/PLUGIN.txt
@@ -173,16 +173,19 @@ void (* textview_menu_popup) (GObject *obj,
GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
- const gchar *selected_text);
+ const gchar *selected_text,
+ MsgInfo *msginfo);
Emitted on popup of the context menu of TextView.
You can add any menu items to the passed GtkMenu.
-The menu object will be destroyed when closed.
+The menu object will be created on open and destroyed on close, so menu items
+must be added each time.
menu: context menu object
textview: GtkTextView object
uri: URI string if the menu popups on an URI
selected_text: string if a string is selected on the text view
+msginfo: the MsgInfo message object displayed in the text view
-------------------------------------------------------------------------
* libsylph-0
diff --git a/plugin/test/test.c b/plugin/test/test.c
index f0e0fdf5..858f2f35 100644
--- a/plugin/test/test.c
+++ b/plugin/test/test.c
@@ -24,6 +24,7 @@
#include "plugin.h"
#include "test.h"
#include "folder.h"
+#include "procmsg.h"
static SylPluginInfo info = {
"Test Plugin",
@@ -43,7 +44,8 @@ static void summaryview_menu_popup_cb(GObject *obj, GtkItemFactory *ifactory,
static void textview_menu_popup_cb(GObject *obj, GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
- const gchar *selected_text);
+ const gchar *selected_text,
+ MsgInfo *msginfo);
static void menu_selected_cb(void);
@@ -162,13 +164,16 @@ static void activate_menu_cb(GtkMenuItem *menuitem, gpointer data)
static void textview_menu_popup_cb(GObject *obj, GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
- const gchar *selected_text)
+ const gchar *selected_text,
+ MsgInfo *msginfo)
{
GtkWidget *separator, *menuitem;
g_print("test: %p: textview menu popup\n", obj);
g_print("test: %p: uri: %s, text: %s\n", obj, uri ? uri : "(none)",
selected_text ? selected_text : "(none)");
+ g_print("test: %p: msg: %s\n", obj,
+ msginfo && msginfo->subject ? msginfo->subject : "");
separator = gtk_separator_menu_item_new();
gtk_menu_shell_append(GTK_MENU_SHELL(menu), separator);
diff --git a/src/plugin.c b/src/plugin.c
index d9d67e1d..07f940ac 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -164,13 +164,14 @@ static void syl_plugin_class_init(SylPluginClass *klass)
G_STRUCT_OFFSET(SylPluginClass,
textview_menu_popup),
NULL, NULL,
- sylpheed_marshal_VOID__POINTER_POINTER_STRING_STRING,
+ sylpheed_marshal_VOID__POINTER_POINTER_STRING_STRING_POINTER,
G_TYPE_NONE,
- 4,
+ 5,
G_TYPE_POINTER,
G_TYPE_POINTER,
G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_STRING,
+ G_TYPE_POINTER);
}
void syl_plugin_signal_connect(const gchar *name, GCallback callback,
diff --git a/src/plugin.h b/src/plugin.h
index f21026fe..26b03242 100644
--- a/src/plugin.h
+++ b/src/plugin.h
@@ -69,7 +69,8 @@ struct _SylPluginClass
GtkMenu *menu,
GtkTextView *textview,
const gchar *uri,
- const gchar *selected_text);
+ const gchar *selected_text,
+ MsgInfo *msginfo);
};
struct _SylPluginInfo
diff --git a/src/sylpheed-marshal.list b/src/sylpheed-marshal.list
index 9c87ba0c..c5eb054f 100644
--- a/src/sylpheed-marshal.list
+++ b/src/sylpheed-marshal.list
@@ -1,3 +1,3 @@
VOID:POINTER
VOID:INT,POINTER
-VOID:POINTER,POINTER,STRING,STRING
+VOID:POINTER,POINTER,STRING,STRING,POINTER
diff --git a/src/textview.c b/src/textview.c
index edb668fa..942d3b7a 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -2048,8 +2048,10 @@ static void textview_populate_popup(GtkWidget *widget, GtkMenu *menu,
finish:
syl_plugin_signal_emit("textview-menu-popup", menu,
- GTK_TEXT_VIEW(widget), uri ? uri->uri : NULL,
- selected_text);
+ GTK_TEXT_VIEW(widget),
+ uri ? uri->uri : NULL,
+ selected_text,
+ textview->messageview->msginfo);
g_free(selected_text);
}