[Commits] mainwindow.c 1.274.2.360 1.274.2.361 mainwindow.h 1.39.2.66 1.39.2.67 procmsg.c 1.150.2.132 1.150.2.133 send_message.c 1.17.2.66 1.17.2.67 send_message.h 1.1.4.13 1.1.4.14 toolbar.c 1.43.2.133 1.43.2.134 toolbar.h 1.19.2.35 1.19.2.36

wwp at claws-mail.org wwp at claws-mail.org
Fri Nov 30 15:25:15 CET 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv18782/src

Modified Files:
      Tag: gtk2
	mainwindow.c mainwindow.h procmsg.c send_message.c 
	send_message.h toolbar.c toolbar.h 
Log Message:
2012-11-30 [wwp]	3.9.0cvs31

	* src/mainwindow.c
	* src/mainwindow.h
	* src/procmsg.c
	* src/send_message.c
	* src/send_message.h
	* src/toolbar.c
	* src/toolbar.h
	Add Message/Cancel sending (same as --cancel-sending), adds the
	relevant toolbar icon, and an extra cancel sending+receiving icon
	for convenience.

Index: mainwindow.h
===================================================================
RCS file: /home/claws-mail/claws/src/mainwindow.h,v
retrieving revision 1.39.2.66
retrieving revision 1.39.2.67
diff -u -d -r1.39.2.66 -r1.39.2.67
--- mainwindow.h	28 Nov 2012 15:33:13 -0000	1.39.2.66
+++ mainwindow.h	30 Nov 2012 14:25:12 -0000	1.39.2.67
@@ -47,6 +47,7 @@
 	M_UNTHREADED,
 	M_ALLOW_DELETE,
 	M_INC_ACTIVE,
+	M_SEND_ACTIVE,
 	M_NEWS,
 	M_HAVE_NEWS_ACCOUNT,
 	M_HIDE_READ_MSG,

Index: toolbar.h
===================================================================
RCS file: /home/claws-mail/claws/src/toolbar.h,v
retrieving revision 1.19.2.35
retrieving revision 1.19.2.36
diff -u -d -r1.19.2.35 -r1.19.2.36
--- toolbar.h	27 May 2012 17:31:00 -0000	1.19.2.35
+++ toolbar.h	30 Nov 2012 14:25:12 -0000	1.19.2.36
@@ -77,6 +77,8 @@
 	GtkWidget *learn_ham_icon;
 	
 	GtkWidget *cancel_inc_btn;
+	GtkWidget *cancel_send_btn;
+	GtkWidget *cancel_all_btn;
 	
 	ComposeButtonType compose_btn_type;
 	LearnButtonType learn_btn_type;
@@ -194,6 +196,8 @@
 	/* common items */
 	A_CLAWS_ACTIONS,
 	A_CANCEL_INC,
+	A_CANCEL_SEND,
+	A_CANCEL_ALL,
 	A_CLOSE,
 
 	A_SEPARATOR,

Index: procmsg.c
===================================================================
RCS file: /home/claws-mail/claws/src/procmsg.c,v
retrieving revision 1.150.2.132
retrieving revision 1.150.2.133
diff -u -d -r1.150.2.132 -r1.150.2.133
--- procmsg.c	23 Nov 2012 19:29:15 -0000	1.150.2.132
+++ procmsg.c	30 Nov 2012 14:25:12 -0000	1.150.2.133
@@ -943,6 +943,7 @@
 	GNode *node, *next;
 	
 	if (!procmsg_queue_lock(errstr)) {
+		main_window_set_menu_sensitive(mainwindow_get_mainwindow());
 		toolbar_main_set_sensitive(mainwindow_get_mainwindow());
 		return -1;
 	}
@@ -956,6 +957,7 @@
 		return -1;
 	}
 
+	main_window_set_menu_sensitive(mainwindow_get_mainwindow());
 	toolbar_main_set_sensitive(mainwindow_get_mainwindow());
 
 	folder_item_scan(queue);
@@ -1013,6 +1015,7 @@
 	}
 	procmsg_queue_unlock();
 	inc_unlock();
+	main_window_set_menu_sensitive(mainwindow_get_mainwindow());
 	toolbar_main_set_sensitive(mainwindow_get_mainwindow());
 
 	return (err != 0 ? -err : sent);
@@ -1896,6 +1899,7 @@
 gint procmsg_send_message_queue(const gchar *file, gchar **errstr, FolderItem *queue, gint msgnum, gboolean *queued_removed)
 {
 	gint result = procmsg_send_message_queue_full(file, FALSE, errstr, queue, msgnum, queued_removed);
+	main_window_set_menu_sensitive(mainwindow_get_mainwindow());
 	toolbar_main_set_sensitive(mainwindow_get_mainwindow());
 	return result;
 }

Index: send_message.c
===================================================================
RCS file: /home/claws-mail/claws/src/send_message.c,v
retrieving revision 1.17.2.66
retrieving revision 1.17.2.67
diff -u -d -r1.17.2.66 -r1.17.2.67
--- send_message.c	27 Nov 2012 08:47:05 -0000	1.17.2.66
+++ send_message.c	30 Nov 2012 14:25:12 -0000	1.17.2.67
@@ -94,6 +94,11 @@
 		send_cancel_button_cb(NULL, send_dialog);
 }
 
+gboolean send_is_active(void)
+{
+	return (send_dialog != NULL);
+}
+
 gint send_message(const gchar *file, PrefsAccount *ac_prefs, GSList *to_list)
 {
 	FILE *fp;
@@ -606,7 +611,7 @@
 		progress_dialog_destroy(dialog->dialog);
 	}
 	g_free(dialog);
-	dialog = NULL;
+	send_dialog = NULL;
 }
 
 static void send_showlog_button_cb(GtkWidget *widget, gpointer data)

Index: mainwindow.c
===================================================================
RCS file: /home/claws-mail/claws/src/mainwindow.c,v
retrieving revision 1.274.2.360
retrieving revision 1.274.2.361
diff -u -d -r1.274.2.360 -r1.274.2.361
--- mainwindow.c	29 Nov 2012 09:56:27 -0000	1.274.2.360
+++ mainwindow.c	30 Nov 2012 14:25:12 -0000	1.274.2.361
@@ -187,6 +187,8 @@
 
 static void inc_cancel_cb		(GtkAction	*action,
 				  gpointer	 data);
+static void send_cancel_cb		(GtkAction	*action,
+				  gpointer	 data);
 
 static void open_msg_cb			(GtkAction	*action,
 				  gpointer	 data);
@@ -642,6 +644,7 @@
 	{"Message/Receive/---",			NULL, "---" },
 	{"Message/Receive/PlaceHolder",		NULL, "PlaceHolder,", NULL, NULL, G_CALLBACK(mainwindow_nothing_cb) },
 	{"Message/SendQueue",			NULL, N_("_Send queued messages"), NULL, NULL, G_CALLBACK(mw_send_queue_cb) },
+	{"Message/CancelSending",	NULL, N_("Cancel sending"), NULL, NULL, G_CALLBACK(send_cancel_cb) },
 
 	{"Message/---",				NULL, "---" },
 
@@ -1792,11 +1795,11 @@
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "Separator8", "View/Goto/---", GTK_UI_MANAGER_SEPARATOR)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "NextPart", "View/Goto/NextPart", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Goto", "PrevPart", "View/Goto/PrevPart", GTK_UI_MANAGER_MENUITEM)
-        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
-        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "PrevLine", "View/Scroll/PrevLine", GTK_UI_MANAGER_MENUITEM)
-        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "NextLine", "View/Scroll/NextLine", GTK_UI_MANAGER_MENUITEM)
-        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "PrevPage", "View/Scroll/PrevPage", GTK_UI_MANAGER_MENUITEM)
-        MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "NextPage", "View/Scroll/NextPage", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Scroll", "View/Scroll", GTK_UI_MANAGER_MENU)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "PrevLine", "View/Scroll/PrevLine", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "NextLine", "View/Scroll/NextLine", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "PrevPage", "View/Scroll/PrevPage", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Scroll", "NextPage", "View/Scroll/NextPage", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator4", "View/---", GTK_UI_MANAGER_SEPARATOR)
 
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Encoding", "View/Encoding", GTK_UI_MANAGER_MENU)
@@ -1889,6 +1892,7 @@
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "Separator1", "Message/Receive/---", GTK_UI_MANAGER_SEPARATOR)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message/Receive", "PlaceHolder", "Message/Receive/PlaceHolder", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "SendQueue", "Message/SendQueue", GTK_UI_MANAGER_MENUITEM)
+	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "CancelSending", "Message/CancelSending", GTK_UI_MANAGER_MENUITEM)
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "Separator1", "Message/---", GTK_UI_MANAGER_SEPARATOR)
 
 	MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/Message", "ComposeEmail", "Message/ComposeEmail", GTK_UI_MANAGER_MENUITEM)
@@ -3230,6 +3234,9 @@
 	if (imap_cancel_all_enabled())
 		UPDATE_STATE(M_INC_ACTIVE);
 
+	if (send_is_active() | procmsg_is_sending())
+		UPDATE_STATE(M_SEND_ACTIVE);
+
 	if (mainwin->summaryview->deleted > 0)
 		UPDATE_STATE(M_DELETED_EXISTS);
 
@@ -3291,7 +3298,7 @@
 	gint i;
 	gboolean mimepart_selected = FALSE;
 
-#define N_ENTRIES 81
+#define N_ENTRIES 82
 	static struct {
 		const gchar *entry;
 		SensitiveCond cond;
@@ -3342,6 +3349,7 @@
 	FILL_TABLE("Menu/Message/Receive/AllAccounts", M_HAVE_ACCOUNT, M_UNLOCKED, M_HAVE_ANY_RETRIEVABLE_ACCOUNT);
 	FILL_TABLE("Menu/Message/Receive/CancelReceiving", M_INC_ACTIVE);
 	FILL_TABLE("Menu/Message/SendQueue", M_HAVE_ACCOUNT, M_HAVE_QUEUED_MAILS);
+	FILL_TABLE("Menu/Message/CancelSending", M_SEND_ACTIVE);
 	FILL_TABLE("Menu/Message/ComposeEmail", M_HAVE_ACCOUNT);
 	FILL_TABLE("Menu/Message/ComposeNews", M_HAVE_NEWS_ACCOUNT);
 	FILL_TABLE("Menu/Message/Reply", M_HAVE_ACCOUNT, M_TARGET_EXIST, M_SUMMARY_ISLIST);
@@ -4459,6 +4467,11 @@
 	imap_cancel_all();
 }
 
+static void send_cancel_cb(GtkAction *action, gpointer data)
+{
+	send_cancel();
+}
+
 static void move_to_cb(GtkAction *action, gpointer data)
 {
 	MainWindow *mainwin = (MainWindow *)data;

Index: send_message.h
===================================================================
RCS file: /home/claws-mail/claws/src/send_message.h,v
retrieving revision 1.1.4.13
retrieving revision 1.1.4.14
diff -u -d -r1.1.4.13 -r1.1.4.14
--- send_message.h	27 Nov 2012 08:47:05 -0000	1.1.4.13
+++ send_message.h	30 Nov 2012 14:25:12 -0000	1.1.4.14
@@ -42,5 +42,6 @@
 				 FILE *fp, 
 				 gboolean keep_session);
 void send_cancel	(void);
+gboolean inc_is_active	(void);
 
 #endif /* __SEND_H__ */

Index: toolbar.c
===================================================================
RCS file: /home/claws-mail/claws/src/toolbar.c,v
retrieving revision 1.43.2.133
retrieving revision 1.43.2.134
diff -u -d -r1.43.2.133 -r1.43.2.134
--- toolbar.c	28 Nov 2012 15:33:13 -0000	1.43.2.133
+++ toolbar.c	30 Nov 2012 14:25:12 -0000	1.43.2.134
@@ -179,6 +179,10 @@
 #endif
 static void toolbar_cancel_inc_cb		(GtkWidget	*widget,
 						 gpointer	 data);
+static void toolbar_cancel_send_cb		(GtkWidget	*widget,
+						 gpointer	 data);
+static void toolbar_cancel_all_cb		(GtkWidget	*widget,
+						 gpointer	 data);
 
 struct {
 	gchar *index_str;
@@ -193,19 +197,19 @@
 	{ "A_REPLY_SENDER",  	N_("Reply to Sender")                      },
 	{ "A_REPLY_ALL",     	N_("Reply to All")                         },
 	{ "A_REPLY_ML",      	N_("Reply to Mailing-list")                },
-	{ "A_OPEN_MAIL",	N_("Open email")			   },
+	{ "A_OPEN_MAIL",        N_("Open email")                           },
 	{ "A_FORWARD",       	N_("Forward Message")                      }, 
 	{ "A_TRASH",        	N_("Trash Message")   	                   },
 	{ "A_DELETE_REAL",    	N_("Delete Message")                       },
 	{ "A_EXECUTE",       	N_("Execute")                              },
 	{ "A_GOTO_PREV",     	N_("Go to Previous Unread Message")        },
 	{ "A_GOTO_NEXT",     	N_("Go to Next Unread Message")            },
-	{ "A_IGNORE_THREAD", 	N_("Ignore thread")			   },
-	{ "A_WATCH_THREAD", 	N_("Watch thread")			   },
-	{ "A_PRINT",	     	N_("Print")				   },
-	{ "A_LEARN_SPAM",	N_("Learn Spam or Ham")			   },
+	{ "A_IGNORE_THREAD", 	N_("Ignore thread")                        },
+	{ "A_WATCH_THREAD", 	N_("Watch thread")                         },
+	{ "A_PRINT",	     	N_("Print")                                },
+	{ "A_LEARN_SPAM",       N_("Learn Spam or Ham")                    },
 	{ "A_GO_FOLDERS",   	N_("Open folder/Go to folder list")        },
-	{ "A_PREFERENCES",	N_("Preferences")			   },
+	{ "A_PREFERENCES",      N_("Preferences")                          },
 
 	{ "A_SEND",          	N_("Send Message")                         },
 	{ "A_SENDL",         	N_("Put into queue folder and send later") },
@@ -220,11 +224,13 @@
 #ifdef USE_ENCHANT
 	{ "A_CHECK_SPELLING",	N_("Check spelling")                       },
 #endif
-	{ "A_CLAWS_ACTIONS",   	N_("Claws Mail Actions Feature")	   }, 
-	{ "A_CANCEL_INC",	N_("Cancel receiving")			   },
-	{ "A_CLOSE",		N_("Close window")			   },
-	{ "A_SEPARATOR",     	N_("Separator")				},
-	{ "A_CLAWS_PLUGINS",    N_("Claws Mail Plugins")       },
+	{ "A_CLAWS_ACTIONS",   	N_("Claws Mail Actions Feature")           }, 
+	{ "A_CANCEL_INC",       N_("Cancel receiving")                     },
+	{ "A_CANCEL_SEND",      N_("Cancel sending")                       },
+	{ "A_CANCEL_ALL",       N_("Cancel receiving/sending")             },
+	{ "A_CLOSE",            N_("Close window")                         },
+	{ "A_SEPARATOR",     	N_("Separator")                            },
+	{ "A_CLAWS_PLUGINS",    N_("Claws Mail Plugins")                   },
 };
 
 /* struct holds configuration files and a list of
@@ -305,13 +311,13 @@
 	gint i = 0;
 	
 	if (source == TOOLBAR_MAIN) {
-		gint main_items[]   = { A_RECEIVE_ALL,   A_RECEIVE_CUR,   A_SEND_QUEUED,
+		gint main_items[] = { A_RECEIVE_ALL,   A_RECEIVE_CUR,   A_SEND_QUEUED,
 					A_COMPOSE_EMAIL, A_REPLY_MESSAGE, A_REPLY_SENDER, 
-					A_REPLY_ALL,     A_REPLY_ML,      A_OPEN_MAIL, 	A_FORWARD, 
-					A_TRASH , A_DELETE_REAL,       A_EXECUTE,       A_GOTO_PREV, 
-					A_GOTO_NEXT,	A_IGNORE_THREAD,  A_WATCH_THREAD,	A_PRINT,
-					A_ADDRBOOK, 	A_LEARN_SPAM, A_GO_FOLDERS, 
-					A_CANCEL_INC,   A_PREFERENCES };
+					A_REPLY_ALL,     A_REPLY_ML,      A_OPEN_MAIL,     A_FORWARD, 
+					A_TRASH,         A_DELETE_REAL,   A_EXECUTE,       A_GOTO_PREV, 
+					A_GOTO_NEXT,     A_IGNORE_THREAD, A_WATCH_THREAD,  A_PRINT,
+					A_ADDRBOOK,      A_LEARN_SPAM,    A_GO_FOLDERS, 
+					A_CANCEL_INC,    A_CANCEL_SEND,   A_CANCEL_ALL,    A_PREFERENCES };
 
 		for (i = 0; i < sizeof main_items / sizeof main_items[0]; i++)  {
 			items = g_list_append(items, gettext(toolbar_text[main_items[i]].descr));
@@ -424,6 +430,8 @@
 	case A_LINEWRAP_ALL:	return _("Wrap all");
 	case A_ADDRBOOK: 	return _("Address");
 	case A_CANCEL_INC:	return _("Stop");
+	case A_CANCEL_SEND:	return _("Stop");
+	case A_CANCEL_ALL:	return _("Stop all");
 	case A_EXECUTE:		return _("Execute");
 	#ifdef USE_ENCHANT
 	case A_CHECK_SPELLING:	return _("Check spelling");
@@ -467,6 +475,8 @@
 	case A_LINEWRAP_ALL:	return STOCK_PIXMAP_LINEWRAP_ALL;
 	case A_ADDRBOOK: 	return STOCK_PIXMAP_ADDRESS_BOOK;
 	case A_CANCEL_INC:	return STOCK_PIXMAP_CANCEL;
+	case A_CANCEL_SEND:	return STOCK_PIXMAP_CANCEL;
+	case A_CANCEL_ALL:	return STOCK_PIXMAP_CANCEL;
 	case A_EXECUTE:		return STOCK_PIXMAP_EXEC;
 	#ifdef USE_ENCHANT
 	case A_CHECK_SPELLING:	return STOCK_PIXMAP_CHECK_SPELLING;
@@ -1486,6 +1496,19 @@
 	imap_cancel_all();
 }
 
+static void toolbar_cancel_send_cb(GtkWidget *widget, gpointer data)
+{
+	ToolbarItem *toolbar_item = (ToolbarItem*)data;
+
+	cm_return_if_fail(toolbar_item != NULL);
+	send_cancel();
+}
+
+static void toolbar_cancel_all_cb(GtkWidget *widget, gpointer data)
+{
+	toolbar_cancel_inc_cb(widget, data);
+	toolbar_cancel_send_cb(widget, data);
+}
 
 static void toolbar_print_cb(GtkWidget *widget, gpointer data)
 {
@@ -1746,6 +1769,8 @@
 #endif
 		{ A_CLAWS_ACTIONS,	toolbar_actions_execute_cb	},
 		{ A_CANCEL_INC,		toolbar_cancel_inc_cb		},
+		{ A_CANCEL_SEND,	toolbar_cancel_send_cb		},
+		{ A_CANCEL_ALL,		toolbar_cancel_all_cb		},
 		{ A_CLAWS_PLUGINS,  toolbar_plugins_execute_cb  },
 	};
 
@@ -2152,6 +2177,14 @@
 			TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,_("Cancel receiving"));
 			toolbar_data->cancel_inc_btn = item;
 			break;
+		case A_CANCEL_SEND:
+			TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,_("Cancel sending"));
+			toolbar_data->cancel_send_btn = item;
+			break;
+		case A_CANCEL_ALL:
+			TOOLBAR_ITEM(item,icon_wid,toolbar_item->text,_("Cancel receiving/sending"));
+			toolbar_data->cancel_all_btn = item;
+			break;
 		case A_CLAWS_PLUGINS:
 			TOOLBAR_ITEM(item,icon_wid,toolbar_item->text, toolbar_item->text);
 			break;
@@ -2442,6 +2475,10 @@
 		SET_WIDGET_COND(toolbar->cancel_inc_btn,
 				M_INC_ACTIVE);
 
+	if (toolbar->cancel_send_btn)
+		SET_WIDGET_COND(toolbar->cancel_send_btn,
+				M_SEND_ACTIVE);
+
 	for (cur = toolbar->action_list; cur != NULL;  cur = cur->next) {
 		ToolbarClawsActions *act = (ToolbarClawsActions*)cur->data;
 		
@@ -2468,7 +2505,10 @@
 
 	/* match any bit flags */
 
-	/*
+	if (toolbar->cancel_all_btn)
+		SET_WIDGET_COND(toolbar->cancel_all_btn,
+				M_INC_ACTIVE, M_SEND_ACTIVE);
+
 	for (cur = entry_list; cur != NULL; cur = cur->next) {
 		Entry *e = (Entry*) cur->data;
 
@@ -2477,7 +2517,6 @@
 			GTK_BUTTON_SET_SENSITIVE(e->widget, sensitive);	
 		}
 	}
-	*/
 
 	while (entry_list != NULL) {
 		Entry *e = (Entry*) entry_list->data;
@@ -2559,6 +2598,8 @@
 	toolbar->learn_spam_icon   = NULL;
 	toolbar->learn_ham_icon    = NULL;
 	toolbar->cancel_inc_btn    = NULL;
+	toolbar->cancel_send_btn   = NULL;
+	toolbar->cancel_all_btn    = NULL;
 
 	/* compose buttons */ 
 	toolbar->sendl_btn         = NULL;



More information about the Commits mailing list