Re: [evolution-patches] [UIHackfest][UI] Fix for http://bugzilla.gnome.org/show_bug.cgi?id=309572



Thanks for the kind reminder, Partha. :)

Here it is.

V. Varadhan

On Thu, 2006-01-12 at 14:55 +0000, Parthasarathi Susarla  wrote:
> Guess you missed out on the patch :)
> -partha
> 
> On Thu, 2006-01-12 at 07:46 -0700, Veerapuram Varadhan wrote:
> > Hi,
> > 
> > Attached patch fixes #309572.  Changelog explains it all.
> > 
> > Let me know your review comments.
> > 
> > Thanks,
> > 
> > V. Varadhan
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches
> 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3768
diff -u -p -r1.3768 ChangeLog
--- ChangeLog	10 Jan 2006 08:10:29 -0000	1.3768
+++ ChangeLog	12 Jan 2006 14:00:31 -0000
@@ -1,3 +1,11 @@
+2006-01-12  Veerapuram Varadhan <vvaradhan novell com>
+
+	* message-list.c (on_cursor_change_cmd): Reset uid in message-list
+	when we select/de-select a message.
+	(message_list_construct): Listen for cursor_change events from
+	ETree.
+	Fixes bug 309572
+	
 2006-01-10  Simon Zheng  <simon zheng sun com>
 
 	* em-composer-utils.c:
Index: message-list.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/message-list.c,v
retrieving revision 1.420
diff -u -p -r1.420 message-list.c
--- message-list.c	17 Dec 2005 18:27:13 -0000	1.420
+++ message-list.c	12 Jan 2006 14:00:31 -0000
@@ -180,6 +180,7 @@ typedef struct _EMailAddress EMailAddres
 G_DEFINE_TYPE (MessageList, message_list, E_TREE_SCROLLED_TYPE);
 
 static void on_cursor_activated_cmd (ETree *tree, int row, ETreePath path, gpointer user_data);
+static void on_cursor_change_cmd (ETree *tree, int row, ETreePath path, gpointer user_data);
 static void on_selection_changed_cmd(ETree *tree, MessageList *ml);
 static gint on_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event, MessageList *list);
 static char *filter_date (time_t date);
@@ -1552,7 +1553,7 @@ static gboolean
 ml_selection_clear_event(GtkWidget *widget, GdkEventSelection *event, MessageList *ml)
 {
 	struct _MessageListPrivate *p = ml->priv;
-
+	
 	clear_selection(ml, &p->clipboard);
 
 	return TRUE;
@@ -2055,6 +2056,10 @@ message_list_construct (MessageList *mes
 		atk_object_set_name(a11y, _("Message List"));
 	}
 
+	g_signal_connect((message_list->tree), "cursor_change",
+			 G_CALLBACK (on_cursor_change_cmd),
+			 message_list);
+
 	g_signal_connect((message_list->tree), "cursor_activated",
 			 G_CALLBACK (on_cursor_activated_cmd),
 			 message_list);
@@ -2895,7 +2900,7 @@ on_cursor_activated_idle (gpointer data)
 	MessageList *message_list = data;
 	ESelectionModel *esm = e_tree_get_selection_model (message_list->tree);
 	int selected = e_selection_model_selected_count (esm);
-
+	
 	if (selected == 1 && message_list->cursor_uid) {
 		d(printf ("emitting cursor changed signal, for uid %s\n", message_list->cursor_uid));
 		g_signal_emit (message_list, message_list_signals[MESSAGE_SELECTED], 0, message_list->cursor_uid);
@@ -2905,6 +2910,24 @@ on_cursor_activated_idle (gpointer data)
 		
 	message_list->idle_id = 0;
 	return FALSE;
+}
+
+static void
+on_cursor_change_cmd (ETree *tree, int row, ETreePath path, gpointer user_data)
+{
+	MessageList *message_list = MESSAGE_LIST (user_data);
+	ESelectionModel *esm = e_tree_get_selection_model (message_list->tree);
+	int cur_selection = e_selection_model_selected_count (esm);
+	static int selected = 0;
+
+	/* cleanup the cursor_uid in message_list when we 
+	   un-select a message
+	 */
+	if (selected != cur_selection) {
+		g_free (message_list->cursor_uid);
+		message_list->cursor_uid = NULL;
+	}
+	selected = cur_selection;
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]