changeset 12060:f7d2f637ff03

[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... committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 13 Nov 2005 00:05:44 +0000
parents 7bef0fa7d4aa
children 29dc8fc0dd6c
files src/gtkstatusbox.c
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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