[Commits] [SCM] claws branch, master, updated. 3.14.1-228-gbd8213f

ticho at claws-mail.org ticho at claws-mail.org
Thu Mar 16 19:16:12 CET 2017


The branch, master has been updated
       via  bd8213fe3d3ca5da043992520e96f07aacd0d443 (commit)
       via  e420063586f5117a00c3460ed074e34c95709ff9 (commit)
      from  5dbe8b9ec12bd2dc683b468f066d21c3f9bb9572 (commit)

Summary of changes:
 src/compose.c                               |    3 ++-
 src/export.c                                |    3 ++-
 src/foldersel.c                             |   12 +++++++-----
 src/foldersel.h                             |    3 ++-
 src/imap_gtk.c                              |   14 ++++++++++++--
 src/import.c                                |    3 ++-
 src/mainwindow.c                            |    3 ++-
 src/messageview.c                           |    3 ++-
 src/mh_gtk.c                                |   14 ++++++++++++--
 src/plugins/archive/archiver_gtk.c          |    3 ++-
 src/plugins/bogofilter/bogofilter_gtk.c     |    2 +-
 src/plugins/bsfilter/bsfilter_gtk.c         |    2 +-
 src/plugins/clamd/clamav_plugin_gtk.c       |    3 ++-
 src/plugins/mailmbox/plugin_gtk.c           |   14 ++++++++++++--
 src/plugins/spamassassin/spamassassin_gtk.c |    3 ++-
 src/prefs_account.c                         |    2 +-
 src/prefs_filtering_action.c                |    3 ++-
 src/summaryview.c                           |   27 +++++++++++++++++++++++++--
 src/summaryview.h                           |    1 +
 19 files changed, 92 insertions(+), 26 deletions(-)


- Log -----------------------------------------------------------------
commit bd8213fe3d3ca5da043992520e96f07aacd0d443
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Mar 16 19:14:49 2017 +0100

    Allow custom window title for the folder selection dialog.
    
    Fixes bug #3582 - Select folder dialogue does not tell what is
    selecting for.

diff --git a/src/compose.c b/src/compose.c
index 524e853..7cd0729 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -7446,7 +7446,8 @@ static void compose_savemsg_select_cb(GtkWidget *widget, Compose *compose)
 	FolderItem *dest;
 	gchar * path;
 
-	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
+	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE,
+			_("Select folder to save message to"));
 	if (!dest) return;
 
 	path = folder_item_get_identifier(dest);
diff --git a/src/export.c b/src/export.c
index 29bd524..74e465e 100644
--- a/src/export.c
+++ b/src/export.c
@@ -264,7 +264,8 @@ static void export_srcsel_cb(GtkWidget *widget, gpointer data)
 {
 	FolderItem *src;
 
-	src = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
+	src = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE,
+			_("Select folder which to export"));
 	if (src && src->path)
 		gtk_entry_set_text(GTK_ENTRY(src_entry), src->path);
 }
diff --git a/src/foldersel.c b/src/foldersel.c
index faf8293..837763e 100644
--- a/src/foldersel.c
+++ b/src/foldersel.c
@@ -83,7 +83,7 @@ static GtkTreeStore *tree_store;
 static gboolean cancelled;
 static gboolean finished;
 
-static void foldersel_create		(void);
+static void foldersel_create		(const gchar *title);
 static void foldersel_init		(void);
 
 static void foldersel_append_item	(GtkTreeStore	*store,
@@ -133,13 +133,14 @@ static gboolean tree_view_folder_item_func	(GtkTreeModel	  *model,
 						 FolderItemSearch *data);
 
 FolderItem *foldersel_folder_sel(Folder *cur_folder, FolderSelectionType type,
-				 const gchar *default_folder, gboolean can_sel_mailbox)
+				 const gchar *default_folder, gboolean can_sel_mailbox,
+				 const gchar *title)
 {
 	selected_item = NULL;
 	root_selectable = can_sel_mailbox;
 
 	if (!window) {
-		foldersel_create();
+		foldersel_create(title);
 		foldersel_init();
 	}
 
@@ -234,7 +235,7 @@ static void foldersel_size_allocate_cb(GtkWidget *widget,
 	prefs_common.folderselwin_height = allocation->height;
 }
 
-static void foldersel_create(void)
+static void foldersel_create(const gchar *title)
 {
 	GtkWidget *vbox;
 	GtkWidget *scrolledwin;
@@ -245,7 +246,8 @@ static void foldersel_create(void)
 	static GdkGeometry geometry;
 
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "foldersel");
-	gtk_window_set_title(GTK_WINDOW(window), _("Select folder"));
+	gtk_window_set_title(GTK_WINDOW(window),
+			title ? title : _("Select folder"));
 	gtk_container_set_border_width(GTK_CONTAINER(window), 4);
 	gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
 	gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
diff --git a/src/foldersel.h b/src/foldersel.h
index 76d3ac2..4ab5b42 100644
--- a/src/foldersel.h
+++ b/src/foldersel.h
@@ -35,7 +35,8 @@ typedef enum
 FolderItem *foldersel_folder_sel(Folder			*cur_folder,
 				 FolderSelectionType	 type,
 				 const gchar		*default_folder,
-				 gboolean 			 can_sel_mailbox);
+				 gboolean		 can_sel_mailbox,
+				 const gchar		*title);
 void foldersel_reflect_prefs_pixmap_theme(void);
 
 #endif /* __FOLDERSEL_H__ */
diff --git a/src/imap_gtk.c b/src/imap_gtk.c
index 11f2d1f..26e3663 100644
--- a/src/imap_gtk.c
+++ b/src/imap_gtk.c
@@ -313,7 +313,12 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE);
+	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))
+	);
 	if (!to_folder)
 		return;
 	
@@ -329,7 +334,12 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != imap_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE);
+	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))
+	);
 	if (!to_folder)
 		return;
 	
diff --git a/src/import.c b/src/import.c
index a0e513f..b573bb1 100644
--- a/src/import.c
+++ b/src/import.c
@@ -268,7 +268,8 @@ static void import_destsel_cb(GtkWidget *widget, gpointer data)
 	FolderItem *dest;
 	gchar *path;
 
-	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
+	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE,
+			_("Select folder to import to"));
 	if (!dest)
 		 return;
 	path = folder_item_get_identifier(dest);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 2c34dce..e015642 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -4932,7 +4932,8 @@ static void goto_folder_cb(GtkAction *action, gpointer data)
 	MainWindow *mainwin = (MainWindow *)data;
 	FolderItem *to_folder;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE,
+			_("Select folder to go to"));
 
 	if (to_folder)
 		folderview_select(mainwin->folderview, to_folder);
diff --git a/src/messageview.c b/src/messageview.c
index aaca56d..68e9038 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -2653,7 +2653,8 @@ static void goto_folder_cb(GtkAction *action, gpointer data)
 	MessageView *messageview = (MessageView *)data;
 	FolderItem *to_folder;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_ALL, NULL, FALSE,
+			_("Select folder to go to"));
 
 	if (to_folder) {
 		folderview_select(messageview->mainwin->folderview, to_folder);
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index 985f05e..605ef13 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -303,7 +303,12 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE);
+	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))
+	);
 	if (!to_folder)
 		return;
 	
@@ -319,7 +324,12 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != mh_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, TRUE);
+	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))
+	);
 	if (!to_folder)
 		return;
 	
diff --git a/src/plugins/archive/archiver_gtk.c b/src/plugins/archive/archiver_gtk.c
index 11c166f..1f31ac4 100644
--- a/src/plugins/archive/archiver_gtk.c
+++ b/src/plugins/archive/archiver_gtk.c
@@ -913,7 +913,8 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 	gint newpos = 0;
 	struct ArchivePage* page = (struct ArchivePage *) data;
 
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
+			_("Select folder to archive"));
 	if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
 		gtk_editable_delete_text(GTK_EDITABLE(page->folder), 0, -1);
 		gtk_editable_insert_text(GTK_EDITABLE(page->folder),
diff --git a/src/plugins/bogofilter/bogofilter_gtk.c b/src/plugins/bogofilter/bogofilter_gtk.c
index 10aadb8..fdae7f1 100644
--- a/src/plugins/bogofilter/bogofilter_gtk.c
+++ b/src/plugins/bogofilter/bogofilter_gtk.c
@@ -71,7 +71,7 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 	gchar *item_id;
 	gint newpos = 0;
 	
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, NULL);
 	if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
 		gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1);
 		gtk_editable_insert_text(GTK_EDITABLE(entry), item_id, strlen(item_id), &newpos);
diff --git a/src/plugins/bsfilter/bsfilter_gtk.c b/src/plugins/bsfilter/bsfilter_gtk.c
index 9593378..c329d68 100644
--- a/src/plugins/bsfilter/bsfilter_gtk.c
+++ b/src/plugins/bsfilter/bsfilter_gtk.c
@@ -69,7 +69,7 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 	gchar *item_id;
 	gint newpos = 0;
 	
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE, NULL);
 	if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
 		gtk_editable_delete_text(GTK_EDITABLE(entry), 0, -1);
 		gtk_editable_insert_text(GTK_EDITABLE(entry), item_id, strlen(item_id), &newpos);
diff --git a/src/plugins/clamd/clamav_plugin_gtk.c b/src/plugins/clamd/clamav_plugin_gtk.c
index 77d5d8f..e94a3a8 100644
--- a/src/plugins/clamd/clamav_plugin_gtk.c
+++ b/src/plugins/clamd/clamav_plugin_gtk.c
@@ -68,7 +68,8 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 	gchar *item_id;
 	gint newpos = 0;
 	
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
+			_("Select folder to store infected messages in"));
 	if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
 		gtk_editable_delete_text(GTK_EDITABLE(page->save_folder), 0, -1);
 		gtk_editable_insert_text(GTK_EDITABLE(page->save_folder), item_id, strlen(item_id), &newpos);
diff --git a/src/plugins/mailmbox/plugin_gtk.c b/src/plugins/mailmbox/plugin_gtk.c
index 282c263..47b7684 100644
--- a/src/plugins/mailmbox/plugin_gtk.c
+++ b/src/plugins/mailmbox/plugin_gtk.c
@@ -368,7 +368,12 @@ static void move_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	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))
+	);
 	if (!to_folder)
 		return;
 
@@ -384,7 +389,12 @@ static void copy_folder_cb(GtkAction *action, gpointer data)
 	if (!from_folder || from_folder->folder->klass != claws_mailmbox_get_class())
 		return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	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))
+	);
 	if (!to_folder)
 		return;
 
diff --git a/src/plugins/spamassassin/spamassassin_gtk.c b/src/plugins/spamassassin/spamassassin_gtk.c
index d73a9c6..102aaff 100644
--- a/src/plugins/spamassassin/spamassassin_gtk.c
+++ b/src/plugins/spamassassin/spamassassin_gtk.c
@@ -115,7 +115,8 @@ static void foldersel_cb(GtkWidget *widget, gpointer data)
 	gchar *item_id;
 	gint newpos = 0;
 	
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE,
+			_("Select folder to save spam to"));
 	if (item && (item_id = folder_item_get_identifier(item)) != NULL) {
 		gtk_editable_delete_text(GTK_EDITABLE(page->save_folder), 0, -1);
 		gtk_editable_insert_text(GTK_EDITABLE(page->save_folder), item_id, strlen(item_id), &newpos);
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 185e24d..59d9049 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -3882,7 +3882,7 @@ static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data)
 	FolderItem *item;
 	gchar *id;
 
-	item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
+	item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE, NULL);
 	if (item && item->path) {
 		id = folder_item_get_identifier(item);
 		if (id) {
diff --git a/src/prefs_filtering_action.c b/src/prefs_filtering_action.c
index e105bdd..fa1cb08 100644
--- a/src/prefs_filtering_action.c
+++ b/src/prefs_filtering_action.c
@@ -1293,7 +1293,8 @@ static void prefs_filtering_action_select_dest(void)
 	FolderItem *dest;
 	gchar * path;
 
-	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
+	dest = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE,
+			_("Select destination folder"));
 	if (!dest) return;
 
 	path = folder_item_get_identifier(dest);
diff --git a/src/summaryview.c b/src/summaryview.c
index b563297..268047f 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4617,7 +4617,12 @@ void summary_move_to(SummaryView *summaryview)
 	if (!summaryview->folder_item ||
 	    FOLDER_TYPE(summaryview->folder_item->folder) == F_NEWS) return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_MOVE, NULL, FALSE);
+	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",
+				g_list_length(GTK_CMCLIST(summaryview->ctree)->selection))
+	);
 	summary_move_selected_to(summaryview, to_folder);
 }
 
@@ -4697,7 +4702,12 @@ void summary_copy_to(SummaryView *summaryview)
 
 	if (!summaryview->folder_item) return;
 
-	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
+	to_folder = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE,
+			ngettext(
+				"Select folder to copy selected message to",
+				"Select folder to copy selected messages to",
+				g_list_length(GTK_CMCLIST(summaryview->ctree)->selection))
+	);
 	summary_copy_selected_to(summaryview, to_folder);
 }
 

commit e420063586f5117a00c3460ed074e34c95709ff9
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Mar 16 18:37:30 2017 +0100

    Added summary_get_selection_count() function.

diff --git a/src/summaryview.c b/src/summaryview.c
index 77ad51a..b563297 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -7085,6 +7085,19 @@ GSList *summary_get_selection(SummaryView *summaryview)
 	return g_slist_reverse(msginfo_list);
 }
 
+/*
+ * \brief get number of messages currently selected in SummaryView
+ *
+ * \param summaryview
+ *
+ * \return number of messages currently selected
+ */
+guint summary_get_selection_count(SummaryView *summaryview)
+{
+	cm_return_val_if_fail(summaryview != NULL, 0);
+	return g_list_length(GTK_CMCLIST(summaryview->ctree)->selection);
+}
+
 static void summary_sort_by_column_click(SummaryView *summaryview,
 					 FolderSortKey sort_key)
 {
diff --git a/src/summaryview.h b/src/summaryview.h
index 2d192e5..1174bf9 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -267,6 +267,7 @@ void summary_move_to		  (SummaryView		*summaryview);
 void summary_copy_selected_to	  (SummaryView		*summaryview,
 				   FolderItem		*to_folder);
 GSList *summary_get_selection	  (SummaryView 		*summaryview);
+guint summary_get_selection_count (SummaryView		*summaryview);
 void summary_copy_to		  (SummaryView		*summaryview);
 void summary_save_as		  (SummaryView		*summaryview);
 void summary_print		  (SummaryView		*summaryview);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list