CVS: sylpheedclaws/sylpheed-claws/src toolbar.c,1.43.2.56,1.43.2.57 toolbar.h,1.19.2.12,1.19.2.13

[email protected] Sat, 16 Dec 2006 17:12:20 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv23485/src

Modified Files:
      Tag: gtk2
	toolbar.c toolbar.h 
Log Message:
2006-12-16 [colin]	2.6.1cvs44

	* src/toolbar.c
	* src/toolbar.h
		Fix bug 1055, 'Add the 'cancel receive' 
		in the available events for the toolbar buttons'

Index: toolbar.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/toolbar.c,v
retrieving revision 1.43.2.56
retrieving revision 1.43.2.57
diff -u -d -r1.43.2.56 -r1.43.2.57
--- toolbar.c	2006/12/06 08:25:57	1.43.2.56
+++ toolbar.c	2006/12/16 17:12:16	1.43.2.57
@@ -154,6 +154,8 @@
 static void toolbar_check_spelling_cb  		(GtkWidget   	*widget, 
 					 	 gpointer     	 data);
 #endif
+static void toolbar_cancel_inc_cb		(GtkWidget	*widget,
+						 gpointer	 data);
 
 struct {
 	gchar *index_str;
@@ -192,6 +194,7 @@
 	{ "A_CHECK_SPELLING",	N_("Check spelling")                       },
 #endif
 	{ "A_SYL_ACTIONS",   	N_("Claws Mail Actions Feature")	   }, 
+	{ "A_CANCEL_INC",	N_("Cancel receiving")			   },
 	{ "A_SEPARATOR",     	"Separator"				}
 };
 
@@ -306,7 +309,7 @@
 					A_REPLY_ALL,     A_REPLY_ML,      A_FORWARD, 
 					A_TRASH , A_DELETE_REAL,       A_EXECUTE,       A_GOTO_PREV, 
 					A_GOTO_NEXT,	A_IGNORE_THREAD,  A_PRINT,
-					A_ADDRBOOK, 	A_LEARN_SPAM, A_SYL_ACTIONS };
+					A_ADDRBOOK, 	A_LEARN_SPAM, A_SYL_ACTIONS, A_CANCEL_INC };
 
 		for (i = 0; i < sizeof main_items / sizeof main_items[0]; i++)  {
 			items = g_list_append(items, gettext(toolbar_text[main_items[i]].descr));
@@ -1220,6 +1223,15 @@
 	}
 }
 
+static void toolbar_cancel_inc_cb(GtkWidget *widget, gpointer data)
+{
+	ToolbarItem *toolbar_item = (ToolbarItem*)data;
+
+	g_return_if_fail(toolbar_item != NULL);
+	inc_cancel_all();
+}
+
+
 static void toolbar_print_cb(GtkWidget *widget, gpointer data)
 {
 	ToolbarItem *toolbar_item = (ToolbarItem*)data;
@@ -1391,7 +1403,8 @@
 #ifdef USE_ASPELL
 		{ A_CHECK_SPELLING,     toolbar_check_spelling_cb       },
 #endif
-		{ A_SYL_ACTIONS,	toolbar_actions_execute_cb	}
+		{ A_SYL_ACTIONS,	toolbar_actions_execute_cb	},
+		{ A_CANCEL_INC,		toolbar_cancel_inc_cb		}
 	};
 
 	num_items = sizeof(callbacks)/sizeof(callbacks[0]);
@@ -1750,6 +1763,12 @@
 
 			gtk_widget_show(item);
 			break;
+		case A_CANCEL_INC:
+			toolbar_data->cancel_inc_btn = item;
+			gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips), 
+					     toolbar_data->cancel_inc_btn,
+					     _("Cancel receiving"), NULL);
+			break;
 		default:
 			/* find and set the tool tip text */
 			gtk_tooltips_set_tip(GTK_TOOLTIPS(toolbar_tips),
@@ -1949,6 +1968,10 @@
 	if (toolbar->learn_spam_btn)
 		SET_WIDGET_COND(toolbar->learn_spam_btn, 
 			M_TARGET_EXIST|M_CAN_LEARN_SPAM);
+
+	if (toolbar->cancel_inc_btn)
+		SET_WIDGET_COND(toolbar->cancel_inc_btn,
+				M_INC_ACTIVE);
 
 	for (cur = toolbar->action_list; cur != NULL;  cur = cur->next) {
 		ToolbarSylpheedActions *act = (ToolbarSylpheedActions*)cur->data;

Index: toolbar.h
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/toolbar.h,v
retrieving revision 1.19.2.12
retrieving revision 1.19.2.13
diff -u -d -r1.19.2.12 -r1.19.2.13
--- toolbar.h	2006/11/07 10:39:35	1.19.2.12
+++ toolbar.h	2006/12/16 17:12:16	1.19.2.13
@@ -79,7 +79,8 @@
 	GtkWidget *separator;
 	GtkWidget *learn_spam_btn;
 	GtkWidget *learn_ham_btn;
-
+	GtkWidget *cancel_inc_btn;
+	
 	ComposeButtonType compose_btn_type;
 	LearnButtonType learn_btn_type;
 
@@ -183,6 +184,8 @@
 
 	/* common items */
 	A_SYL_ACTIONS,
+	A_CANCEL_INC,
+
 	A_SEPARATOR,
 
 	N_ACTION_VAL