[Commits] folder.c 1.213.2.202.2.2 1.213.2.202.2.3 messageview.c 1.94.2.218.2.5 1.94.2.218.2.6 messageview.h 1.19.2.26.2.1 1.19.2.26.2.2 procmsg.h 1.60.2.56.2.2 1.60.2.56.2.3 summaryview.c 1.395.2.430.2.5 1.395.2.430.2.6 textview.c 1.96.2.232.2.2 1.96.2.232.2.3 textview.h 1.12.2.27.2.1 1.12.2.27.2.2

miras at claws-mail.org miras at claws-mail.org
Fri Mar 16 00:54:46 CET 2012


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

Modified Files:
      Tag: new-contacts
	folder.c messageview.c messageview.h procmsg.h summaryview.c 
	textview.c textview.h 
Log Message:
2012-03-15 [mir]	3.7.10cvs16.24-new-contacts

	* src/folder.c
	* src/messageview.c
	* src/messageview.h
	* src/procmsg.h
	* src/summaryview.c
	* src/textview.c
	* src/textview.h
	* src/gtk/authors.h
	* src/gtk/gtkcmctree.c
	    Applied patch 3.8.0cvs30 to 3.8.0cvs33 from HEAD

Index: procmsg.h
===================================================================
RCS file: /home/claws-mail/claws/src/procmsg.h,v
retrieving revision 1.60.2.56.2.2
retrieving revision 1.60.2.56.2.3
diff -u -d -r1.60.2.56.2.2 -r1.60.2.56.2.3
--- procmsg.h	5 Feb 2012 22:11:11 -0000	1.60.2.56.2.2
+++ procmsg.h	15 Mar 2012 23:54:43 -0000	1.60.2.56.2.3
@@ -174,8 +174,7 @@
 
 typedef enum {
 	MSGINFO_UPDATE_FLAGS = 1 << 0,
-	MSGINFO_UPDATE_DELETED = 1 << 1,
-	MSGINFO_UPDATE_ADDED = 1 << 2
+	MSGINFO_UPDATE_DELETED = 1 << 1
 } MsgInfoUpdateFlags;
 
 #include "procmime.h"

Index: folder.c
===================================================================
RCS file: /home/claws-mail/claws/src/folder.c,v
retrieving revision 1.213.2.202.2.2
retrieving revision 1.213.2.202.2.3
diff -u -d -r1.213.2.202.2.2 -r1.213.2.202.2.3
--- folder.c	5 Feb 2012 22:11:10 -0000	1.213.2.202.2.2
+++ folder.c	15 Mar 2012 23:54:43 -0000	1.213.2.202.2.3
@@ -3066,8 +3066,6 @@
 
 static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo *flagsource)
 {
-	MsgInfoUpdate msginfo_update;
-
 	/* update folder stats */
 	if (MSG_IS_NEW(newmsginfo->flags))
 		item->new_msgs++;
@@ -3094,10 +3092,6 @@
 	if (!item->cache)
 		folder_item_read_cache(item);
 
-	msginfo_update.msginfo = newmsginfo;
-	msginfo_update.flags = MSGINFO_UPDATE_ADDED;
-	hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
-
 	msgcache_add_msg(item->cache, newmsginfo);
 	copy_msginfo_flags(flagsource, newmsginfo);
 	folder_item_update_with_msg(item,  F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_ADDMSG, newmsginfo);

Index: textview.h
===================================================================
RCS file: /home/claws-mail/claws/src/textview.h,v
retrieving revision 1.12.2.27.2.1
retrieving revision 1.12.2.27.2.2
diff -u -d -r1.12.2.27.2.1 -r1.12.2.27.2.2
--- textview.h	29 Nov 2011 00:15:24 -0000	1.12.2.27.2.1
+++ textview.h	15 Mar 2012 23:54:44 -0000	1.12.2.27.2.2
@@ -90,6 +90,8 @@
 				 MimeInfo	*mimeinfo,
 				 FILE		*fp);
 void textview_show_error	(TextView	*textview);
+void textview_show_info		(TextView	*textview,
+				 const gchar	*info_str);
 void textview_show_mime_part	(TextView	*textview,
 				 MimeInfo	*partinfo);
 void textview_clear		(TextView	*textview);

Index: summaryview.c
===================================================================
RCS file: /home/claws-mail/claws/src/summaryview.c,v
retrieving revision 1.395.2.430.2.5
retrieving revision 1.395.2.430.2.6
diff -u -d -r1.395.2.430.2.5 -r1.395.2.430.2.6
--- summaryview.c	5 Feb 2012 22:11:11 -0000	1.395.2.430.2.5
+++ summaryview.c	15 Mar 2012 23:54:43 -0000	1.395.2.430.2.6
@@ -6827,6 +6827,8 @@
 static void summary_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
 			     gint column, SummaryView *summaryview)
 {
+	GList *list, *cur;
+	MessageView *msgview;
 	MsgInfo *msginfo;
 	gboolean marked_unread = FALSE;
 
@@ -6918,6 +6920,17 @@
 		break;
 	}
 
+	list = messageview_get_msgview_list();
+	for (cur = list; cur != NULL; cur = cur->next) {
+		msgview = (MessageView *) cur->data;
+		
+		if (msgview->new_window && msgview->update_needed) {
+			MsgInfo *new_msginfo = summary_get_selected_msg(summaryview);
+			messageview_show(msgview, new_msginfo, msgview->all_headers);
+			msgview->update_needed = FALSE;		
+		}
+	}
+
 	if (summaryview->display_msg ||
 	    (prefs_common.always_show_msg &&
 	     messageview_is_visible(summaryview->messageview))) {

Index: textview.c
===================================================================
RCS file: /home/claws-mail/claws/src/textview.c,v
retrieving revision 1.96.2.232.2.2
retrieving revision 1.96.2.232.2.3
diff -u -d -r1.96.2.232.2.2 -r1.96.2.232.2.3
--- textview.c	29 Nov 2011 00:15:23 -0000	1.96.2.232.2.2
+++ textview.c	15 Mar 2012 23:54:43 -0000	1.96.2.232.2.3
@@ -867,6 +867,24 @@
 	textview_show_icon(textview, GTK_STOCK_DIALOG_ERROR);
 }
 
+void textview_show_info(TextView *textview, const gchar *info_str)
+{
+	GtkTextView *text;
+	GtkTextBuffer *buffer;
+	GtkTextIter iter;
+
+	textview_set_font(textview, NULL);
+	textview_clear(textview);
+
+	text = GTK_TEXT_VIEW(textview->text);
+	buffer = gtk_text_view_get_buffer(text);
+	gtk_text_buffer_get_start_iter(buffer, &iter);
+
+	TEXTVIEW_INSERT(info_str);
+	textview_show_icon(textview, GTK_STOCK_DIALOG_INFO);
+	textview_cursor_normal(textview);
+}
+
 void textview_show_mime_part(TextView *textview, MimeInfo *partinfo)
 {
 	GtkTextView *text;

Index: messageview.h
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.h,v
retrieving revision 1.19.2.26.2.1
retrieving revision 1.19.2.26.2.2
diff -u -d -r1.19.2.26.2.1 -r1.19.2.26.2.2
--- messageview.h	5 Feb 2012 22:11:11 -0000	1.19.2.26.2.1
+++ messageview.h	15 Mar 2012 23:54:43 -0000	1.19.2.26.2.2
@@ -75,12 +75,12 @@
 	gboolean all_headers;
 
 	gint msginfo_update_callback_id;
-	gint msginfo_moved_callback_id;
 	gboolean updating;
 	gboolean deferred_destroy;
 	
 	gboolean show_full_text;
 	gboolean partial_display_shown;
+	gboolean update_needed;
 	GtkUIManager *ui_manager;
 	GList *trail;
 	gint trail_pos;

Index: messageview.c
===================================================================
RCS file: /home/claws-mail/claws/src/messageview.c,v
retrieving revision 1.94.2.218.2.5
retrieving revision 1.94.2.218.2.6
diff -u -d -r1.94.2.218.2.5 -r1.94.2.218.2.6
--- messageview.c	19 Feb 2012 21:01:16 -0000	1.94.2.218.2.5
+++ messageview.c	15 Mar 2012 23:54:43 -0000	1.94.2.218.2.6
@@ -184,7 +184,6 @@
 static void messageview_update		(MessageView	*msgview,
 					 MsgInfo	*old_msginfo);
 static gboolean messageview_update_msg	(gpointer source, gpointer data);
-static gboolean messageview_msg_moved	(gpointer source, gpointer data);
 
 static void messageview_nothing_cb	   (GtkAction *action, gpointer data)
 {
@@ -414,10 +413,10 @@
 	messageview->statusbar_cid = 0;
 
 	messageview->show_full_text= FALSE;
+	messageview->update_needed = FALSE;
 
 	messageview->msginfo_update_callback_id =
 		hooks_register_hook(MSGINFO_UPDATE_HOOKLIST, messageview_update_msg, (gpointer) messageview);
-	messageview->msginfo_moved_callback_id = 0;
 
 	return messageview;
 }
@@ -722,8 +721,6 @@
 	g_signal_connect(G_OBJECT(window), "key_press_event",
 			 G_CALLBACK(key_pressed), msgview);
 #endif
-	msgview->msginfo_moved_callback_id = hooks_register_hook(MSGINFO_UPDATE_HOOKLIST,
-					messageview_msg_moved, (gpointer) msgview);
 	messageview_add_toolbar(msgview, window);
 
 	if (show) {
@@ -1560,6 +1557,13 @@
 	procmsg_msginfo_free(messageview->msginfo);
 	messageview->msginfo = NULL;
 	messageview->filtered = FALSE;
+
+	if (messageview->window) {
+		gtk_window_set_title(GTK_WINDOW(messageview->window), 
+				_("Claws Mail - Message View"));
+		GTK_EVENTS_FLUSH();
+	}
+
 	mimeview_clear(messageview->mimeview);
 	headerview_clear(messageview->headerview);
 	noticeview_hide(messageview->noticeview);
@@ -1578,13 +1582,9 @@
 		messageview->mainwin->summaryview->displayed = NULL;
 		messageview->mainwin->summaryview->ext_messageview = NULL;
 	}
-	if (!messageview->deferred_destroy) {
+	if (!messageview->deferred_destroy)
 		hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
 			      messageview->msginfo_update_callback_id);
-		if (messageview->new_window)
-			hooks_unregister_hook(MSGINFO_UPDATE_HOOKLIST,
-				messageview->msginfo_moved_callback_id);
-	}
 
 	if (messageview->updating) {
 		debug_print("uh oh, better not touch that now (fetching)\n");
@@ -2896,44 +2896,37 @@
 {
 	MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
 	MessageView *messageview = (MessageView *)data;
+	MsgInfo *old_msginfo = messageview->msginfo;
 
 	if (messageview->msginfo != msginfo_update->msginfo)
 		return FALSE;
 
-	if ((msginfo_update->flags & MSGINFO_UPDATE_DELETED) &&
-		!messageview->new_window)
+	if ((msginfo_update->flags & MSGINFO_UPDATE_DELETED) ||
+	    MSG_IS_DELETED(old_msginfo->flags))
 	{
-		MsgInfo *old_msginfo = messageview->msginfo;
-		messageview_clear(messageview);
-		messageview_update(messageview, old_msginfo);
-	}
-
-	return FALSE;
-}
-
-static gboolean messageview_msg_moved(gpointer source, gpointer data)
-{
-	MsgInfoUpdate *msginfo_update = (MsgInfoUpdate *) source;
-	MessageView *messageview = (MessageView *) data;
-	MsgInfo *msg_old = messageview->msginfo;
-	MsgInfo *msg_new = msginfo_update->msginfo;
-
-	if (msg_new == NULL || msg_old == NULL)
-		return FALSE;
+		if (messageview->new_window) {
+			if (old_msginfo->folder && old_msginfo->folder->total_msgs == 0) {
+				messageview_clear(messageview);
+				textview_show_info(messageview->mimeview->textview,
+					_("\n  There are no messages in this folder"));
+				return FALSE;
+			}
+			
+			if (!prefs_common.always_show_msg) {
+				messageview_clear(messageview);
+				textview_show_info(messageview->mimeview->textview,
+					MSG_IS_DELETED(old_msginfo->flags) ?
+					_("\n  Message has been deleted") :
+					_("\n  Message has been moved to trash"));
+			} else
+				messageview->update_needed = TRUE;
 
-	if (strcmp2(msg_new->msgid, msg_old->msgid))
-		return FALSE;
+		} else {
+			messageview_clear(messageview);
+			messageview_update(messageview, old_msginfo);
+		}
+	} 
 
-	if ((msginfo_update->flags & MSGINFO_UPDATE_ADDED) &&
-	    (folder_item_get_msginfo(msg_old->folder, msg_old->msgnum) == NULL))
-	{
-		if (folder_has_parent_of_type(msg_new->folder, F_TRASH))
-			messageview_destroy(messageview);
-		else
-			messageview_show(messageview, msg_new,
-					 messageview->all_headers);
-	}
-	
 	return FALSE;
 }
 



More information about the Commits mailing list