From: <dat...@us...> - 2006-10-17 19:01:52
|
Revision: 17499 http://svn.sourceforge.net/gaim/?rev=17499&view=rev Author: datallah Date: 2006-10-17 12:01:38 -0700 (Tue, 17 Oct 2006) Log Message: ----------- Attach to the "account-status-changed" signal so that we can notice primitive status changes on the token account. This is based on stuff from Richard Nelson and and rewster. Modified Paths: -------------- trunk/gtk/gtkstatusbox.c trunk/gtk/gtkstatusbox.h Modified: trunk/gtk/gtkstatusbox.c =================================================================== --- trunk/gtk/gtkstatusbox.c 2006-10-17 14:30:58 UTC (rev 17498) +++ trunk/gtk/gtkstatusbox.c 2006-10-17 19:01:38 UTC (rev 17499) @@ -71,6 +71,7 @@ static void gtk_gaim_status_box_pulse_typing(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_refresh(GtkGaimStatusBox *status_box); +static void status_menu_refresh_iter(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_regenerate(GtkGaimStatusBox *status_box); static void gtk_gaim_status_box_changed(GtkComboBox *box); static void gtk_gaim_status_box_size_request (GtkWidget *widget, GtkRequisition *requisition); @@ -225,6 +226,11 @@ { if (status_box->account == account) update_to_reflect_account_status(status_box, account, newstatus); + else if (status_box->token_status_account == account) + { + gtk_gaim_status_box_refresh(status_box); + status_menu_refresh_iter(status_box); + } } static gboolean @@ -388,17 +394,6 @@ case PROP_ACCOUNT: statusbox->account = g_value_get_pointer(value); - if (statusbox->status_changed_signal) { - gaim_signal_disconnect(gaim_accounts_get_handle(), "account-status-changed", - statusbox, GAIM_CALLBACK(account_status_changed_cb)); - statusbox->status_changed_signal = 0; - } - - if (statusbox->account) { - statusbox->status_changed_signal = gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", - statusbox, GAIM_CALLBACK(account_status_changed_cb), - statusbox); - } gtk_gaim_status_box_regenerate(statusbox); break; @@ -413,11 +408,6 @@ { GtkGaimStatusBox *statusbox = GTK_GAIM_STATUS_BOX(obj); - if (statusbox->status_changed_signal) { - gaim_signal_disconnect(gaim_accounts_get_handle(), "account-status-changed", - statusbox, GAIM_CALLBACK(account_status_changed_cb)); - statusbox->status_changed_signal = 0; - } gaim_signals_disconnect_by_handle(statusbox); gaim_prefs_disconnect_by_handle(statusbox); @@ -1359,6 +1349,10 @@ gaim_signal_connect(gaim_accounts_get_handle(), "account-disabled", status_box, GAIM_CALLBACK(account_enabled_cb), status_box); + gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", status_box, + GAIM_CALLBACK(account_status_changed_cb), + status_box); + gaim_prefs_connect_callback(status_box, "/gaim/gtk/blist/show_buddy_icons", buddy_list_details_pref_changed_cb, status_box); gaim_prefs_connect_callback(status_box, "/gaim/gtk/conversations/spellcheck", Modified: trunk/gtk/gtkstatusbox.h =================================================================== --- trunk/gtk/gtkstatusbox.h 2006-10-17 14:30:58 UTC (rev 17498) +++ trunk/gtk/gtkstatusbox.h 2006-10-17 19:01:38 UTC (rev 17499) @@ -117,8 +117,6 @@ GtkTreeIter iter; char *error; - gulong status_changed_signal; - /* * These widgets are made for renderin' * That's just what they'll do This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |