aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-12-08 20:58:54 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-12-10 00:35:24 +0800
commitc98f95bcef9336d82d303fc10b4c60ff90270885 (patch)
tree0f5acb3bedb326e67a1b8b3bb51987b02eeac83b /libempathy-gtk
parent373bf0d7ca7373a45a71e46f161695cc951a7316 (diff)
downloadgsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar.gz
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar.bz2
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar.lz
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar.xz
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.tar.zst
gsoc2013-empathy-c98f95bcef9336d82d303fc10b4c60ff90270885.zip
account-widget: handle the remember password widget with the simple widget
Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget-yahoo.ui34
-rw-r--r--libempathy-gtk/empathy-account-widget.c36
2 files changed, 57 insertions, 13 deletions
diff --git a/libempathy-gtk/empathy-account-widget-yahoo.ui b/libempathy-gtk/empathy-account-widget-yahoo.ui
index acc60de74..16044f3c8 100644
--- a/libempathy-gtk/empathy-account-widget-yahoo.ui
+++ b/libempathy-gtk/empathy-account-widget-yahoo.ui
@@ -16,7 +16,7 @@
<child>
<object class="GtkTable" id="table_common_settings">
<property name="visible">True</property>
- <property name="n_rows">3</property>
+ <property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">12</property>
<property name="row_spacing">6</property>
@@ -92,6 +92,25 @@
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="remember_password">
+ <property name="label" translatable="yes">Remember Password</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<placeholder/>
</child>
</object>
@@ -357,5 +376,18 @@
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="remember_password_simple">
+ <property name="label" translatable="yes">Remember password</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
</interface>
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 5035ea7dd..27cb882bb 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -109,6 +109,8 @@ typedef struct {
GtkWidget *param_account_widget;
GtkWidget *param_password_widget;
+ GtkWidget *remember_password_widget;
+
/* Used only for IRC accounts */
EmpathyIrcNetworkChooser *irc_network_chooser;
@@ -1603,6 +1605,9 @@ account_widget_build_yahoo (EmpathyAccountWidget *self,
NULL);
self->ui_details->default_focus = g_strdup ("entry_id_simple");
+
+ priv->remember_password_widget = GTK_WIDGET (gtk_builder_get_object (
+ self->ui_details->gui, "remember_password_simple"));
}
else
{
@@ -1622,6 +1627,9 @@ account_widget_build_yahoo (EmpathyAccountWidget *self,
NULL);
self->ui_details->default_focus = g_strdup ("entry_id");
+
+ priv->remember_password_widget = GTK_WIDGET (gtk_builder_get_object (
+ self->ui_details->gui, "remember_password"));
}
}
@@ -2093,23 +2101,27 @@ do_constructed (GObject *obj)
}
/* remember password */
- if (priv->param_password_widget != NULL)
+ if (priv->param_password_widget != NULL
+ && priv->remember_password_widget != NULL)
{
- GObject *button;
-
- button = gtk_builder_get_object (
- self->ui_details->gui, "remember_password");
-
- if (button != NULL)
+ if (priv->simple)
{
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button),
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (priv->remember_password_widget), TRUE);
+ }
+ else
+ {
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (priv->remember_password_widget),
!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);
}
+
+ g_signal_connect (priv->remember_password_widget, "toggled",
+ G_CALLBACK (remember_password_toggled_cb), self);
+
+ remember_password_toggled_cb (
+ GTK_TOGGLE_BUTTON (priv->remember_password_widget), self);
}
/* dup and init the account-manager */