diff options
author | Jonny Lamb <jonnylamb@gnome.org> | 2010-12-08 20:42:36 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2010-12-08 20:42:36 +0800 |
commit | b2d04d8965c6fa63c6aa10a4c2197619f5234ef5 (patch) | |
tree | 3e6568b11db93949c7093f14229b35dad9f58d8b | |
parent | 5f2776557174cf952c465c9b13960238574c8481 (diff) | |
download | gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar.gz gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar.bz2 gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar.lz gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar.xz gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.tar.zst gsoc2013-empathy-b2d04d8965c6fa63c6aa10a4c2197619f5234ef5.zip |
account-widget: hook up the remember password toggle button
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
-rw-r--r-- | libempathy-gtk/empathy-account-widget.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index d96de2b34..5035ea7dd 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -1990,6 +1990,24 @@ add_register_buttons (EmpathyAccountWidget *self, #endif /* HAVE_MEEGO */ static void +remember_password_toggled_cb (GtkToggleButton *button, + EmpathyAccountWidget *self) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + + if (gtk_toggle_button_get_active (button)) + { + gtk_widget_set_sensitive (priv->param_password_widget, TRUE); + } + else + { + gtk_widget_set_sensitive (priv->param_password_widget, FALSE); + gtk_entry_set_text (GTK_ENTRY (priv->param_password_widget), ""); + empathy_account_settings_unset (priv->settings, "password"); + } +} + +static void do_constructed (GObject *obj) { EmpathyAccountWidget *self = EMPATHY_ACCOUNT_WIDGET (obj); @@ -2074,6 +2092,26 @@ do_constructed (GObject *obj) NULL); } + /* remember password */ + if (priv->param_password_widget != NULL) + { + GObject *button; + + button = gtk_builder_get_object ( + self->ui_details->gui, "remember_password"); + + if (button != NULL) + { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), + !EMP_STR_EMPTY (empathy_account_settings_get_string ( + priv->settings, "password"))); + + g_signal_connect (button, "toggled", + G_CALLBACK (remember_password_toggled_cb), self); + remember_password_toggled_cb (GTK_TOGGLE_BUTTON (button), self); + } + } + /* dup and init the account-manager */ priv->account_manager = tp_account_manager_dup (); |