From cb4a06aafd414b25b88d74f9a659dd397a28e3f0 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Wed, 10 Apr 2013 22:40:07 +0200 Subject: [PATCH] Fib bug #2903, "key 'C' mention harcoded in string" --- src/messageview.c | 5 ++--- src/mimeview.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/messageview.c b/src/messageview.c index 80028431d..6956c39d8 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -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)); diff --git a/src/mimeview.c b/src/mimeview.c index b7640a2cd..7a1a5ca6d 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -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); -- 2.25.1