[Commits] [SCM] claws branch, master, updated. 3.9.3-16-g84ef4ef

claws at claws-mail.org claws at claws-mail.org
Mon Feb 3 14:16:06 CET 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  84ef4ef55f3a18d6be95f7c8f704443545370839 (commit)
      from  40b67269c735beb4897f9522afdf245fc0fcb581 (commit)


- Log -----------------------------------------------------------------
commit 84ef4ef55f3a18d6be95f7c8f704443545370839
Author: Paul <paul at claws-mail.org>
Date:   Mon Feb 3 13:16:00 2014 +0000

    add option 'Generate X-Newsreader header' for NNTP accounts and complete the 'Generate X-Mailer header' option

diff --git a/src/account.c b/src/account.c
index 2d70e6d..a5053e4 100644
--- a/src/account.c
+++ b/src/account.c
@@ -948,6 +948,7 @@ static void account_clone(GtkWidget *widget, gpointer data)
 	/* send */
 	ACP_FASSIGN(gen_msgid);
 	ACP_FASSIGN(gen_xmailer);
+	ACP_FASSIGN(gen_xnewsreader);
 	ACP_FASSIGN(add_customhdr);
 	ACP_FASSIGN(use_smtp_auth);
 	ACP_FASSIGN(smtp_auth_type);
diff --git a/src/compose.c b/src/compose.c
index 69bfac6..b5a5ad8 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -6450,7 +6450,8 @@ static gchar *compose_get_header(Compose *compose)
 			gtk_major_version, gtk_minor_version, gtk_micro_version,
 			TARGET_ALIAS);
 	}
-	if (g_slist_length(compose->newsgroup_list) && !IS_IN_CUSTOM_HEADER("X-Newsreader")) {
+	if (compose->account->gen_xnewsreader &&
+	    g_slist_length(compose->newsgroup_list) && !IS_IN_CUSTOM_HEADER("X-Newsreader")) {
 		g_string_append_printf(header, "X-Newsreader: %s (GTK+ %d.%d.%d; %s)\n",
 			prog_version,
 			gtk_major_version, gtk_minor_version, gtk_micro_version,
diff --git a/src/prefs_account.c b/src/prefs_account.c
index 43295c0..c5f8ab9 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -168,6 +168,7 @@ typedef struct SendPage
 
 	GtkWidget *msgid_checkbtn;
 	GtkWidget *xmailer_checkbtn;
+	GtkWidget *xnewsreader_checkbtn;
 	GtkWidget *customhdr_checkbtn;
 	GtkWidget *msgid_with_addr_checkbtn;
 	GtkWidget *smtp_auth_checkbtn;
@@ -514,6 +515,10 @@ static PrefParam send_param[] = {
 	 &send_page.xmailer_checkbtn,
 	 prefs_set_data_from_toggle, prefs_set_toggle},
 
+	{"generate_xnewsreader", "TRUE", &tmp_ac_prefs.gen_xnewsreader, P_BOOL,
+	 &send_page.xnewsreader_checkbtn,
+	 prefs_set_data_from_toggle, prefs_set_toggle},
+
 	{"add_custom_header", "FALSE", &tmp_ac_prefs.add_customhdr, P_BOOL,
 	 &send_page.customhdr_checkbtn,
 	 prefs_set_data_from_toggle, prefs_set_toggle},
@@ -1666,6 +1671,7 @@ static void send_create_widget_func(PrefsPage * _page,
 	GtkWidget *frame;
 	GtkWidget *msgid_checkbtn;
 	GtkWidget *xmailer_checkbtn;
+	GtkWidget *xnewsreader_checkbtn;
 	GtkWidget *hbox;
 	GtkWidget *customhdr_checkbtn;
 	GtkWidget *customhdr_edit_btn;
@@ -1700,6 +1706,9 @@ static void send_create_widget_func(PrefsPage * _page,
 	PACK_CHECK_BUTTON (vbox2, xmailer_checkbtn,
 			   _("Generate X-Mailer header"));
 
+	PACK_CHECK_BUTTON (vbox2, xnewsreader_checkbtn,
+			   _("Generate X-Newsreader header"));
+
 	hbox = gtk_hbox_new (FALSE, 12);
 	gtk_widget_show (hbox);
 	gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
@@ -1845,6 +1854,7 @@ static void send_create_widget_func(PrefsPage * _page,
 	
 	page->msgid_checkbtn     = msgid_checkbtn;
 	page->xmailer_checkbtn   = xmailer_checkbtn;
+	page->xnewsreader_checkbtn   = xnewsreader_checkbtn;
 	page->customhdr_checkbtn = customhdr_checkbtn;
 	page->msgid_with_addr_checkbtn	= checkbtn_msgid_with_addr;
 
@@ -3947,8 +3957,13 @@ static void prefs_account_protocol_set_optmenu(PrefParam *pparam)
 			gtk_widget_hide(send_page.msgid_checkbtn);
 		} else
 			gtk_widget_show(send_page.msgid_checkbtn);
-
-		gtk_widget_show(send_page.xmailer_checkbtn);
+		if (protocol == A_NNTP) {
+			gtk_widget_hide(send_page.xmailer_checkbtn);
+			gtk_widget_show(send_page.xnewsreader_checkbtn);
+		} else {
+			gtk_widget_show(send_page.xmailer_checkbtn);
+			gtk_widget_hide(send_page.xnewsreader_checkbtn);			
+		}
 	}
 }
 
@@ -4097,7 +4112,8 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
 #endif
 		gtk_widget_show(send_page.msgid_checkbtn);
-		gtk_widget_show(send_page.xmailer_checkbtn);
+		gtk_widget_hide(send_page.xmailer_checkbtn);
+		gtk_widget_show(send_page.xnewsreader_checkbtn);
 		gtk_widget_show(basic_page.nntpserv_label);
 		gtk_widget_show(basic_page.nntpserv_entry);
   		gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
@@ -4198,6 +4214,7 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 	case A_LOCAL:
 		gtk_widget_show(send_page.msgid_checkbtn);
 		gtk_widget_show(send_page.xmailer_checkbtn);
+		gtk_widget_hide(send_page.xnewsreader_checkbtn);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
 		gtk_widget_hide(basic_page.nntpserv_label);
@@ -4304,6 +4321,7 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 				TRUE);
 		gtk_widget_hide(send_page.msgid_checkbtn);
 		gtk_widget_show(send_page.xmailer_checkbtn);
+		gtk_widget_hide(send_page.xnewsreader_checkbtn);
 		gtk_widget_hide(basic_page.nntpserv_label);
 		gtk_widget_hide(basic_page.nntpserv_entry);
   		gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
@@ -4403,6 +4421,7 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 	case A_NONE:
 		gtk_widget_show(send_page.msgid_checkbtn);
 		gtk_widget_show(send_page.xmailer_checkbtn);
+		gtk_widget_hide(send_page.xnewsreader_checkbtn);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
 		gtk_widget_hide(basic_page.nntpserv_label);
@@ -4500,6 +4519,7 @@ static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
 	default:
 		gtk_widget_show(send_page.msgid_checkbtn);
 		gtk_widget_show(send_page.xmailer_checkbtn);
+		gtk_widget_hide(send_page.xnewsreader_checkbtn);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
 		gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
 		gtk_widget_hide(basic_page.nntpserv_label);
diff --git a/src/prefs_account.h b/src/prefs_account.h
index 40b9301..6bc27a9 100644
--- a/src/prefs_account.h
+++ b/src/prefs_account.h
@@ -110,6 +110,7 @@ struct _PrefsAccount
 	/* Send */
 	gboolean gen_msgid;
 	gboolean gen_xmailer;
+	gboolean gen_xnewsreader;
 	gboolean add_customhdr;
 	gboolean use_smtp_auth;
 	SMTPAuthType smtp_auth_type;

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

Summary of changes:
 src/account.c       |    1 +
 src/compose.c       |    3 ++-
 src/prefs_account.c |   26 +++++++++++++++++++++++---
 src/prefs_account.h |    1 +
 4 files changed, 27 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list