# HG changeset patch # User Tim Ringenbach # Date 1131030601 0 # Node ID 082a2a9aa9980470764d7193dba4215641efd34e # Parent 6f8869d95c09f5c482defe5a3946b2576286414a [gaim-migrate @ 14251] commit what i was working on, as it shouldn't effect anything. I'll try to get this closer to finished tonight. Btw, what am I supposed to do with the return value of gaim_signal_connect()? None of the disconnect functions seem to take it. committer: Tailor Script diff -r 6f8869d95c09 -r 082a2a9aa998 src/gtkstatusbox.c --- a/src/gtkstatusbox.c Thu Nov 03 13:49:23 2005 +0000 +++ b/src/gtkstatusbox.c Thu Nov 03 15:10:01 2005 +0000 @@ -112,6 +112,12 @@ } static void +account_status_changed_cb(GaimAccount *account, GaimStatus *oldstatus, GaimStatus *newstatus, GtkGaimStatusBox* status_box) +{ + /*update_to_reflect_current_status(status_box);*/ +} + +static void gtk_gaim_status_box_set_property(GObject *object, guint param_id, const GValue *value, GParamSpec *pspec) { @@ -120,6 +126,14 @@ switch (param_id) { case PROP_ACCOUNT: statusbox->account = g_value_get_pointer(value); + + /* FIXME: call this in the destroy function too, if we had one */ + if (0 && statusbox->status_changed_signal) + ;/*gaim_signals_disconnect_by_handle(statusbox->status_changed_signal);*/ + 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; default: @@ -183,6 +197,7 @@ if (!title) title = ""; + if (status_box->error) { text = g_strdup_printf("%s\n%s", title, status_box->error); @@ -199,6 +214,13 @@ text = g_strdup_printf("%s", title); } + if (status_box->account) { + char *text2 = g_strdup_printf("%s\n%s", gaim_account_get_username(status_box->account), text); + g_free(text); + text = text2; + } + + if (status_box->connecting) pixbuf = status_box->connecting_pixbufs[status_box->connecting_index]; else if (status_box->error) @@ -390,6 +412,7 @@ gaim_status_type_get_name(status_type), NULL); } + gtk_combo_box_set_active(GTK_COMBO_BOX(status_box), 0); /* set something active to avoid blowing up */ } } @@ -739,7 +762,7 @@ GtkGaimStatusBoxItemType type; char *text, *sec_text; GdkPixbuf *pixbuf; - GList *accounts, *node; + GList *accounts = NULL, *node; status_box = GTK_GAIM_STATUS_BOX(box); @@ -781,9 +804,13 @@ /* * Show the message box whenever 'type' allows for a - * message attribute on any protocol that is enabled. + * message attribute on any protocol that is enabled, + * or our protocol, if we have account set */ - accounts = gaim_accounts_get_all_active(); + if (status_box->account) + accounts = g_list_prepend(accounts, status_box->account); + else + accounts = gaim_accounts_get_all_active(); status_box->imhtml_visible = FALSE; for (node = accounts; node != NULL; node = node->next) { diff -r 6f8869d95c09 -r 082a2a9aa998 src/gtkstatusbox.h --- a/src/gtkstatusbox.h Thu Nov 03 13:49:23 2005 +0000 +++ b/src/gtkstatusbox.h Thu Nov 03 15:10:01 2005 +0000 @@ -114,6 +114,8 @@ char *title; char *desc; char *error; + + gulong status_changed_signal; }; struct _GtkGaimStatusBoxClass