diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-16 00:13:24 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-18 19:01:06 +0800 |
commit | f82cf307e75f0446b4e590b0036a179b64862939 (patch) | |
tree | 7b790fcf6f958eccf7b7f17d0462247f3c170be6 /libempathy-gtk | |
parent | 3d2438bfc48b2858c2800feb9ca96fda3634a089 (diff) | |
download | gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar.gz gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar.bz2 gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar.lz gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar.xz gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.tar.zst gsoc2013-empathy-f82cf307e75f0446b4e590b0036a179b64862939.zip |
account-widget: add empathy_account_widget_set_{account,password}_param
This will be used to restore the account and password params when switching
widgets.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-account-widget.c | 32 | ||||
-rw-r--r-- | libempathy-gtk/empathy-account-widget.h | 6 |
2 files changed, 38 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 99af21322..52efbce01 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -81,6 +81,9 @@ typedef struct { TpAccountManager *account_manager; + GtkWidget *param_account_widget; + GtkWidget *param_password_widget; + gboolean dispose_run; } EmpathyAccountWidgetPriv; @@ -397,6 +400,11 @@ empathy_account_widget_setup_widget (EmpathyAccountWidget *self, str = empathy_account_settings_get_string (priv->settings, param_name); gtk_entry_set_text (GTK_ENTRY (widget), str ? str : ""); + if (!tp_strdiff (param_name, "account")) + priv->param_account_widget = widget; + else if (!tp_strdiff (param_name, "password")) + priv->param_password_widget = widget; + if (strstr (param_name, "password")) { gtk_entry_set_visibility (GTK_ENTRY (widget), FALSE); @@ -1872,3 +1880,27 @@ empathy_account_widget_changed (EmpathyAccountWidget *self) account_widget_handle_control_buttons_sensitivity (self); priv->contains_pending_changes = TRUE; } + +void +empathy_account_widget_set_account_param (EmpathyAccountWidget *self, + const gchar *account) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + + if (priv->param_account_widget == NULL) + return; + + gtk_entry_set_text (GTK_ENTRY (priv->param_account_widget), account); +} + +void +empathy_account_widget_set_password_param (EmpathyAccountWidget *self, + const gchar *account) +{ + EmpathyAccountWidgetPriv *priv = GET_PRIV (self); + + if (priv->param_password_widget == NULL) + return; + + gtk_entry_set_text (GTK_ENTRY (priv->param_password_widget), account); +} diff --git a/libempathy-gtk/empathy-account-widget.h b/libempathy-gtk/empathy-account-widget.h index 5b994c277..9ed989434 100644 --- a/libempathy-gtk/empathy-account-widget.h +++ b/libempathy-gtk/empathy-account-widget.h @@ -73,6 +73,12 @@ void empathy_account_widget_discard_pending_changes gchar * empathy_account_widget_get_default_display_name ( EmpathyAccountWidget *widget); +void empathy_account_widget_set_account_param (EmpathyAccountWidget *widget, + const gchar *account); + +void empathy_account_widget_set_password_param (EmpathyAccountWidget *self, + const gchar *password); + /* protected methods */ void empathy_account_widget_changed (EmpathyAccountWidget *widget); |