CVS: sylpheed-claws/src folder.c,1.213.2.91,1.213.2.92 prefs_spelling.c,1.5.2.23,1.5.2.24

Colin Leroy <[email protected]>
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5025/src

Modified Files:
      Tag: gtk2
	folder.c prefs_spelling.c 
Log Message:
2006-05-08 [colin]	2.2.0cvs3

	* src/folder.c
		Fix "ignore thread" when mails are threaded by
		subject (and weren't ignored although appearing
		in the thread).
	* src/prefs_spelling.c
		GUI rework.
		Both patches by Pawel.

Index: folder.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/folder.c,v
retrieving revision 1.213.2.91
retrieving revision 1.213.2.92
diff -u -r1.213.2.91 -r1.213.2.92
--- folder.c	25 Apr 2006 22:39:56 -0000	1.213.2.91
+++ folder.c	8 May 2006 18:37:00 -0000	1.213.2.92
@@ -1672,7 +1672,8 @@
 	guint markedcnt = 0, unreadmarkedcnt = 0;
 	guint cache_max_num, folder_max_num, cache_cur_num, folder_cur_num;
 	gboolean update_flags = 0, old_uids_valid = FALSE;
-    
+	GHashTable *subject_table = NULL;
+	
 	g_return_val_if_fail(item != NULL, -1);
 	if (item->path == NULL) return -1;
 
@@ -1682,13 +1683,17 @@
 	g_return_val_if_fail(folder->klass->get_num_list != NULL, -1);
 
 	debug_print("Scanning folder %s for cache changes.\n", item->path ? item->path : "(null)");
-
+	
 	/* Get list of messages for folder and cache */
 	if (folder->klass->get_num_list(item->folder, item, &folder_list, &old_uids_valid) < 0) {
 		debug_print("Error fetching list of message numbers\n");
 		return(-1);
 	}
 
+	if(prefs_common.thread_by_subject) {
+		subject_table = g_hash_table_new(g_str_hash, g_str_equal);
+	}
+	
 	if (old_uids_valid) {
 		if (!item->cache)
 			folder_item_read_cache(item);
@@ -1808,9 +1813,16 @@
 				procmsg_msginfo_free(msginfo);
 
 				debug_print("Remembering message %d to update...\n", folder_cur_num);
-			} else
+			} else {
 				exists_list = g_slist_prepend(exists_list, msginfo);
 
+				if(prefs_common.thread_by_subject &&
+					MSG_IS_IGNORE_THREAD(msginfo->flags) &&
+					!subject_table_lookup(subject_table, msginfo->subject)) {
+					subject_table_insert(subject_table, msginfo->subject, msginfo);
+				}
+			}
+			
 			/* Move to next folder and cache number */
 			cache_list_cur = cache_list_cur->next;
 			folder_list_cur = folder_list_cur->next;
@@ -1869,8 +1881,15 @@
 			    (item->folder->account->filter_on_recv) &&
 			    procmsg_msginfo_filter(msginfo))
 				to_filter = g_slist_prepend(to_filter, msginfo);
-			else
+			else {
 				exists_list = g_slist_prepend(exists_list, msginfo);
+				
+				if(prefs_common.thread_by_subject &&
+					MSG_IS_IGNORE_THREAD(msginfo->flags) &&
+					!subject_table_lookup(subject_table, msginfo->subject)) {
+					subject_table_insert(subject_table, msginfo->subject, msginfo);
+				}
+			}
 		}
 		filtering_move_and_copy_msgs(to_filter);
 		for (elem = to_filter; elem; elem = g_slist_next(elem)) {
@@ -1888,7 +1907,7 @@
 
 	folder_item_set_batch(item, TRUE);
 	for (elem = exists_list; elem != NULL; elem = g_slist_next(elem)) {
-		MsgInfo *msginfo;
+		MsgInfo *msginfo, *parent_msginfo;
 
 		msginfo = elem->data;
 		if (MSG_IS_IGNORE_THREAD(msginfo->flags) && (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)))
@@ -1896,6 +1915,15 @@
 		if (!MSG_IS_IGNORE_THREAD(msginfo->flags) && procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD)) {
 			procmsg_msginfo_change_flags(msginfo, MSG_IGNORE_THREAD, 0, MSG_NEW | MSG_UNREAD, 0);
 		}
+		if(prefs_common.thread_by_subject && !msginfo->inreplyto &&
+			!msginfo->references && !MSG_IS_IGNORE_THREAD(msginfo->flags) &&
+			(parent_msginfo = subject_table_lookup(subject_table, msginfo->subject)))
+		{
+			if(MSG_IS_IGNORE_THREAD(parent_msginfo->flags)) {
+				procmsg_msginfo_change_flags(msginfo, MSG_IGNORE_THREAD, 0,
+						MSG_NEW | MSG_UNREAD, 0);
+			}
+		}
 		if ((folder_has_parent_of_type(item, F_OUTBOX) ||
 		     folder_has_parent_of_type(item, F_QUEUE)  ||
 		     folder_has_parent_of_type(item, F_DRAFT)  ||
@@ -1917,7 +1945,11 @@
 	}
 	folder_item_set_batch(item, FALSE);
 	g_slist_free(exists_list);
-
+	
+	if(prefs_common.thread_by_subject) {
+		g_hash_table_destroy(subject_table);
+	}
+	
 	item->new_msgs = newcnt;
 	item->unread_msgs = unreadcnt;
 	item->total_msgs = totalcnt;
@@ -1928,7 +1960,7 @@
 
 	folder_item_update(item, update_flags);
 	folder_item_update_thaw();
-
+	
 	return 0;
 }
 

Index: prefs_spelling.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/prefs_spelling.c,v
retrieving revision 1.5.2.23
retrieving revision 1.5.2.24
diff -u -r1.5.2.23 -r1.5.2.24
--- prefs_spelling.c	13 Apr 2006 13:57:32 -0000	1.5.2.23
+++ prefs_spelling.c	8 May 2006 18:37:00 -0000	1.5.2.24
@@ -47,14 +47,15 @@
 
 	GtkWidget *window;		/* do not modify */
 
+	GtkWidget *automatic_frame;
+	GtkWidget *dictionary_frame;
+	GtkWidget *path_frame;
+	
 	GtkWidget *enable_aspell_checkbtn;
 	GtkWidget *recheck_when_changing_dict_checkbtn;
 	GtkWidget *check_while_typing_checkbtn;
 	GtkWidget *use_alternate_checkbtn;
 
-	GtkWidget *table;
-
-	GtkWidget *aspell_path_label;
 	GtkWidget *aspell_path_entry;
 	GtkWidget *aspell_path_select;
 
@@ -75,10 +76,12 @@
 
 static void prefs_spelling_enable(SpellingPage *spelling, gboolean enable)
 {
-	gtk_widget_set_sensitive(spelling->check_while_typing_checkbtn,	enable);
-	gtk_widget_set_sensitive(spelling->recheck_when_changing_dict_checkbtn, enable);
-	gtk_widget_set_sensitive(spelling->use_alternate_checkbtn,	enable);
-	gtk_widget_set_sensitive(spelling->table,			enable);
+	gtk_widget_set_sensitive(spelling->automatic_frame, enable);
+	gtk_widget_set_sensitive(spelling->dictionary_frame, enable);
+	gtk_widget_set_sensitive(spelling->path_frame, enable);
+	gtk_widget_set_sensitive(spelling->misspelled_label, enable);
+	gtk_widget_set_sensitive(spelling->misspelled_colorbtn, enable);
+	gtk_widget_set_sensitive(spelling->use_alternate_checkbtn, enable);
 }
 
 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
@@ -141,16 +144,19 @@
 {
 	SpellingPage *prefs_spelling = (SpellingPage *) _page;
 
-	GtkWidget *vbox1, *vbox2;
+	GtkWidget *vbox1, *vbox2, *hbox;
 
 	GtkWidget *enable_aspell_checkbtn;
 	GtkWidget *check_while_typing_checkbtn;
 	GtkWidget *recheck_when_changing_dict_checkbtn;
 	GtkWidget *use_alternate_checkbtn;
 
-	GtkWidget *table;
+	GtkWidget *label;
+
+	GtkWidget *automatic_frame;
+	GtkWidget *dictionary_frame;
+	GtkWidget *path_frame;
 
-	GtkWidget *aspell_path_label;
 	GtkWidget *aspell_path_hbox;
 	GtkWidget *aspell_path_entry;
 	GtkWidget *aspell_path_select;
@@ -181,16 +187,6 @@
 	gtk_widget_show(enable_aspell_checkbtn);
 	gtk_box_pack_start(GTK_BOX(vbox2), enable_aspell_checkbtn, TRUE, TRUE, 0);
 
-	check_while_typing_checkbtn = gtk_check_button_new_with_label(
-			_("Check while typing"));
-	gtk_widget_show(check_while_typing_checkbtn);
-	gtk_box_pack_start(GTK_BOX(vbox2), check_while_typing_checkbtn, TRUE, TRUE, 0);
-
-	recheck_when_changing_dict_checkbtn = gtk_check_button_new_with_label(
-			_("Re-check message when changing dictionary"));
-	gtk_widget_show(recheck_when_changing_dict_checkbtn);
-	gtk_box_pack_start(GTK_BOX(vbox2), recheck_when_changing_dict_checkbtn, TRUE, TRUE, 0);
-
 	use_alternate_checkbtn = gtk_check_button_new_with_label(
 			_("Enable alternate dictionary"));
 	gtk_widget_show(use_alternate_checkbtn);
@@ -200,27 +196,11 @@
 	gtk_tooltips_set_tip(tooltips, use_alternate_checkbtn, 
 			_("Faster switching with last used dictionary"), NULL);
 
-	
-	table = gtk_table_new(4, 2, FALSE);
-	gtk_widget_show(table);
-	gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8);
-	gtk_box_pack_start(GTK_BOX(vbox2), table, TRUE, TRUE, 0);
-
-	
-	aspell_path_label = gtk_label_new(_("Dictionaries path:"));
-	gtk_widget_show(aspell_path_label);
-	gtk_table_attach(GTK_TABLE(table), aspell_path_label, 0, 1, 0, 1,
-			(GtkAttachOptions) (GTK_FILL),
-			(GtkAttachOptions) (0), 0, 0);
-	gtk_label_set_justify(GTK_LABEL(aspell_path_label), GTK_JUSTIFY_RIGHT);
-	gtk_misc_set_alignment(GTK_MISC(aspell_path_label), 1, 0.5);
-
+	PACK_FRAME(vbox1, path_frame, _("Dictionary path"));
 	aspell_path_hbox = gtk_hbox_new(FALSE, 8);
 	gtk_widget_show(aspell_path_hbox);
-	gtk_table_attach(GTK_TABLE(table), aspell_path_hbox, 1, 2, 0, 1,
-			 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
-			 (GtkAttachOptions) (GTK_FILL), 0, 0);
+	gtk_container_add(GTK_CONTAINER(path_frame), aspell_path_hbox);
+	gtk_container_set_border_width(GTK_CONTAINER(aspell_path_hbox), 8);	
 
 	aspell_path_entry = gtk_entry_new();
 	gtk_widget_show(aspell_path_entry);
@@ -231,60 +211,89 @@
 	gtk_widget_show(aspell_path_select);
 	gtk_box_pack_start(GTK_BOX(aspell_path_hbox), aspell_path_select, FALSE, FALSE, 0);
 
+	PACK_FRAME(vbox1, automatic_frame, _("Automatic spelling"));
+	vbox2 = gtk_vbox_new(FALSE, VSPACING_NARROW);
+	gtk_widget_show(vbox2);
+	gtk_container_add(GTK_CONTAINER(automatic_frame), vbox2);
+	gtk_container_set_border_width(GTK_CONTAINER(vbox2), 8);
 	
-	default_dict_label = gtk_label_new(_("Default dictionary:"));
+	check_while_typing_checkbtn = gtk_check_button_new_with_label(
+			_("Check while typing"));
+	gtk_widget_show(check_while_typing_checkbtn);
+	gtk_box_pack_start(GTK_BOX(vbox2), check_while_typing_checkbtn, TRUE, TRUE, 0);
+
+	recheck_when_changing_dict_checkbtn = gtk_check_button_new_with_label(
+			_("Re-check message when changing dictionary"));
+	gtk_widget_show(recheck_when_changing_dict_checkbtn);
+	gtk_box_pack_start(GTK_BOX(vbox2), recheck_when_changing_dict_checkbtn, TRUE, TRUE, 0);
+	
+	PACK_FRAME(vbox1, dictionary_frame, _("Dictionary"));
+	vbox2 = gtk_vbox_new(FALSE, VSPACING_NARROW);
+	gtk_widget_show(vbox2);
+	gtk_container_add(GTK_CONTAINER(dictionary_frame), vbox2);
+	gtk_container_set_border_width(GTK_CONTAINER(vbox2), 8);
+	
+	hbox = gtk_hbox_new(FALSE, 10);
+	gtk_widget_show(hbox);
+	gtk_box_pack_start(GTK_BOX(vbox2), hbox, TRUE, TRUE, 0);
+	
+	default_dict_label = gtk_label_new(_("Default dictionary"));
 	gtk_widget_show(default_dict_label);
-	gtk_table_attach(GTK_TABLE(table), default_dict_label, 0, 1, 1, 2,
-			(GtkAttachOptions) (GTK_FILL),
-			(GtkAttachOptions) (0), 0, 0);
-	gtk_label_set_justify(GTK_LABEL(default_dict_label), GTK_JUSTIFY_RIGHT);
+	gtk_label_set_justify(GTK_LABEL(default_dict_label), GTK_JUSTIFY_LEFT);
 	gtk_misc_set_alignment(GTK_MISC(default_dict_label), 1, 0.5);
-
+	gtk_box_pack_start(GTK_BOX(hbox), default_dict_label, FALSE, FALSE, 0);
+	
+	label = gtk_label_new("");
+	gtk_widget_show(label);
+	gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
+	
 	default_dict_optmenu = gtk_option_menu_new();
 	gtk_widget_show(default_dict_optmenu);
-	gtk_table_attach(GTK_TABLE(table), default_dict_optmenu, 1, 2, 1, 2,
-			(GtkAttachOptions) (GTK_FILL),
-			(GtkAttachOptions) (0), 0, 0);
+	gtk_widget_set_size_request(default_dict_optmenu, 180, -1);
+
 	default_dict_optmenu_menu = gtk_menu_new();
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(default_dict_optmenu),
 			default_dict_optmenu_menu);
+	gtk_box_pack_start(GTK_BOX(hbox), default_dict_optmenu, FALSE, FALSE, 0);
 
+	hbox = gtk_hbox_new(FALSE, 10);
+	gtk_widget_show(hbox);
+	gtk_box_pack_start(GTK_BOX(vbox2), hbox, TRUE, TRUE, 0);
 	
-	sugmode_label = gtk_label_new(_("Default suggestion mode:"));
+	sugmode_label = gtk_label_new(_("Default suggestion mode"));
 	gtk_widget_show(sugmode_label);
-	gtk_table_attach(GTK_TABLE(table), sugmode_label, 0, 1, 2, 3,
-			(GtkAttachOptions) (GTK_FILL),
-			(GtkAttachOptions) (0), 0, 0);
-	gtk_label_set_justify(GTK_LABEL(sugmode_label), GTK_JUSTIFY_RIGHT);
+	gtk_label_set_justify(GTK_LABEL(sugmode_label), GTK_JUSTIFY_LEFT);
 	gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1, 0.5);
+	gtk_box_pack_start(GTK_BOX(hbox), sugmode_label, FALSE, FALSE, 0);
+
+	label = gtk_label_new("");
+	gtk_widget_show(label);
+	gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
 
 	sugmode_optmenu = gtk_option_menu_new();
 	gtk_widget_show(sugmode_optmenu);
-	gtk_table_attach(GTK_TABLE(table), sugmode_optmenu, 1, 2, 2, 3,
-			(GtkAttachOptions) (GTK_FILL),
-			(GtkAttachOptions) (0), 0, 0);
+	gtk_widget_set_size_request(sugmode_optmenu, 180, -1); 
+	
 	sugmode_optmenu_menu = gtk_menu_new();
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
 			sugmode_optmenu_menu);
-
+	gtk_box_pack_start(GTK_BOX(hbox), sugmode_optmenu, FALSE, FALSE, 0);
 	
+	misspelled_hbox = gtk_hbox_new(FALSE, 10);
+	gtk_widget_show(misspelled_hbox);
+	gtk_box_pack_start(GTK_BOX(vbox1), misspelled_hbox, FALSE, FALSE, 0);
+		
 	misspelled_label = gtk_label_new(_("Misspelled word color:"));
 	gtk_widget_show(misspelled_label);
-	gtk_table_attach(GTK_TABLE(table), misspelled_label, 0, 1, 3, 4,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
+	gtk_box_pack_start(GTK_BOX(misspelled_hbox), misspelled_label,
+		FALSE, FALSE, 0);
 	gtk_label_set_justify(GTK_LABEL(misspelled_label), GTK_JUSTIFY_RIGHT);
 	gtk_misc_set_alignment(GTK_MISC(misspelled_label), 1, 0.5);
 
-	misspelled_hbox = gtk_hbox_new(FALSE, 0);
-	gtk_widget_show(misspelled_hbox);
-	gtk_table_attach(GTK_TABLE(table), misspelled_hbox, 1, 2, 3, 4,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (GTK_FILL), 0, 0);
-
 	misspelled_colorbtn = gtk_button_new_with_label("");
 	gtk_widget_show(misspelled_colorbtn);
-	gtk_box_pack_start(GTK_BOX(misspelled_hbox), misspelled_colorbtn, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(misspelled_hbox), misspelled_colorbtn,
+		FALSE, FALSE, 0);
 	gtk_widget_set_size_request(misspelled_colorbtn, 30, 20);
 	tooltips = gtk_tooltips_new();
 	gtk_tooltips_set_tip(tooltips, misspelled_colorbtn,
@@ -321,14 +330,15 @@
 	gtkut_set_widget_bgcolor_rgb(misspelled_colorbtn, prefs_spelling->misspell_col);
 
 	prefs_spelling->window			= GTK_WIDGET(window);
+	prefs_spelling->automatic_frame =	automatic_frame;
+	prefs_spelling->dictionary_frame =	dictionary_frame;
+	prefs_spelling->path_frame =	path_frame;
 	prefs_spelling->enable_aspell_checkbtn	= enable_aspell_checkbtn;
 	prefs_spelling->check_while_typing_checkbtn
 		= check_while_typing_checkbtn;
 	prefs_spelling->recheck_when_changing_dict_checkbtn
 		= recheck_when_changing_dict_checkbtn;
 	prefs_spelling->use_alternate_checkbtn	= use_alternate_checkbtn;
-	prefs_spelling->table			= table;
-	prefs_spelling->aspell_path_label	= aspell_path_label;
 	prefs_spelling->aspell_path_entry	= aspell_path_entry;
 	prefs_spelling->aspell_path_select	= aspell_path_select;
 	prefs_spelling->default_dict_label	= default_dict_label;



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.