aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-03 00:33:49 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-03 20:43:57 +0800
commit8b15780d062dfb9263a173ff486fd767f6d47d2c (patch)
treef0d49135c02470d478fa57f4b16f2c28a59e7410
parent51c871d17949a1366f09eb16e74aac0cae653086 (diff)
downloadgsoc2013-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
-rw-r--r--libempathy-gtk/empathy-account-widget.c23
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)