aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-30 17:05:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-07 21:06:06 +0800
commit521662e23476ddc9bc9c96917bb04a06ff4479cc (patch)
tree81d812a3254b6bfa68ee17381c5d3e667f9dee3c /libempathy-gtk/empathy-account-widget.c
parentc5a45a77bcc3fc39bb4814f46deb994e1b29ddb5 (diff)
downloadgsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar.gz
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar.bz2
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar.lz
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar.xz
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.tar.zst
gsoc2013-empathy-521662e23476ddc9bc9c96917bb04a06ff4479cc.zip
add services_infos containing infos regarding services
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r--libempathy-gtk/empathy-account-widget.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index e42fe78e9..5625f95dc 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -63,6 +63,19 @@ typedef enum
N_SERVICES
} Service;
+typedef struct
+{
+ const gchar *label_username_example;
+ gboolean show_advanced;
+} ServiceInfo;
+
+static ServiceInfo services_infos[N_SERVICES] = {
+ { "label_username_example", TRUE },
+ { "label_username_g_example", TRUE },
+ { "label_username_f_example", FALSE },
+ { "label_username_ovi_example", FALSE },
+};
+
typedef struct {
EmpathyAccountSettings *settings;
@@ -1357,8 +1370,8 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
GtkWidget *checkbutton_ssl;
GtkWidget *label_id, *label_password;
GtkWidget *label_id_create, *label_password_create;
- GtkWidget *label_example_gtalk, *label_example_jabber, *label_example_fb;
- GtkWidget *label_example_ovi;
+ GtkWidget *label_example_fb;
+ GtkWidget *label_example;
GtkWidget *expander_advanced;
GtkWidget *entry_id;
Service service;
@@ -1442,16 +1455,16 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
}
else
{
+ ServiceInfo info = services_infos[service];
+
/* Full widget for XMPP, Google Talk and Facebook*/
self->ui_details->gui = empathy_builder_get_file (filename,
"table_common_settings", &priv->table_common_settings,
"vbox_jabber_settings", &self->ui_details->widget,
"spinbutton_port", &spinbutton_port,
"checkbutton_ssl", &checkbutton_ssl,
- "label_username_example", &label_example_jabber,
- "label_username_g_example", &label_example_gtalk,
"label_username_f_example", &label_example_fb,
- "label_username_ovi_example", &label_example_ovi,
+ info.label_username_example, &label_example,
"expander_advanced", &expander_advanced,
"entry_id", &entry_id,
"label_id", &label_id,
@@ -1494,11 +1507,7 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
G_CALLBACK (account_widget_jabber_ssl_toggled_cb),
self);
- if (service == GTALK_SERVICE)
- {
- gtk_widget_show (label_example_gtalk);
- }
- else if (service == FACEBOOK_SERVICE)
+ if (service == FACEBOOK_SERVICE)
{
GtkContainer *parent;
GList *children;
@@ -1509,18 +1518,12 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
children = g_list_remove (children, label_example_fb);
gtk_container_set_focus_chain (parent, children);
g_list_free (children);
-
- gtk_widget_hide (expander_advanced);
- }
- else if (service == OVI_SERVICE)
- {
- gtk_widget_show (label_example_ovi);
- gtk_widget_hide (expander_advanced);
- }
- else
- {
- gtk_widget_show (label_example_jabber);
}
+
+ gtk_widget_show (label_example);
+
+ if (!info.show_advanced)
+ gtk_widget_hide (expander_advanced);
}
}