diff console/gntblist.c @ 14493:5ac8f22e7b08

[gaim-migrate @ 17212] Update the statuslist with appropriate list of stauses in the buddylist when global status is changed. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 10 Sep 2006 00:17:44 +0000
parents ca36763497d9
children 81650a27f253
line wrap: on
line diff
--- a/console/gntblist.c	Sat Sep 09 21:58:04 2006 +0000
+++ b/console/gntblist.c	Sun Sep 10 00:17:44 2006 +0000
@@ -1317,6 +1317,8 @@
 	GaimStatusPrimitive prims[] = {GAIM_STATUS_AVAILABLE, GAIM_STATUS_AWAY,
 			GAIM_STATUS_INVISIBLE, GAIM_STATUS_OFFLINE, GAIM_STATUS_UNSET};
 
+	gnt_combo_box_remove_all(GNT_COMBO_BOX(ggblist->status));
+
 	for (i = 0; prims[i] != GAIM_STATUS_UNSET; i++)
 	{
 		item = g_new0(StatusBoxItem, 1);
@@ -1492,7 +1494,6 @@
 static void
 savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old)
 {
-	/* Block the signals we don't want to emit */
 	GList *list;
 	GaimStatusPrimitive prim;
 	const char *message;
@@ -1500,6 +1501,7 @@
 	if (!ggblist)
 		return;
 
+	/* Block the signals we don't want to emit */
 	g_signal_handlers_block_matched(ggblist->status, G_SIGNAL_MATCH_FUNC,
 			0, 0, NULL, status_selection_changed, NULL);
 	g_signal_handlers_block_matched(ggblist->statustext, G_SIGNAL_MATCH_FUNC,
@@ -1508,6 +1510,9 @@
 	prim = gaim_savedstatus_get_type(now);
 	message = gaim_savedstatus_get_message(now);
 
+	/* Rebuild the status dropdown */
+	populate_status_dropdown();
+
 	list = g_object_get_data(G_OBJECT(ggblist->status), "list of statuses");
 	for (; list; list = list->next)
 	{
@@ -1610,8 +1615,6 @@
 	ggblist->statustext = gnt_entry_new(NULL);
 	gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->statustext);
 
-	populate_status_dropdown();
-
 	gnt_widget_show(ggblist->window);
 
 	gaim_signal_connect(gaim_blist_get_handle(), "buddy-status-changed", gg_blist_get_handle(),