2012-08-29 [colin] 3.8.1cvs40
authorColin Leroy <colin@colino.net>
Wed, 29 Aug 2012 09:33:02 +0000 (09:33 +0000)
committerColin Leroy <colin@colino.net>
Wed, 29 Aug 2012 09:33:02 +0000 (09:33 +0000)
* src/mainwindow.c
* src/messageview.c
* src/mimeview.c
* src/mimeview.h
* src/summaryview.c
* src/textview.c
* src/gtk/menu.c
* src/gtk/menu.h
Move the hardcoded mimeview shortcuts to standard menus.

ChangeLog
PATCHSETS
configure.ac
src/gtk/menu.c
src/gtk/menu.h
src/mainwindow.c
src/messageview.c
src/mimeview.c
src/mimeview.h
src/summaryview.c
src/textview.c

index fbd183b..da96360 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-08-29 [colin]     3.8.1cvs40
+
+       * src/mainwindow.c
+       * src/messageview.c
+       * src/mimeview.c
+       * src/mimeview.h
+       * src/summaryview.c
+       * src/textview.c
+       * src/gtk/menu.c
+       * src/gtk/menu.h
+               Move the hardcoded mimeview shortcuts to standard menus.
+
 2012-08-27 [colin]     3.8.1cvs39
 
        * src/main.c
index b92bcc8..385719d 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.274.2.347 -r 1.274.2.348 src/mainwindow.c;  cvs diff -u -r 1.395.2.448 -r 1.395.2.449 src/summaryview.c;  ) > 3.8.1cvs37.patchset
 ( cvs diff -u -r 1.395.2.449 -r 1.395.2.450 src/summaryview.c;  ) > 3.8.1cvs38.patchset
 ( cvs diff -u -r 1.115.2.252 -r 1.115.2.253 src/main.c;  ) > 3.8.1cvs39.patchset
+( cvs diff -u -r 1.274.2.348 -r 1.274.2.349 src/mainwindow.c;  cvs diff -u -r 1.94.2.237 -r 1.94.2.238 src/messageview.c;  cvs diff -u -r 1.83.2.192 -r 1.83.2.193 src/mimeview.c;  cvs diff -u -r 1.20.2.37 -r 1.20.2.38 src/mimeview.h;  cvs diff -u -r 1.395.2.450 -r 1.395.2.451 src/summaryview.c;  cvs diff -u -r 1.96.2.244 -r 1.96.2.245 src/textview.c;  cvs diff -u -r 1.5.2.46 -r 1.5.2.47 src/gtk/menu.c;  cvs diff -u -r 1.4.2.26 -r 1.4.2.27 src/gtk/menu.h;  ) > 3.8.1cvs40.patchset
index 9617eaa..3c0a53d 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=39
+EXTRA_VERSION=40
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 0b7a5d1..0684b6f 100644 (file)
@@ -106,6 +106,33 @@ void cm_menu_set_sensitive_full(GtkUIManager *gui_manager, gchar *menu, gboolean
        g_free(path);
 }
 
+gchar *cm_menu_item_get_shortcut(GtkUIManager *gui_manager, gchar *menu)
+{
+       GtkWidget *widget;
+       gchar *path = g_strdup_printf("/%s/", menu);
+       const gchar *accel = NULL;
+       GtkAccelKey key;
+
+       widget = gtk_ui_manager_get_widget(gui_manager, path);
+       if( !GTK_IS_WIDGET(widget) ) {
+               g_message("Blah, '%s' is not a widget.\n", path);
+       }
+
+       if( !GTK_IS_MENU_ITEM(widget) ) {
+               g_message("Blah, '%s' is not a menu item.\n", path);
+       }
+
+       g_free(path);
+
+       accel = gtk_menu_item_get_accel_path(GTK_MENU_ITEM(widget));
+
+       if (accel && gtk_accel_map_lookup_entry(accel, &key))
+               return gtk_accelerator_get_label (key.accel_key, key.accel_mods);
+       else
+               return g_strdup(_("None"));
+
+}
+
 void cm_toggle_menu_set_active_full(GtkUIManager *gui_manager, gchar *menu, gboolean active)
 {
        GtkWidget *widget;
index 140670a..9342ebd 100644 (file)
@@ -93,7 +93,7 @@ void cm_menu_set_sensitive(gchar *menu, gboolean sensitive);
 void cm_toggle_menu_set_active(gchar *menu, gboolean active);
 void cm_menu_set_sensitive_full(GtkUIManager *gui_manager, gchar *menu, gboolean sensitive);
 void cm_toggle_menu_set_active_full(GtkUIManager *gui_manager, gchar *menu, gboolean active);
-
+gchar *cm_menu_item_get_shortcut(GtkUIManager *gui_manager, gchar *menu);
 #if !GTK_CHECK_VERSION(3, 0, 0)
 gint menu_find_option_menu_index(GtkCMOptionMenu *optmenu, gpointer data,
                                 GCompareFunc func);
index 13b73e7..99d5e52 100644 (file)
@@ -447,6 +447,15 @@ static void mainwindow_quicksearch         (GtkAction      *action,
                                  gpointer       data);
 static gboolean any_folder_want_synchronise(void);
 
+static void save_part_as_cb(GtkAction *action, gpointer data);
+static void view_part_as_text_cb(GtkAction *action, gpointer data);
+static void open_part_cb(GtkAction *action, gpointer data);
+#ifndef G_OS_WIN32
+static void open_part_with_cb(GtkAction *action, gpointer data);
+#endif
+static void check_signature_cb(GtkAction *action, gpointer data);
+static void goto_next_part_cb(GtkAction *action, gpointer data);
+static void goto_prev_part_cb(GtkAction *action, gpointer data);
 #define DO_ACTION(name, act)   { if (!strcmp(a_name, name)) action = act; }
 
 static void mainwindow_nothing_cb         (GtkAction *action, gpointer data)
@@ -507,7 +516,9 @@ static GtkActionEntry mainwin_entries[] =
        {"File/EmptyTrashes",                   NULL, N_("Empty all _Trash folders"), "<shift>D", NULL, G_CALLBACK(empty_trash_cb) },
        /* {"File/---",                         NULL, "---" }, */
 
-       {"File/SaveAs",                         NULL, N_("_Save as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
+       {"File/SaveAs",                         NULL, N_("_Save email as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
+       {"File/SavePartAs",                     NULL, N_("_Save part as..."), "Y", NULL, G_CALLBACK(save_part_as_cb) },
+       /* {"File/---",                         NULL, "---" }, */
 
        {"File/PageSetup",                      NULL, N_("Page setup..."), NULL, NULL, G_CALLBACK(page_setup_cb) },
        {"File/Print",                          NULL, N_("_Print..."), "<control>P", NULL, G_CALLBACK(print_cb) },
@@ -570,6 +581,9 @@ static GtkActionEntry mainwin_entries[] =
        /* {"View/Goto/---",                    NULL, "---", NULL, NULL, NULL }, */
        {"View/Goto/NextUnreadFolder",          NULL, N_("Next unread _folder"), "<shift>G", NULL, G_CALLBACK(goto_unread_folder_cb) },
        {"View/Goto/OtherFolder",               NULL, N_("_Other folder..."), "G", NULL, G_CALLBACK(goto_folder_cb) },
+       /* {"View/Goto/---",                    NULL, "---", NULL, NULL, NULL }, */
+       {"View/Goto/NextPart",                  NULL, N_("Next part"), "A", NULL, G_CALLBACK(goto_next_part_cb) },
+       {"View/Goto/PrevPart",                  NULL, N_("Previous part"), "Z", NULL, G_CALLBACK(goto_prev_part_cb) },
 
         /* {"View/Scroll/---",                  NULL, "---", NULL, NULL, NULL }, */
         {"View/Scroll",                         NULL, N_("Message scroll") },
@@ -603,6 +617,15 @@ static GtkActionEntry mainwin_entries[] =
        /* {"View/---",                         NULL, "---", NULL, NULL, NULL }, */
        {"View/OpenNewWindow",                  NULL, N_("Open in new _window"), "<control><alt>N", NULL, G_CALLBACK(open_msg_cb) },
        {"View/MessageSource",                  NULL, N_("Mess_age source"), "<control>U", NULL, G_CALLBACK(view_source_cb) },
+       /* {"View/---",                         NULL, "---", NULL, NULL, NULL }, */
+       {"View/Part",                           NULL, N_("Message part") },
+       {"View/Part/AsText",                    NULL, N_("View as text"), "T", NULL, G_CALLBACK(view_part_as_text_cb) },
+       {"View/Part/Open",                      NULL, N_("Open"), "L", NULL, G_CALLBACK(open_part_cb) },
+#ifndef G_OS_WIN32
+       {"View/Part/OpenWith",                  NULL, N_("Open with..."), "O", NULL, G_CALLBACK(open_part_with_cb) },
+#endif
+       /* {"View/---",                         NULL, "---", NULL, NULL, NULL }, */
+
        {"View/Quotes",                         NULL, N_("Quotes") }, 
        /* {"View/---",                         NULL, "---", NULL, NULL, NULL }, */
        {"View/UpdateSummary",                  NULL, N_("_Update summary"), "<control><alt>U", NULL, G_CALLBACK(update_summary_cb) },
@@ -683,6 +706,9 @@ static GtkActionEntry mainwin_entries[] =
        /*{"Message/---",                       NULL, "---" },*/
 
        {"Message/Reedit",                      NULL, N_("Re-_edit"), NULL, NULL, G_CALLBACK(reedit_cb) },
+       /*{"Message/---",                       NULL, "---" },*/
+
+       {"Message/CheckSignature",              NULL, N_("Check signature"), "C", NULL, G_CALLBACK(check_signature_cb) },
 
 /* Tools menu */
 
@@ -1653,12 +1679,14 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "EmptyTrashes", "File/EmptyTrashes", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator4", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SaveAs", "File/SaveAs", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SavePartAs", "File/SavePartAs", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator5", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "PageSetup", "File/PageSetup", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Print", "File/Print", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator5", "File/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator6", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "OfflineMode", "File/OfflineMode", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "SynchroniseFolders", "File/SynchroniseFolders", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator6", "File/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Separator7", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/File", "Exit", "File/Exit", GTK_UI_MANAGER_MENUITEM)
 
 /* Edit menu */
@@ -1757,6 +1785,9 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator7", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextUnreadFolder", "View/Goto/NextUnreadFolder", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "OtherFolder", "View/Goto/OtherFolder", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator8", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextPart", "View/Goto/NextPart", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevPart", "View/Goto/PrevPart", GTK_UI_MANAGER_MENUITEM)
         MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
         MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "PrevLine", "View/Scroll/PrevLine", GTK_UI_MANAGER_MENUITEM)
         MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "NextLine", "View/Scroll/NextLine", GTK_UI_MANAGER_MENUITEM)
@@ -1837,7 +1868,13 @@ MainWindow *main_window_create()
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "CollapseAll", "View/Quotes/CollapseAll", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "Collapse2", "View/Quotes/Collapse2", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Quotes", "Collapse3", "View/Quotes/Collapse3", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator6", "View/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Part", "View/Part", GTK_UI_MANAGER_MENU)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Part", "AsText", "View/Part/AsText", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Part", "Open", "View/Part/Open", GTK_UI_MANAGER_MENUITEM)
+#ifndef G_OS_WIN32
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Part", "OpenWith", "View/Part/OpenWith", GTK_UI_MANAGER_MENUITEM)
+#endif
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator8", "View/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "UpdateSummary", "View/UpdateSummary", GTK_UI_MANAGER_MENUITEM)
 
 /* Message menu */
@@ -1910,6 +1947,7 @@ MainWindow *main_window_create()
 
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Reedit", "Message/Reedit", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator6", "Message/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "CheckSignature", "Message/CheckSignature", GTK_UI_MANAGER_MENUITEM)
 
 /* Tools menu */
        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Tools", "AddressBook", "Tools/AddressBook", GTK_UI_MANAGER_MENUITEM)
@@ -3220,12 +3258,14 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        GtkWidget *menu;
        GList *children, *cur_item;
        gint i;
+       gboolean mimepart_selected = FALSE;
 
        static const struct {
                gchar *const entry;
                SensitiveCond cond;
        } entry[] = {
                {"Menu/File/SaveAs", M_TARGET_EXIST},
+               {"Menu/File/SavePartAs", M_SINGLE_TARGET_EXIST},
                {"Menu/File/Print"  , M_TARGET_EXIST},
                {"Menu/File/SynchroniseFolders", M_WANT_SYNC},
                {"Menu/File/Exit"      , M_UNLOCKED},
@@ -3251,8 +3291,11 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"Menu/View/Goto/PrevLabeled", M_MSG_EXIST},
                {"Menu/View/Goto/NextLabeled", M_MSG_EXIST},
                {"Menu/View/Goto/ParentMessage"      , M_SINGLE_TARGET_EXIST},
+               {"Menu/View/Goto/NextPart"      , M_SINGLE_TARGET_EXIST},
+               {"Menu/View/Goto/PrevPart"      , M_SINGLE_TARGET_EXIST},
                {"Menu/View/OpenNewWindow"        , M_SINGLE_TARGET_EXIST},
                {"Menu/View/MessageSource"            , M_SINGLE_TARGET_EXIST},
+               {"Menu/View/Part"            , M_SINGLE_TARGET_EXIST},
                {"Menu/View/AllHeaders"                    , M_SINGLE_TARGET_EXIST},
                {"Menu/View/Quotes"                    , M_SINGLE_TARGET_EXIST},
 
@@ -3286,6 +3329,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"Menu/Message/ColorLabel"                , M_TARGET_EXIST},
                {"Menu/Message/Tags"              , M_TARGET_EXIST},
                {"Menu/Message/Reedit"               , M_HAVE_ACCOUNT|M_ALLOW_REEDIT},
+               {"Menu/Message/CheckSignature"               , M_SINGLE_TARGET_EXIST},
 
                {"Menu/Tools/AddSenderToAB"   , M_SINGLE_TARGET_EXIST},
                {"Menu/Tools/CollectAddresses"            , M_FOLDER_SELECTED},
@@ -3419,6 +3463,17 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
        cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Goto/NextHistory",
                messageview_nav_has_next(mainwin->messageview));
 
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimepart_selected = !mimeview_tree_is_empty(mainwin->messageview->mimeview);
+
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/File/SavePartAs", mimepart_selected);
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Goto/NextPart", mimepart_selected);
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Goto/PrevPart", mimepart_selected);
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/Part", mimepart_selected);
+       cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/Message/CheckSignature", 
+                                  mimepart_selected && mainwin->messageview->mimeview->signed_part);
+
        main_window_menu_callback_unblock(mainwin);
 }
 
@@ -5451,6 +5506,69 @@ void mainwindow_enter_folder(MainWindow *mainwin) {
        main_window_set_menu_sensitive(mainwin);
 }
 
+static void save_part_as_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_save_as(mainwin->messageview->mimeview);
+}
+
+static void view_part_as_text_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_display_as_text(mainwin->messageview->mimeview);
+}
+
+static void open_part_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_launch(mainwin->messageview->mimeview, NULL);
+}
+#ifndef G_OS_WIN32
+static void open_part_with_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_open_with(mainwin->messageview->mimeview);
+}
+#endif
+static void check_signature_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_check_signature(mainwin->messageview->mimeview);
+}
+
+static void goto_next_part_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_select_next_part(mainwin->messageview->mimeview);
+}
+
+static void goto_prev_part_cb(GtkAction *action, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+
+       if (mainwin->messageview 
+       &&  mainwin->messageview->mimeview)
+               mimeview_select_prev_part(mainwin->messageview->mimeview);
+}
+
 #ifdef MAEMO
 gboolean maemo_mainwindow_is_fullscreen(GtkWidget *widget)
 {
index fbf81bf..75de4a3 100644 (file)
@@ -185,6 +185,16 @@ static void messageview_update             (MessageView    *msgview,
                                         MsgInfo        *old_msginfo);
 static gboolean messageview_update_msg (gpointer source, gpointer data);
 
+static void save_part_as_cb(GtkAction *action, gpointer data);
+static void view_part_as_text_cb(GtkAction *action, gpointer data);
+static void open_part_cb(GtkAction *action, gpointer data);
+#ifndef G_OS_WIN32
+static void open_part_with_cb(GtkAction *action, gpointer data);
+#endif
+static void check_signature_cb(GtkAction *action, gpointer data);
+static void goto_next_part_cb(GtkAction *action, gpointer data);
+static void goto_prev_part_cb(GtkAction *action, gpointer data);
+
 static void messageview_nothing_cb        (GtkAction *action, gpointer data)
 {
 
@@ -204,7 +214,8 @@ static GtkActionEntry msgview_entries[] =
        {"PlaceHolder",                 NULL, "Placeholder", NULL, NULL, G_CALLBACK(messageview_nothing_cb) },
 
 /* File menu */
-       {"File/SaveAs",                 NULL, N_("_Save as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
+       {"File/SaveAs",                 NULL, N_("_Save email as..."), "<control>S", NULL, G_CALLBACK(save_as_cb) },
+       {"File/SavePartAs",             NULL, N_("_Save part as..."), "Y", NULL, G_CALLBACK(save_part_as_cb) },
        {"File/PageSetup",              NULL, N_("Page setup..."), NULL, NULL, G_CALLBACK(page_setup_cb) },
        {"File/Print",                  NULL, N_("_Print..."), "<control>P", NULL, G_CALLBACK(print_cb) },
        {"File/---",                    NULL, "---", NULL, NULL, NULL },
@@ -241,6 +252,8 @@ static GtkActionEntry msgview_entries[] =
        {"View/Goto/NextUnreadFolder",  NULL, N_("Next unread _folder"), "<shift>G", NULL, G_CALLBACK(goto_unread_folder_cb) },
        {"View/Goto/OtherFolder",       NULL, N_("_Other folder..."), "G", NULL, G_CALLBACK(goto_folder_cb) },
        /* {"View/Goto/---",            NULL, "---", NULL, NULL, NULL }, */
+       {"View/Goto/NextPart",          NULL, N_("Next part"), "A", NULL, G_CALLBACK(goto_next_part_cb) },
+       {"View/Goto/PrevPart",          NULL, N_("Previous part"), "Z", NULL, G_CALLBACK(goto_prev_part_cb) },
         {"View/Scroll",                 NULL, N_("Message scroll") },
         {"View/Scroll/PrevLine",        NULL, N_("Previous line"), NULL, NULL, G_CALLBACK(scroll_prev_line_cb) },
         {"View/Scroll/NextLine",        NULL, N_("Next line"), NULL, NULL, G_CALLBACK(scroll_next_line_cb) },
@@ -271,6 +284,12 @@ static GtkActionEntry msgview_entries[] =
 
        {"View/---",                    NULL, "---", NULL, NULL, NULL },
        {"View/MessageSource",          NULL, N_("Mess_age source"), "<control>U", NULL, G_CALLBACK(view_source_cb) },
+       {"View/Part",                   NULL, N_("Message part") },
+       {"View/Part/AsText",            NULL, N_("View as text"), "T", NULL, G_CALLBACK(view_part_as_text_cb) },
+       {"View/Part/Open",              NULL, N_("Open"), "L", NULL, G_CALLBACK(open_part_cb) },
+#ifndef G_OS_WIN32
+       {"View/Part/OpenWith",          NULL, N_("Open with..."), "O", NULL, G_CALLBACK(open_part_with_cb) },
+#endif
 
        {"View/Quotes",                 NULL, N_("Quotes") }, 
 
@@ -288,6 +307,7 @@ static GtkActionEntry msgview_entries[] =
        {"Message/Forward",             NULL, N_("_Forward"), "<control><alt>F", NULL, G_CALLBACK(reply_cb) }, /* COMPOSE_FORWARD_INLINE */
        {"Message/ForwardAtt",          NULL, N_("For_ward as attachment"), NULL, NULL, G_CALLBACK(reply_cb) }, /* COMPOSE_FORWARD_AS_ATTACH */
        {"Message/Redirect",            NULL, N_("Redirec_t"), NULL, NULL, G_CALLBACK(reply_cb) }, /* COMPOSE_REDIRECT */
+       {"Message/CheckSignature",              NULL, N_("Check signature"), "C", NULL, G_CALLBACK(check_signature_cb) },
 
 /* Tools menu */       
        {"Tools/AddressBook",           NULL, N_("_Address book"), "<control><shift>A", NULL, G_CALLBACK(addressbook_open_cb) }, 
@@ -474,9 +494,11 @@ static void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
 
 /* File menu */
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "SaveAs", "File/SaveAs", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "SavePartAs", "File/SavePartAs", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Separator1", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "PageSetup", "File/PageSetup", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Print", "File/Print", GTK_UI_MANAGER_MENUITEM)
-       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Separator1", "File/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Separator2", "File/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/File", "Close", "File/Close", GTK_UI_MANAGER_MENUITEM)
 
 /* Edit menu */
@@ -509,6 +531,9 @@ static void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator7", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextUnreadFolder", "View/Goto/NextUnreadFolder", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "OtherFolder", "View/Goto/OtherFolder", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "Separator8", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "NextPart", "View/Goto/NextPart", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Goto", "PrevPart", "View/Goto/PrevPart", GTK_UI_MANAGER_MENUITEM)
 
         MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
         MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Scroll", "PrevLine", "View/Scroll/PrevLine", GTK_UI_MANAGER_MENUITEM)
@@ -591,6 +616,12 @@ static void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "CollapseAll", "View/Quotes/CollapseAll", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Collapse2", "View/Quotes/Collapse2", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Quotes", "Collapse3", "View/Quotes/Collapse3", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View", "Part", "View/Part", GTK_UI_MANAGER_MENU)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Part", "AsText", "View/Part/AsText", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Part", "Open", "View/Part/Open", GTK_UI_MANAGER_MENUITEM)
+#ifndef G_OS_WIN32
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/View/Part", "OpenWith", "View/Part/OpenWith", GTK_UI_MANAGER_MENUITEM)
+#endif
 
 /* Message menu */
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "Compose", "Message/Compose", GTK_UI_MANAGER_MENUITEM)
@@ -604,6 +635,7 @@ static void messageview_add_toolbar(MessageView *msgview, GtkWidget *window)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "Forward", "Message/Forward", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "ForwardAtt", "Message/ForwardAtt", GTK_UI_MANAGER_MENUITEM)
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "Redirect", "Message/Redirect", GTK_UI_MANAGER_MENUITEM)
+       MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Message", "CheckSignature", "Message/CheckSignature", GTK_UI_MANAGER_MENUITEM)
 
 /* Tools menu */
        MENUITEM_ADDUI_MANAGER(msgview->ui_manager, "/Menu/Tools", "AddressBook", "Tools/AddressBook", GTK_UI_MANAGER_MENUITEM)
@@ -2945,6 +2977,8 @@ void messageview_set_menu_sensitive(MessageView *messageview)
        cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse3", (prefs_common.hide_quotes == 3));
        cm_menu_set_sensitive_full(messageview->ui_manager, "Menu/View/Goto/PrevHistory", messageview_nav_has_prev(messageview));
        cm_menu_set_sensitive_full(messageview->ui_manager, "Menu/View/Goto/NextHistory", messageview_nav_has_next(messageview));
+
+       cm_menu_set_sensitive_full(messageview->ui_manager, "Menu/Message/CheckSignature", messageview->mimeview->signed_part);
 }
 
 void messageview_learn (MessageView *msgview, gboolean is_spam)
@@ -3007,3 +3041,60 @@ void messageview_list_urls (MessageView  *msgview)
        g_slist_free(newlist);
        g_hash_table_destroy(uri_hashtable);
 }
+
+static void save_part_as_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_save_as(messageview->mimeview);
+}
+
+static void view_part_as_text_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_display_as_text(messageview->mimeview);
+}
+
+static void open_part_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_launch(messageview->mimeview, NULL);
+}
+#ifndef G_OS_WIN32
+static void open_part_with_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_open_with(messageview->mimeview);
+}
+#endif
+static void check_signature_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_check_signature(messageview->mimeview);
+}
+
+static void goto_next_part_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_select_next_part(messageview->mimeview);
+}
+
+static void goto_prev_part_cb(GtkAction *action, gpointer data)
+{
+       MessageView *messageview = (MessageView *)data;
+
+       if (messageview->mimeview)
+               mimeview_select_prev_part(messageview->mimeview);
+}
+
index 79eb033..ccdf6f4 100644 (file)
@@ -108,21 +108,15 @@ static void mimeview_drag_data_get      (GtkWidget          *widget,
 static gboolean mimeview_scrolled      (GtkWidget      *widget,
                                         GdkEventScroll *event,
                                         MimeView       *mimeview);
-static void mimeview_display_as_text   (MimeView       *mimeview);
-static void mimeview_save_as           (MimeView       *mimeview);
+
 static void mimeview_save_all          (MimeView       *mimeview);
-static void mimeview_launch            (MimeView       *mimeview,
-                                        MimeInfo       *partinfo);
 #ifndef G_OS_WIN32
-static void mimeview_open_with         (MimeView       *mimeview);
 static void mimeview_open_part_with    (MimeView       *mimeview,
                                         MimeInfo       *partinfo,
                                         gboolean        automatic);
 #endif
 static void mimeview_send_to           (MimeView       *mimeview,
                                         MimeInfo       *partinfo);
-static void mimeview_select_next_part  (MimeView       *mimeview);
-static void mimeview_select_prev_part  (MimeView       *mimeview);
 static void mimeview_view_file         (const gchar    *filename,
                                         MimeInfo       *partinfo,
                                         const gchar    *cmd,
@@ -204,16 +198,16 @@ static void mimeview_select_prev_part_cb(GtkAction *action, gpointer data)
 
 static GtkActionEntry mimeview_menu_actions[] = {
        { "MimeView", NULL, "MimeView" },
-       { "MimeView/Open", NULL, N_("_Open (l)"), NULL, "Open MIME part", G_CALLBACK(mimeview_launch_cb) },
+       { "MimeView/Open", NULL, N_("_Open"), NULL, "Open MIME part", G_CALLBACK(mimeview_launch_cb) },
 #if (!defined MAEMO && !defined G_OS_WIN32)
-       { "MimeView/OpenWith", NULL, N_("Open _with (o)..."), NULL, "Open MIME part with...", G_CALLBACK(mimeview_open_with_cb) },
+       { "MimeView/OpenWith", NULL, N_("Open _with..."), NULL, "Open MIME part with...", G_CALLBACK(mimeview_open_with_cb) },
 #endif
        { "MimeView/SendTo", NULL, N_("Send to..."), NULL, "Send to", G_CALLBACK(mimeview_send_to_cb) },
-       { "MimeView/DisplayAsText", NULL, N_("_Display as text (t)"), NULL, "Display as text", G_CALLBACK(mimeview_display_as_text_cb) },
-       { "MimeView/SaveAs", NULL, N_("_Save as (y)..."), NULL, "Save as", G_CALLBACK(mimeview_save_as_cb) },
+       { "MimeView/DisplayAsText", NULL, N_("_Display as text"), NULL, "Display as text", G_CALLBACK(mimeview_display_as_text_cb) },
+       { "MimeView/SaveAs", NULL, N_("_Save as..."), NULL, "Save as", G_CALLBACK(mimeview_save_as_cb) },
        { "MimeView/SaveAll", NULL, N_("Save _all..."), NULL, "Save all parts", G_CALLBACK(mimeview_save_all_cb) },
-       { "MimeView/NextPart", NULL, N_("Next part (a)"), NULL, "Next part", G_CALLBACK(mimeview_select_next_part_cb) },
-       { "MimeView/PrevPart", NULL, N_("Previous part (z)"), NULL, "Previous part", G_CALLBACK(mimeview_select_prev_part_cb) }
+       { "MimeView/NextPart", NULL, N_("Next part"), NULL, "Next part", G_CALLBACK(mimeview_select_next_part_cb) },
+       { "MimeView/PrevPart", NULL, N_("Previous part"), NULL, "Previous part", G_CALLBACK(mimeview_select_prev_part_cb) }
 };
 
 static GtkTargetEntry mimeview_mime_types[] =
@@ -1010,7 +1004,6 @@ void mimeview_clear(MimeView *mimeview)
 }
 
 static void check_signature_cb(GtkWidget *widget, gpointer user_data);
-static void mimeview_check_signature(MimeView *mimeview);
 static void display_full_info_cb(GtkWidget *widget, gpointer user_data);
 
 static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo, 
@@ -1328,7 +1321,7 @@ static void check_signature_cb(GtkWidget *widget, gpointer user_data)
        }
 }
 
-static void mimeview_check_signature(MimeView *mimeview)
+void mimeview_check_signature(MimeView *mimeview)
 {
        check_signature_cb(NULL, mimeview);     
 }
@@ -1386,7 +1379,13 @@ static void update_signature_info(MimeView *mimeview, MimeInfo *selected)
                siginfo = procmime_mimeinfo_parent(siginfo);
        }
        mimeview->siginfo = siginfo;
-       
+
+       /* This shortcut boolean is there to correctly set the menu's
+        * CheckSignature item sensitivity without killing performance
+        * each time the menu sensitiveness is updated (a lot).
+        */
+       mimeview->signed_part = (siginfo == selected);
+
        if (siginfo == NULL) {
                noticeview_hide(mimeview->siginfoview);
                return;
@@ -1535,7 +1534,7 @@ gboolean mimeview_pass_key_press_event(MimeView *mimeview, GdkEventKey *event)
        return mimeview_key_pressed(mimeview->ctree, event, mimeview);
 }
 
-static void mimeview_select_next_part(MimeView *mimeview)
+void mimeview_select_next_part(MimeView *mimeview)
 {
        GtkTreeView *ctree = GTK_TREE_VIEW(mimeview->ctree);
        GtkTreeModel *model = gtk_tree_view_get_model(ctree);
@@ -1568,7 +1567,7 @@ skip:
        gtk_tree_path_free(path);
 }
 
-static void mimeview_select_prev_part(MimeView *mimeview)
+void mimeview_select_prev_part(MimeView *mimeview)
 {
        GtkTreeView *ctree = GTK_TREE_VIEW(mimeview->ctree);
        GtkTreeModel *model = gtk_tree_view_get_model(ctree);
@@ -1644,36 +1643,6 @@ static gint mimeview_key_pressed(GtkWidget *widget, GdkEventKey *event,
        case GDK_KEY_Down:
                mimeview_scroll_one_line(mimeview, (event->keyval == GDK_KEY_Up));
                return TRUE;
-       case GDK_KEY_y:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_save_as(mimeview);
-               return TRUE;
-       case GDK_KEY_t:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_display_as_text(mimeview);
-               return TRUE;    
-       case GDK_KEY_l:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_launch(mimeview, NULL);
-               return TRUE;
-       case GDK_KEY_o:
-               BREAK_ON_MODIFIER_KEY();
-#ifndef G_OS_WIN32
-               mimeview_open_with(mimeview);
-#endif
-               return TRUE;
-       case GDK_KEY_c:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_check_signature(mimeview);
-               return TRUE;
-       case GDK_KEY_a:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_next_part(mimeview);
-               return TRUE;
-       case GDK_KEY_z:
-               BREAK_ON_MODIFIER_KEY();
-               mimeview_select_prev_part(mimeview);
-               return TRUE;
        default:
                break;
        }
@@ -1965,7 +1934,7 @@ static MimeInfo *mimeview_get_part_to_use(MimeView *mimeview)
  * Menu callback: Save the selected attachment
  * \param mimeview Current display
  */
-static void mimeview_save_as(MimeView *mimeview)
+void mimeview_save_as(MimeView *mimeview)
 {
        gchar *filename;
        gchar *filepath = NULL;
@@ -2027,7 +1996,7 @@ static void mimeview_save_as(MimeView *mimeview)
        g_free(filepath);
 }
 
-static void mimeview_display_as_text(MimeView *mimeview)
+void mimeview_display_as_text(MimeView *mimeview)
 {
        MimeInfo *partinfo;
 
@@ -2039,7 +2008,7 @@ static void mimeview_display_as_text(MimeView *mimeview)
        mimeview_show_message_part(mimeview, partinfo);
 }
 
-static void mimeview_launch(MimeView *mimeview, MimeInfo *partinfo)
+void mimeview_launch(MimeView *mimeview, MimeInfo *partinfo)
 {
        gchar *filename;
        gint err;
@@ -2065,7 +2034,7 @@ static void mimeview_launch(MimeView *mimeview, MimeInfo *partinfo)
 }
 
 #ifndef G_OS_WIN32
-static void mimeview_open_with(MimeView *mimeview)
+void mimeview_open_with(MimeView *mimeview)
 {
        MimeInfo *partinfo;
 
@@ -2366,18 +2335,10 @@ void mimeview_select_mimepart_icon(MimeView *mimeview, MimeInfo *partinfo)
 static gint icon_key_pressed(GtkWidget *button, GdkEventKey *event,
                             MimeView *mimeview)
 {
-       gint          num;
-       MimeInfo     *partinfo;
        SummaryView  *summaryview;
-       TextView     *textview;
-
-       num      = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button), "icon_number"));
-       partinfo = g_object_get_data(G_OBJECT(button), "partinfo");
        
        if (!event) return FALSE;
 
-       textview = mimeview->textview;
-
        switch (event->keyval) {
        case GDK_KEY_space:
                if (mimeview_scroll_page(mimeview, FALSE))
index fdd57e2..73cae62 100644 (file)
@@ -102,6 +102,8 @@ struct _MimeView
        MimeInfo *spec_part;
        GtkUIManager *ui_manager;
        GtkActionGroup *action_group;
+       gboolean signed_part;
+
 #ifdef USE_PTHREAD
        SigCheckData *check_data;
 #endif
@@ -177,6 +179,17 @@ gboolean mimeview_has_viewer_for_content_type
                                        (MimeView       *mimeview,
                                         const gchar    *content_type);
 gboolean mimeview_tree_is_empty                (MimeView       *mimeview);
+void mimeview_save_as          (MimeView       *mimeview);
+void mimeview_display_as_text  (MimeView       *mimeview);
+void mimeview_launch           (MimeView       *mimeview,
+                                MimeInfo       *partinfo);
+#ifndef G_OS_WIN32
+void mimeview_open_with                (MimeView       *mimeview);
+#endif
+void mimeview_check_signature(MimeView *mimeview);
+void mimeview_select_next_part(MimeView *mimeview);
+void mimeview_select_prev_part(MimeView *mimeview);
+
 
 #ifdef __cplusplus
 }
index 9d8cb0e..d2c720b 100644 (file)
@@ -6734,20 +6734,6 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                BREAK_ON_MODIFIER_KEY();
                summary_delete_trash(summaryview);
                break;
-       case GDK_KEY_y:
-       case GDK_KEY_t:
-       case GDK_KEY_l:
-       case GDK_KEY_o:
-       case GDK_KEY_c:
-       case GDK_KEY_a:
-       case GDK_KEY_z:
-               if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) == 0) {
-                       g_signal_stop_emission_by_name(G_OBJECT(widget), 
-                                       "key_press_event");
-                       mimeview_pass_key_press_event(messageview->mimeview,
-                                                     event);
-                       break;
-               }
        default:
                break;
        }
index 15477a6..121f415 100644 (file)
@@ -944,10 +944,16 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
        GtkTextBuffer *buffer;
        GtkTextIter iter;
        const gchar *name;
-       gchar *content_type;
+       gchar *content_type, *shortcut;
+       GtkUIManager *ui_manager;
 
        if (!partinfo) return;
 
+       if (textview->messageview->window != NULL)
+               ui_manager = textview->messageview->ui_manager;
+       else
+               ui_manager = textview->messageview->mainwin->ui_manager;
+
        textview_set_font(textview, NULL);
        textview_clear(textview);
 
@@ -982,7 +988,11 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
        TEXTVIEW_INSERT(_("     - To save, select "));
        TEXTVIEW_INSERT_LINK(_("'Save as...'"), "sc://save_as", NULL);
 #ifndef GENERIC_UMPC
-       TEXTVIEW_INSERT(_(" (Shortcut key: 'y')"));
+       TEXTVIEW_INSERT(_(" (Shortcut key: '"));
+       shortcut = cm_menu_item_get_shortcut(ui_manager, "Menu/File/SavePartAs");
+       TEXTVIEW_INSERT(shortcut);
+       g_free(shortcut);
+       TEXTVIEW_INSERT("')");
 #endif
        TEXTVIEW_INSERT("\n");
 
@@ -990,7 +1000,11 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
        TEXTVIEW_INSERT_LINK(_("'Display as text'"), "sc://display_as_text", NULL);
 
 #ifndef GENERIC_UMPC
-       TEXTVIEW_INSERT(_(" (Shortcut key: 't')"));
+       TEXTVIEW_INSERT(_(" (Shortcut key: '"));
+       shortcut = cm_menu_item_get_shortcut(ui_manager, "Menu/View/PartAsText");
+       TEXTVIEW_INSERT(shortcut);
+       g_free(shortcut);
+       TEXTVIEW_INSERT("')");
 #endif
        TEXTVIEW_INSERT("\n");
 
@@ -998,13 +1012,21 @@ void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
        TEXTVIEW_INSERT_LINK(_("'Open'"), "sc://open", NULL);
 
 #ifndef GENERIC_UMPC
-       TEXTVIEW_INSERT(_(" (Shortcut key: 'l')\n"));
+       TEXTVIEW_INSERT(_(" (Shortcut key: '"));
+       shortcut = cm_menu_item_get_shortcut(ui_manager, "Menu/View/OpenPartWith");
+       TEXTVIEW_INSERT(shortcut);
+       g_free(shortcut);
+       TEXTVIEW_INSERT("')\n");
        TEXTVIEW_INSERT(_("       (alternately double-click, or click the middle "));
        TEXTVIEW_INSERT(_("mouse button)\n"));
 #ifndef G_OS_WIN32
        TEXTVIEW_INSERT(_("     - Or use "));
        TEXTVIEW_INSERT_LINK(_("'Open with...'"), "sc://open_with", NULL);
-       TEXTVIEW_INSERT(_(" (Shortcut key: 'o')"));
+       TEXTVIEW_INSERT(_(" (Shortcut key: '"));
+       shortcut = cm_menu_item_get_shortcut(ui_manager, "Menu/View/OpenPart");
+       TEXTVIEW_INSERT(shortcut);
+       g_free(shortcut);
+       TEXTVIEW_INSERT("')");
 #endif
 #endif
        TEXTVIEW_INSERT("\n");
@@ -2427,19 +2449,6 @@ static gint textview_key_pressed(GtkWidget *widget, GdkEventKey *event,
                if (summaryview)
                        summary_pass_key_press_event(summaryview, event);
                break;
-       case GDK_KEY_y:
-       case GDK_KEY_t:
-       case GDK_KEY_l:
-       case GDK_KEY_o:
-       case GDK_KEY_c:
-       case GDK_KEY_a:
-               if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) == 0) {
-                       KEY_PRESS_EVENT_STOP();
-                       mimeview_pass_key_press_event(messageview->mimeview,
-                                                     event);
-                       break;
-               }
-               /* possible fall through */
        default:
                window = gtk_widget_get_window(messageview->mainwin->window);
                if (summaryview &&