[Commits] [SCM] claws branch, master, updated. 3.9.2-86-gf02d1a8

claws at claws-mail.org claws at claws-mail.org
Fri Aug 30 09:13:07 CEST 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  f02d1a8cc95114e78611ec9f83b81c097b3b68ab (commit)
      from  f8d35f8d40194ac94ee4e8503e8ff8a3480b6284 (commit)


- Log -----------------------------------------------------------------
commit f02d1a8cc95114e78611ec9f83b81c097b3b68ab
Author: Paul <paul at claws-mail.org>
Date:   Fri Aug 30 08:12:59 2013 +0100

    add option to disable the 'Subject is empty' warning dialogue

diff --git a/src/compose.c b/src/compose.c
index 33c6281..b5cec4f 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -4998,9 +4998,9 @@ static gboolean compose_check_entries(Compose *compose, gboolean check_everythin
 		return FALSE;
 	}
 
-	if (!compose->batch) {
+	if (!compose->batch && prefs_common.warn_empty_subj == TRUE) {
 		str = gtk_entry_get_text(GTK_ENTRY(compose->subject_entry));
-		if (*str == '\0' && check_everything == TRUE && 
+		if (*str == '\0' && check_everything == TRUE &&
 		    compose->mode != COMPOSE_REDIRECT) {
 			AlertValue aval;
 			gchar *button_label;
@@ -5014,9 +5014,14 @@ static gboolean compose_check_entries(Compose *compose, gboolean check_everythin
 					compose->sending?_("Send it anyway?"):
 					_("Queue it anyway?"));
 
-			aval = alertpanel(compose->sending?_("Send"):_("Send later"), message,
-					  GTK_STOCK_CANCEL, button_label, NULL);
+			aval = alertpanel_full(compose->sending?_("Send"):_("Send later"), message,
+					       GTK_STOCK_CANCEL, button_label, NULL, TRUE, NULL,
+					       ALERT_QUESTION, G_ALERTDEFAULT);
 			g_free(message);
+			if (aval & G_ALERTDISABLE) {
+				aval &= ~G_ALERTDISABLE;
+				prefs_common.warn_empty_subj = FALSE;
+			}
 			if (aval != G_ALERTALTERNATE)
 				return FALSE;
 		}
diff --git a/src/prefs_common.c b/src/prefs_common.c
index ecc0ccf..c42bbb8 100644
--- a/src/prefs_common.c
+++ b/src/prefs_common.c
@@ -197,6 +197,8 @@ static PrefParam param[] = {
 	 NULL, NULL, NULL},
 	{"outgoing_fallback_to_ascii", "TRUE", &prefs_common.outgoing_fallback_to_ascii, P_BOOL,
 	 NULL, NULL, NULL},
+        {"warn_empty_subj", "TRUE", &prefs_common.warn_empty_subj,
+	 P_BOOL, NULL, NULL, NULL},
 
 	{"allow_jisx0201_kana", "FALSE", &prefs_common.allow_jisx0201_kana,
 	 P_BOOL, NULL, NULL, NULL},
diff --git a/src/prefs_common.h b/src/prefs_common.h
index 9e4db9c..16966c8 100644
--- a/src/prefs_common.h
+++ b/src/prefs_common.h
@@ -130,6 +130,7 @@ struct _PrefsCommon
 	gchar *outgoing_charset;
 	TransferEncodingMethod encoding_method;
 	gboolean outgoing_fallback_to_ascii;
+	gboolean warn_empty_subj;
 
 	gboolean allow_jisx0201_kana;
 
diff --git a/src/prefs_send.c b/src/prefs_send.c
index 25ff6db..ee8f876 100644
--- a/src/prefs_send.c
+++ b/src/prefs_send.c
@@ -52,6 +52,7 @@ typedef struct _SendPage
 	GtkWidget *checkbtn_confirm_send_queued_messages;
 	GtkWidget *checkbtn_never_send_retrcpt;
 	GtkWidget *checkbtn_senddialog;
+	GtkWidget *checkbtn_warn_empty_subj;
 	GtkWidget *combobox_charset;
 	GtkWidget *combobox_encoding_method;
 } SendPage;
@@ -145,6 +146,7 @@ static void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
 	GtkWidget *checkbtn_senddialog;
 	GtkWidget *checkbtn_confirm_send_queued_messages;
 	GtkWidget *checkbtn_never_send_retrcpt;
+	GtkWidget *checkbtn_warn_empty_subj;
 	GtkWidget *table;
 
 	vbox1 = gtk_vbox_new (FALSE, VSPACING);
@@ -166,6 +168,8 @@ static void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
 
 	PACK_CHECK_BUTTON(vbox2, checkbtn_senddialog,
 			_("Show send dialog"));
+	PACK_CHECK_BUTTON(vbox2, checkbtn_warn_empty_subj,
+			_("Warn when Subject is empty"));
 
 	table = gtk_table_new(2, 2, FALSE);
 	gtk_widget_show(table);
@@ -297,6 +301,8 @@ static void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
 		prefs_common.never_send_retrcpt);
 	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_senddialog),
 		!prefs_common.send_dialog_invisible);
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_warn_empty_subj),
+		prefs_common.warn_empty_subj);
 	prefs_common_charset_set_optmenu(combobox_charset, 
 		prefs_common.outgoing_charset);
 	combobox_select_by_data(GTK_COMBO_BOX(combobox_encoding),
@@ -308,6 +314,7 @@ static void prefs_send_create_widget(PrefsPage *_page, GtkWindow *window,
 	prefs_send->checkbtn_confirm_send_queued_messages = checkbtn_confirm_send_queued_messages;
  	prefs_send->checkbtn_never_send_retrcpt = checkbtn_never_send_retrcpt;
 	prefs_send->checkbtn_senddialog = checkbtn_senddialog;
+	prefs_send->checkbtn_warn_empty_subj = checkbtn_warn_empty_subj;
 	prefs_send->combobox_charset = combobox_charset;
 	prefs_send->combobox_encoding_method = combobox_encoding;
 
@@ -326,6 +333,8 @@ static void prefs_send_save(PrefsPage *_page)
 		GTK_TOGGLE_BUTTON(page->checkbtn_never_send_retrcpt));
 	prefs_common.send_dialog_invisible = !gtk_toggle_button_get_active(
 		GTK_TOGGLE_BUTTON(page->checkbtn_senddialog));
+	prefs_common.warn_empty_subj = gtk_toggle_button_get_active(
+		GTK_TOGGLE_BUTTON(page->checkbtn_warn_empty_subj));
 
 	g_free(prefs_common.outgoing_charset);
 	prefs_common.outgoing_charset = prefs_common_charset_set_data_from_optmenu(

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

Summary of changes:
 src/compose.c      |   13 +++++++++----
 src/prefs_common.c |    2 ++
 src/prefs_common.h |    1 +
 src/prefs_send.c   |    9 +++++++++
 4 files changed, 21 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list