Fib bug #2903, "key 'C' mention harcoded in string"
authorColin Leroy <colin@colino.net>
Wed, 10 Apr 2013 20:40:07 +0000 (22:40 +0200)
committerColin Leroy <colin@colino.net>
Wed, 10 Apr 2013 20:40:07 +0000 (22:40 +0200)
src/messageview.c
src/mimeview.c

index 8002843..6956c39 100644 (file)
@@ -1576,6 +1576,7 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo,
 
        mimeview_select_mimepart_icon(messageview->mimeview, root);
 done:
+       messageview_set_menu_sensitive(messageview);
        /* plugins may hook in here to work with the message view */
        hooks_invoke(MESSAGE_VIEW_SHOW_DONE_HOOKLIST, messageview);
 
@@ -2978,10 +2979,8 @@ static gboolean messageview_update_msg(gpointer source, gpointer data)
 
 void messageview_set_menu_sensitive(MessageView *messageview)
 {
-       if (!messageview || !messageview->new_window) 
+       if (!messageview || !messageview->ui_manager)
                return;
-       /* do some smart things */
-       if (!messageview->menubar) return;
 
        cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/CollapseAll", (prefs_common.hide_quotes == 1));
        cm_toggle_menu_set_active_full(messageview->ui_manager, "Menu/View/Quotes/Collapse2", (prefs_common.hide_quotes == 2));
index b7640a2..7a1a5ca 100644 (file)
@@ -1059,10 +1059,21 @@ static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo,
                break;
        }
        if (mycode == SIGNATURE_UNCHECKED) {
+               GtkUIManager *ui_manager;
                gchar *tmp = privacy_mimeinfo_sig_info_short(mimeinfo);
-               text = g_strdup_printf("%s %s",
-                       tmp, _("Click the icon or hit 'C' to check it."));
+               gchar *shortcut;
+
+               if (mimeview->messageview->window != NULL)
+                       ui_manager = mimeview->messageview->ui_manager;
+               else
+                       ui_manager = mimeview->messageview->mainwin->ui_manager;
+
+               shortcut = cm_menu_item_get_shortcut(ui_manager, "Menu/Message/CheckSignature");
+
+               text = g_strdup_printf(_("%s Click the icon or hit '%s' to check it."),
+                       tmp, shortcut);
                g_free(tmp);
+               g_free(shortcut);
        } else if (mycode != SIGNATURE_CHECK_TIMEOUT) {
                text = privacy_mimeinfo_sig_info_short(mimeinfo);
        } else if (mycode == SIGNATURE_CHECK_TIMEOUT) {
@@ -1383,7 +1394,7 @@ static void update_signature_info(MimeView *mimeview, MimeInfo *selected)
         * CheckSignature item sensitivity without killing performance
         * each time the menu sensitiveness is updated (a lot).
         */
-       mimeview->signed_part = (siginfo == selected);
+       mimeview->signed_part = (siginfo != NULL);
 
        if (siginfo == NULL) {
                noticeview_hide(mimeview->siginfoview);