From: <sa...@us...> - 2006-09-10 00:18:04
|
Revision: 17212 http://svn.sourceforge.net/gaim/?rev=17212&view=rev Author: sadrul Date: 2006-09-09 17:17:44 -0700 (Sat, 09 Sep 2006) Log Message: ----------- Update the statuslist with appropriate list of stauses in the buddylist when global status is changed. Modified Paths: -------------- trunk/console/gntblist.c trunk/console/libgnt/gntcombobox.c trunk/console/libgnt/gntcombobox.h trunk/console/libgnt/gntmain.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-09-09 21:58:04 UTC (rev 17211) +++ trunk/console/gntblist.c 2006-09-10 00:17:44 UTC (rev 17212) @@ -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(), Modified: trunk/console/libgnt/gntcombobox.c =================================================================== --- trunk/console/libgnt/gntcombobox.c 2006-09-09 21:58:04 UTC (rev 17211) +++ trunk/console/libgnt/gntcombobox.c 2006-09-10 00:17:44 UTC (rev 17212) @@ -287,3 +287,16 @@ set_selection(box, key); } +void gnt_combo_box_remove(GntComboBox *box, gpointer key) +{ + gnt_tree_remove(GNT_TREE(box->dropdown), key); + if (box->selected == key) + set_selection(box, NULL); +} + +void gnt_combo_box_remove_all(GntComboBox *box) +{ + gnt_tree_remove_all(GNT_TREE(box->dropdown)); + set_selection(box, NULL); +} + Modified: trunk/console/libgnt/gntcombobox.h =================================================================== --- trunk/console/libgnt/gntcombobox.h 2006-09-09 21:58:04 UTC (rev 17211) +++ trunk/console/libgnt/gntcombobox.h 2006-09-10 00:17:44 UTC (rev 17212) @@ -48,6 +48,10 @@ void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text); +void gnt_combo_box_remove(GntComboBox *box, gpointer key); + +void gnt_combo_box_remove_all(GntComboBox *box); + gpointer gnt_combo_box_get_selected_data(GntComboBox *box); void gnt_combo_box_set_selected(GntComboBox *box, gpointer key); Modified: trunk/console/libgnt/gntmain.c =================================================================== --- trunk/console/libgnt/gntmain.c 2006-09-09 21:58:04 UTC (rev 17211) +++ trunk/console/libgnt/gntmain.c 2006-09-10 00:17:44 UTC (rev 17212) @@ -577,8 +577,6 @@ x -= 33; y -= 33; - /* It might be a better idea to use panel_below. That would allow mouse-clicks - * to be operated on transient windows, which would be cool.*/ while ((p = panel_below(p)) != NULL) { const GntNode *node = panel_userptr(p); GntWidget *wid; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |