pidgin: 8e5917b1: don't remember the message if we switch ...

khc at pidgin.im khc at pidgin.im
Tue Oct 27 04:01:30 EDT 2009


-----------------------------------------------------------------
Revision: 8e5917b1daee611a3587cb11727a37b8b0bc72a5
Ancestor: 7b278f6e26bb76d2f35c3ab5433f7bd06117b5ee
Author: khc at pidgin.im
Date: 2009-10-27T07:51:46
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8e5917b1daee611a3587cb11727a37b8b0bc72a5

Modified files:
        pidgin/gtkstatusbox.c

ChangeLog: 

don't remember the message if we switch to a saved status (transient
or not), because otherwise the old status message may show up several
status changes later, which is confusing.


-------------- next part --------------
============================================================
--- pidgin/gtkstatusbox.c	6cb59918353bc228d0dcb049a7992c07f3436af2
+++ pidgin/gtkstatusbox.c	941ac3af893463be7bfe18f5fbc5f4e90e616725
@@ -914,6 +914,21 @@ status_menu_refresh_iter(PidginStatusBox
 
 	if (status_changed) {
 		message = purple_savedstatus_get_message(saved_status);
+
+		/*
+		 * If we are going to hide the imhtml, don't retain the
+		 * message because showing the old message later is
+		 * confusing. If we are going to set the message to a pre-set,
+		 * then we need to do this anyway
+		 *
+		 * Suppress the "changed" signal because the status
+		 * was changed programmatically.
+		 */
+		gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), FALSE);
+
+		gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
+		gtk_imhtml_clear_formatting(GTK_IMHTML(status_box->imhtml));
+
 		if (!purple_savedstatus_is_transient(saved_status) || !message || !*message)
 		{
 			status_box->imhtml_visible = FALSE;
@@ -924,18 +939,10 @@ status_menu_refresh_iter(PidginStatusBox
 			status_box->imhtml_visible = TRUE;
 			gtk_widget_show_all(status_box->vbox);
 
-			/*
-			 * Suppress the "changed" signal because the status
-			 * was changed programmatically.
-			 */
-			gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), FALSE);
-
-			gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
-			gtk_imhtml_clear_formatting(GTK_IMHTML(status_box->imhtml));
 			gtk_imhtml_append_text(GTK_IMHTML(status_box->imhtml), message, 0);
-			gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), TRUE);
 		}
 
+		gtk_widget_set_sensitive(GTK_WIDGET(status_box->imhtml), TRUE);
 		update_size(status_box);
 	}
 


More information about the Commits mailing list