[Commits] [SCM] claws branch, master, updated. 3.9.0-187-g9c84307

mones at claws-mail.org mones at claws-mail.org
Sun Apr 21 11:49:11 CEST 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  9c843072396bbd07d4d0f352dc91084d0a6cf924 (commit)
      from  1a980a6ed69e4c979dd268c5d3a875548289e587 (commit)


- Log -----------------------------------------------------------------
commit 9c843072396bbd07d4d0f352dc91084d0a6cf924
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Apr 21 11:45:51 2013 +0200

    Complete fix for #2093 "key 'C' mention harcoded in string"
    
    Refactor code to obtain shortcut to a function and don't
    mention the shortcut in the cases it doesn't exist.

diff --git a/src/mimeview.c b/src/mimeview.c
index 7a1a5ca..8c328d0 100644
--- a/src/mimeview.c
+++ b/src/mimeview.c
@@ -1004,6 +1004,17 @@ void mimeview_clear(MimeView *mimeview)
 	mimeview_change_view_type(mimeview, MIMEVIEW_TEXT);
 }
 
+gchar * get_message_check_signature_shortcut(MessageView *messageview) {
+	GtkUIManager *ui_manager;
+
+	if (messageview->window != NULL)
+			ui_manager = messageview->ui_manager;
+		else
+			ui_manager = messageview->mainwin->ui_manager;
+
+	return cm_menu_item_get_shortcut(ui_manager, "Menu/Message/CheckSignature");
+}
+
 static void check_signature_cb(GtkWidget *widget, gpointer user_data);
 static void display_full_info_cb(GtkWidget *widget, gpointer user_data);
 
@@ -1059,25 +1070,26 @@ 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);
-		gchar *shortcut;
+		gchar *shortcut = get_message_check_signature_shortcut(mimeview->messageview);
 
-		if (mimeview->messageview->window != NULL)
-			ui_manager = mimeview->messageview->ui_manager;
+		if (*shortcut == '\0')
+			text = g_strdup_printf(_("%s Click the icon to check it."), tmp);
 		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);
+			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) {
-		text = g_strdup(_("Timeout checking the signature. Click the icon or hit 'C' to try again."));
+		gchar *shortcut = get_message_check_signature_shortcut(mimeview->messageview);
+
+		if (*shortcut == '\0')
+			text = g_strdup(_("Timeout checking the signature. Click the icon to try again."));
+		else
+			text = g_strdup_printf(_("Timeout checking the signature. Click the icon or hit '%s' to try again."), shortcut);
+		g_free(shortcut);
 	}
 
 	noticeview_set_text(mimeview->siginfoview, text);

-----------------------------------------------------------------------

Summary of changes:
 src/mimeview.c |   34 +++++++++++++++++++++++-----------
 1 files changed, 23 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list