[Commits] folder_item_prefs.c 1.2.2.40 1.2.2.41 folder_item_prefs.h 1.2.2.25 1.2.2.26 messageview.c 1.94.2.239 1.94.2.240 prefs_folder_item.c 1.52.2.88 1.52.2.89

colin at claws-mail.org colin at claws-mail.org
Wed Oct 31 11:25:19 CET 2012


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

Modified Files:
      Tag: gtk2
	folder_item_prefs.c folder_item_prefs.h messageview.c 
	prefs_folder_item.c 
Log Message:
2012-10-31 [colin]	3.8.1cvs109

	* src/folder_item_prefs.c
	* src/folder_item_prefs.h
	* src/messageview.c
	* src/prefs_folder_item.c
		Implement feature from bug #2569, 
		"select html part on folder specific properties"
		Patch based on Andrej's patch.

Index: messageview.c
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.c,v
retrieving revision 1.94.2.239
retrieving revision 1.94.2.240
diff -u -d -r1.94.2.239 -r1.94.2.240
--- messageview.c	8 Sep 2012 20:23:10 -0000	1.94.2.239
+++ messageview.c	31 Oct 2012 10:25:17 -0000	1.94.2.240
@@ -66,6 +66,7 @@
 #include "quoted-printable.h"
 #include "version.h"
 #include "statusbar.h"
+#include "folder_item_prefs.h"
 #ifndef USE_NEW_ADDRBOOK
 	#include "addressbook.h"
 #else
@@ -1503,7 +1504,9 @@
 					} else if (mimeinfo->type == MIMETYPE_TEXT && 
 					    !strcasecmp(mimeinfo->subtype, "html") &&
 					    mimeinfo->disposition != DISPOSITIONTYPE_ATTACHMENT &&
-					    prefs_common.promote_html_part) {
+							(msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS ||
+							 (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT &&
+								prefs_common.promote_html_part))) {
 						mimeview_select_mimepart_icon(messageview->mimeview, mimeinfo);
 						goto done;
 					}
@@ -1531,7 +1534,9 @@
 					} else if (mimeinfo->type == MIMETYPE_TEXT && 
 					    !strcasecmp(mimeinfo->subtype, "html") &&
 					    mimeinfo->disposition != DISPOSITIONTYPE_ATTACHMENT &&
-					    prefs_common.promote_html_part) {
+							(msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_ALWAYS ||
+							 (msginfo->folder->prefs->promote_html_part == HTML_PROMOTE_DEFAULT &&
+								prefs_common.promote_html_part))) {
 						mimeview_select_mimepart_icon(messageview->mimeview, mimeinfo);
 						goto done;
 					}

Index: folder_item_prefs.c
===================================================================
RCS file: /home/claws-mail/claws/src/folder_item_prefs.c,v
retrieving revision 1.2.2.40
retrieving revision 1.2.2.41
diff -u -d -r1.2.2.40 -r1.2.2.41
--- folder_item_prefs.c	7 Jul 2012 07:09:27 -0000	1.2.2.40
+++ folder_item_prefs.c	31 Oct 2012 10:25:17 -0000	1.2.2.41
@@ -95,6 +95,8 @@
 	 NULL, NULL, NULL},
 	{"remove_old_bodies", "FALSE", &tmp_prefs.remove_old_bodies, P_BOOL,
 	 NULL, NULL, NULL},
+	{"promote_html_part", "0", &tmp_prefs.promote_html_part, P_ENUM,
+	 NULL, NULL, NULL},
 
 	{"compose_with_format", "FALSE", &tmp_prefs.compose_with_format, P_BOOL,
 	 NULL, NULL, NULL},
@@ -211,6 +213,7 @@
 	prefs->offlinesync = FALSE;
 	prefs->offlinesync_days = 0;
 	prefs->remove_old_bodies = FALSE;
+	prefs->promote_html_part = HTML_PROMOTE_DEFAULT;
 
 	prefs->compose_with_format = FALSE;
 	prefs->compose_subject_format = NULL;
@@ -270,6 +273,7 @@
 	tmp_prefs.offlinesync                   = src->prefs->offlinesync;
 	tmp_prefs.offlinesync_days              = src->prefs->offlinesync_days;
 	tmp_prefs.remove_old_bodies             = src->prefs->remove_old_bodies;
+	tmp_prefs.promote_html_part             = src->prefs->promote_html_part;
 
 	prefs_matcher_read_config();
 

Index: folder_item_prefs.h
===================================================================
RCS file: /home/claws-mail/claws/src/folder_item_prefs.h,v
retrieving revision 1.2.2.25
retrieving revision 1.2.2.26
diff -u -d -r1.2.2.25 -r1.2.2.26
--- folder_item_prefs.h	27 May 2012 17:30:50 -0000	1.2.2.25
+++ folder_item_prefs.h	31 Oct 2012 10:25:17 -0000	1.2.2.26
@@ -26,6 +26,11 @@
 typedef struct _FolderItemPrefs FolderItemPrefs;
 
 #include "folder.h"
+typedef enum {
+	HTML_PROMOTE_DEFAULT=0,
+	HTML_PROMOTE_NEVER,
+	HTML_PROMOTE_ALWAYS
+} HTMLPromoteType;
 
 struct _FolderItemPrefs {
 	gchar * directory;
@@ -38,6 +43,7 @@
 	int offlinesync;
 	int offlinesync_days;
 	int remove_old_bodies;
+	HTMLPromoteType promote_html_part;
 
 	gboolean request_return_receipt;
 	gboolean enable_default_to;

Index: prefs_folder_item.c
===================================================================
RCS file: /home/claws-mail/claws/src/prefs_folder_item.c,v
retrieving revision 1.52.2.88
retrieving revision 1.52.2.89
diff -u -d -r1.52.2.88 -r1.52.2.89
--- prefs_folder_item.c	7 Jul 2012 07:09:29 -0000	1.52.2.88
+++ prefs_folder_item.c	31 Oct 2012 10:25:17 -0000	1.52.2.89
@@ -94,6 +94,7 @@
 	GtkWidget *entry_offlinesync;
 	GtkWidget *label_end_offlinesync;
 	GtkWidget *checkbtn_remove_old_offlinesync;
+	GtkWidget *promote_html_part;
 	
 	/* apply to sub folders */
 #ifndef G_OS_WIN32
@@ -105,6 +106,7 @@
 	GtkWidget *enable_processing_when_opening_rec_checkbtn;
 	GtkWidget *newmailcheck_rec_checkbtn;
 	GtkWidget *offlinesync_rec_checkbtn;
+	GtkWidget *promote_html_part_rec_checkbtn;
 
 	gint	   folder_color;
 };
@@ -240,6 +242,8 @@
 	GtkWidget *entry_offlinesync;
 	GtkWidget *label_end_offlinesync;
 	GtkWidget *checkbtn_remove_old_offlinesync;
+	GtkWidget *promote_html_part;
+	GtkListStore *promote_html_part_menu;
 
 #ifndef G_OS_WIN32
 	GtkWidget *simplify_subject_rec_checkbtn;
@@ -250,6 +254,7 @@
 	GtkWidget *enable_processing_when_opening_rec_checkbtn;
 	GtkWidget *newmailcheck_rec_checkbtn;
 	GtkWidget *offlinesync_rec_checkbtn;
+	GtkWidget *promote_html_part_rec_checkbtn;
 
 	page->item	   = item;
 
@@ -490,6 +495,39 @@
 
 	rowcount++;
 
+	/* Select HTML part by default? */
+	hbox = gtk_hbox_new (FALSE, 2);
+	gtk_widget_show (hbox);
+	gtk_table_attach (GTK_TABLE(table), hbox, 0, 2,
+			rowcount, rowcount+1, GTK_FILL, GTK_FILL, 0, 0);
+
+	label = gtk_label_new(_("Select the HTML part of multipart messages:"));
+	gtk_widget_show (label);
+	gtk_box_pack_start (GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+	promote_html_part = gtkut_sc_combobox_create (NULL, FALSE);
+	gtk_widget_show (promote_html_part);
+	gtk_box_pack_start (GTK_BOX(hbox), promote_html_part, FALSE, FALSE, 0);
+
+	promote_html_part_menu = GTK_LIST_STORE(gtk_combo_box_get_model(
+				GTK_COMBO_BOX(promote_html_part)));
+	COMBOBOX_ADD (promote_html_part_menu, _("Default"), HTML_PROMOTE_DEFAULT);
+	COMBOBOX_ADD (promote_html_part_menu, _("No"), HTML_PROMOTE_NEVER);
+	COMBOBOX_ADD (promote_html_part_menu, _("Yes"), HTML_PROMOTE_ALWAYS);
+
+	combobox_select_by_data(GTK_COMBO_BOX(promote_html_part),
+			item->prefs->promote_html_part);
+
+	CLAWS_SET_TIP(hbox, _(
+				"\"Default\" will follow global preference (found in Preferences -> "
+				"Message View -> Text Options"));
+
+	promote_html_part_rec_checkbtn = gtk_check_button_new();
+	gtk_widget_show (promote_html_part_rec_checkbtn);
+	gtk_table_attach(GTK_TABLE(table), promote_html_part_rec_checkbtn, 2, 3, 
+			 rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+	rowcount++;
+
 	/* Synchronise folder for offline use */
 	checkbtn_offlinesync = gtk_check_button_new_with_label(_("Synchronise for offline use"));
 	gtk_table_attach(GTK_TABLE(table), checkbtn_offlinesync, 0, 2,
@@ -597,6 +635,7 @@
 	page->entry_offlinesync = entry_offlinesync;
 	page->label_end_offlinesync = label_end_offlinesync;
 	page->checkbtn_remove_old_offlinesync = checkbtn_remove_old_offlinesync;
+	page->promote_html_part = promote_html_part;
 
 #ifndef G_OS_WIN32
 	page->simplify_subject_rec_checkbtn  = simplify_subject_rec_checkbtn;
@@ -607,6 +646,7 @@
 	page->enable_processing_when_opening_rec_checkbtn = enable_processing_when_opening_rec_checkbtn;
 	page->newmailcheck_rec_checkbtn	     = newmailcheck_rec_checkbtn;
 	page->offlinesync_rec_checkbtn	     = offlinesync_rec_checkbtn;
+	page->promote_html_part_rec_checkbtn = promote_html_part_rec_checkbtn;
 
 	page->page.widget = table;
 
@@ -632,6 +672,7 @@
 	gboolean all = FALSE, summary_update_needed = FALSE;
 	SpecialFolderItemType type = F_NORMAL;
 	FolderView *folderview = mainwindow_get_mainwindow()->folderview;
+	HTMLPromoteType promote_html_part = HTML_PROMOTE_DEFAULT;
 
 	if (folder->path == NULL)
 		return;
@@ -647,6 +688,11 @@
 		summary_update_needed = TRUE;
 	}
 
+	promote_html_part =
+		combobox_get_active_data(GTK_COMBO_BOX(page->promote_html_part));
+	if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->promote_html_part_rec_checkbtn)))
+		prefs->promote_html_part = promote_html_part;
+
 #ifndef G_OS_WIN32
 	if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->simplify_subject_rec_checkbtn))) {
 		gboolean old_simplify_subject = prefs->enable_simplify_subject;
@@ -732,7 +778,9 @@
 	      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_rec_checkbtn)) ||
 	      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->enable_processing_when_opening_rec_checkbtn)) ||
 	      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->newmailcheck_rec_checkbtn)) ||
-	      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn))))
+	      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn)) ||
+				gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->promote_html_part_rec_checkbtn))
+			))
 		return TRUE;
 	else 
 		return FALSE;



More information about the Commits mailing list