diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-03 00:33:49 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-03 20:43:57 +0800 |
commit | 8b15780d062dfb9263a173ff486fd767f6d47d2c (patch) | |
tree | f0d49135c02470d478fa57f4b16f2c28a59e7410 /libempathy-gtk/empathy-account-widget.c | |
parent | 51c871d17949a1366f09eb16e74aac0cae653086 (diff) | |
download | gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar.gz gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar.bz2 gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar.lz gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar.xz gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.tar.zst gsoc2013-empathy-8b15780d062dfb9263a173ff486fd767f6d47d2c.zip |
empathy-account-widget: update apply button when our state changes
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r-- | libempathy-gtk/empathy-account-widget.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 3fc556af8..af9fbb026 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -1147,6 +1147,26 @@ do_get_property (GObject *object, } } +static void +idle_state_change_cb (EmpathyIdle *idle, + GParamSpec *spec, + EmpathyAccountWidget *self) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + TpConnectionPresenceType state; + + state = empathy_idle_get_state (priv->idle); + + if (state > TP_CONNECTION_PRESENCE_TYPE_OFFLINE) + { + g_object_set (priv->apply_button, "label", GTK_STOCK_CONNECT, NULL); + } + else + { + g_object_set (priv->apply_button, "label", GTK_STOCK_APPLY, NULL); + } +} + #define WIDGET(cm, proto) \ { #cm, #proto, "empathy-account-widget-"#proto".ui", \ account_widget_build_##proto } @@ -1252,6 +1272,9 @@ do_constructed (GObject *obj) TpConnectionPresenceType state; priv->idle = empathy_idle_dup_singleton (); + empathy_signal_connect_weak (priv->idle, "notify::state", + G_CALLBACK (idle_state_change_cb), obj); + state = empathy_idle_get_state (priv->idle); if (state > TP_CONNECTION_PRESENCE_TYPE_OFFLINE) |