[gaim-migrate @ 14355]

Sun, 13 Nov 2005 00:05:44 +0000

author
Tim Ringenbach <marv@pidgin.im>
date
Sun, 13 Nov 2005 00:05:44 +0000
changeset 12060
02c6d16cb1ec
parent 12059
08e78c104c51
child 12061
ef756336217f

[gaim-migrate @ 14355]
sadrul writes:
This patch shows the last-used status-message for an
account in the account-specific statusbox.

It also hides the entry-box when there's no message in
it after the timeout. It'll be possible to bring it
back up by clicking on the statusbox with patch #1345942

Since I think 1345942 is still being debating, there's no way to get the
message box back after it disappears (except switching statuses). But this
is CVS, and there's another patch pending, so...

src/gtkstatusbox.c file | annotate | diff | comparison | revisions
--- a/src/gtkstatusbox.c	Sat Nov 12 23:11:23 2005 +0000
+++ b/src/gtkstatusbox.c	Sun Nov 13 00:05:44 2005 +0000
@@ -118,6 +118,7 @@
 	const GList *l;
 	int status_no = -1;
 	const GaimStatusType *statustype = NULL;
+	const char *message;
 
 	statustype = gaim_status_type_find_with_id((GList *)gaim_account_get_status_types(account),
 	                                           (char *)gaim_status_type_get_id(gaim_status_get_type(newstatus)));
@@ -136,9 +137,23 @@
 		gtk_widget_set_sensitive(GTK_WIDGET(status_box), FALSE);
 		gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), status_no);
 		gtk_gaim_status_box_refresh(status_box);
+
+		message = gaim_status_get_attr_string(newstatus, "message");
+
+		if (!message || !*message)
+		{
+			gtk_widget_hide_all(status_box->vbox);
+			status_box->imhtml_visible = FALSE;
+		}
+		else
+		{
+			gtk_widget_show_all(status_box->vbox);
+			status_box->imhtml_visible = TRUE;
+			gtk_imhtml_clear(GTK_IMHTML(status_box->imhtml));
+			gtk_imhtml_append_text(GTK_IMHTML(status_box->imhtml), message, 0);
+		}
 		gtk_widget_set_sensitive(GTK_WIDGET(status_box), TRUE);
 	}
-
 }
 
 static void

mercurial