diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-07-26 06:21:19 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2012-07-26 06:21:19 +0000 |
commit | a283b31b327a080e740931b4dad41aae8877b663 (patch) | |
tree | cc05deedbf92d0b02c3fd555a3711f74ca29e03c | |
parent | db758e542a671240958a102bb8017e654153d1a7 (diff) |
enable quick launch from the attach tool menu.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3139 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/messageview.c | 17 |
2 files changed, 20 insertions, 1 deletions
@@ -1,5 +1,9 @@ 2012-07-26 + * src/messageview.c: enable quick launch from the attach tool menu. + +2012-07-26 + * src/prefs_common_dialog.c: moved Images option in Display - Attach tab. diff --git a/src/messageview.c b/src/messageview.c index 530b8d92..e59046e2 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -93,6 +93,8 @@ static gint messageview_menu_tool_btn_pressed (GtkWidget *widget, GdkEventButton *event, MessageView *messageview); +static void messageview_open_file_cb (GtkWidget *widget, + MessageView *messageview); static void messageview_save_all_cb (GtkWidget *widget, MessageView *messageview); static gboolean key_pressed (GtkWidget *widget, @@ -696,8 +698,11 @@ static void messageview_set_tool_menu(MessageView *messageview, name = "mimetmp"; menuitem = gtk_menu_item_new_with_label(name); gtk_widget_show(menuitem); - gtk_widget_set_sensitive(menuitem, FALSE); gtk_menu_shell_insert(GTK_MENU_SHELL(messageview->tool_menu), menuitem, pos++); + g_object_set_data(G_OBJECT(menuitem), "tool-menu-mimeinfo", partinfo); + g_signal_connect(G_OBJECT(menuitem), "activate", + G_CALLBACK(messageview_open_file_cb), + messageview); } } @@ -767,6 +772,7 @@ static void messageview_set_encoding_menu(MessageView *messageview) void messageview_clear(MessageView *messageview) { + messageview_set_tool_menu(messageview, NULL); procmsg_msginfo_free(messageview->msginfo); messageview->msginfo = NULL; messageview_change_view_type(messageview, MVIEW_TEXT); @@ -978,6 +984,15 @@ static gint messageview_menu_tool_btn_pressed(GtkWidget *widget, return TRUE; } +static void messageview_open_file_cb(GtkWidget *widget, MessageView *messageview) +{ + MimeInfo *partinfo; + + partinfo = g_object_get_data(G_OBJECT(widget), "tool-menu-mimeinfo"); + if (partinfo) + mimeview_launch_part(messageview->mimeview, partinfo); +} + static void messageview_save_all_cb(GtkWidget *widget, MessageView *messageview) { mimeview_save_all(messageview->mimeview); |