aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget.c38
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 ();