[Users] [PATCH] Fix incorrect labels on folder selection

Olivier Brunel jjk at jjacky.com
Mon Mar 27 11:05:35 CEST 2017


When custom label for folder selection were introduced (in bd8213fe) a
few ones were wrongly set, specifically ones when copying/moving folders
were talking about copying/moving message(s) instead.
---
 src/imap_gtk.c                    | 22 ++++++++++------------
 src/mh_gtk.c                      | 22 ++++++++++------------
 src/plugins/mailmbox/plugin_gtk.c | 22 ++++++++++------------
 3 files changed, 30 insertions(+), 36 deletions(-)

diff --git a/src/imap_gtk.c b/src/imap_gtk.c
index 26e3663a9..6e41b40eb 100644
--- a/src/imap_gtk.c
+++ b/src/imap_gtk.c
@@ -308,17 +308,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
@@ -329,17 +328,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index 605ef13fa..f4525be96 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -298,17 +298,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
@@ -319,17 +318,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 	
diff --git a/src/plugins/mailmbox/plugin_gtk.c b/src/plugins/mailmbox/plugin_gtk.c
index 47b768411..d567ec83b 100644
--- a/src/plugins/mailmbox/plugin_gtk.c
+++ b/src/plugins/mailmbox/plugin_gtk.c
@@ -363,17 +363,16 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
-			ngettext(
-				"Select folder to move selected message to",
-				"Select folder to move selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to move folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 
@@ -384,17 +383,16 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 {
 	FolderView *folderview = (FolderView *)data;
 	FolderItem *from_folder = NULL, *to_folder = NULL;
+	gchar *msg;
 
 	from_folder = folderview_get_selected_item(folderview);
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
-			ngettext(
-				"Select folder to copy selected message to",
-				"Select folder to copy selected messages to",
-				summary_get_selection_count(folderview->summaryview))
-	);
+	msg = g_strdup_printf(_("Select folder to copy folder '%s' to"),
+		from_folder->name);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, msg);
+	g_free(msg);
 	if (!to_folder)
 		return;
 
-- 
2.12.1




More information about the Users mailing list