aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-09-22 22:51:05 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-07 21:06:06 +0800
commit7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685 (patch)
tree7bfae194495bc77e6c102788cc1dd2d665322d0c /libempathy-gtk/empathy-account-widget.c
parentd25db434c8871b871fb007c2e41a0da834587974 (diff)
downloadgsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar.gz
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar.bz2
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar.lz
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar.xz
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.tar.zst
gsoc2013-empathy-7fa0c3b106c5d5d35cb86a75da047b8c7c5e2685.zip
add account widget for Ovi
Diffstat (limited to 'libempathy-gtk/empathy-account-widget.c')
-rw-r--r--libempathy-gtk/empathy-account-widget.c47
1 files changed, 44 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c
index 9a2b2c856..c14ca59a7 100644
--- a/libempathy-gtk/empathy-account-widget.c
+++ b/libempathy-gtk/empathy-account-widget.c
@@ -1260,6 +1260,15 @@ account_widget_is_facebook (EmpathyAccountWidget *self)
"im-facebook");
}
+static gboolean
+account_widget_is_ovi (EmpathyAccountWidget *self)
+{
+ EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+
+ return !tp_strdiff (empathy_account_settings_get_service (priv->settings),
+ "ovi-chat");
+}
+
static void
suffix_id_widget_changed_cb (GtkWidget *entry,
EmpathyAccountWidget *self)
@@ -1342,17 +1351,19 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
GtkWidget *label_id, *label_password;
GtkWidget *label_id_create, *label_password_create;
GtkWidget *label_example_gtalk, *label_example_jabber, *label_example_fb;
- gboolean is_gtalk, is_facebook;
+ GtkWidget *label_example_ovi;
+ gboolean is_gtalk, is_facebook, is_ovi;
GtkWidget *expander_advanced;
GtkWidget *entry_id;
is_gtalk = account_widget_is_gtalk (self);
is_facebook = account_widget_is_facebook (self);
+ is_ovi = account_widget_is_ovi (self);
empathy_account_settings_set_regex (priv->settings, "account",
ACCOUNT_REGEX_JABBER);
- if (priv->simple && !is_gtalk && !is_facebook)
+ if (priv->simple && !is_gtalk && !is_facebook && !is_ovi)
{
/* Simple widget for XMPP */
self->ui_details->gui = empathy_builder_get_file (filename,
@@ -1408,6 +1419,22 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
self->ui_details->default_focus = g_strdup ("entry_id_fb_simple");
}
+ else if (priv->simple && is_ovi)
+ {
+ /* Simple widget for Ovi */
+ self->ui_details->gui = empathy_builder_get_file (filename,
+ "vbox_ovi_simple", &self->ui_details->widget,
+ "entry_id_ovi_simple", &entry_id,
+ NULL);
+
+ empathy_account_widget_handle_params (self,
+ "entry_password_ovi_simple", "password",
+ NULL);
+
+ setup_id_widget_with_suffix (self, entry_id, "@ovi.com");
+
+ self->ui_details->default_focus = g_strdup ("entry_id_ovi_simple");
+ }
else
{
/* Full widget for XMPP, Google Talk and Facebook*/
@@ -1419,6 +1446,7 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
"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,
"expander_advanced", &expander_advanced,
"entry_id", &entry_id,
"label_id", &label_id,
@@ -1443,6 +1471,12 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
* "@chat.facebook.com" part */
setup_id_widget_with_suffix (self, entry_id, "@chat.facebook.com");
}
+ else if (is_ovi)
+ {
+ gtk_label_set_label (GTK_LABEL (label_id), _("Username:"));
+
+ setup_id_widget_with_suffix (self, entry_id, "@ovi.com");
+ }
else
{
empathy_account_widget_setup_widget (self, entry_id, "account");
@@ -1477,6 +1511,12 @@ account_widget_build_jabber (EmpathyAccountWidget *self,
gtk_widget_show (label_example_fb);
gtk_widget_hide (expander_advanced);
}
+ else if (is_ovi)
+ {
+ gtk_widget_hide (label_example_jabber);
+ gtk_widget_show (label_example_ovi);
+ gtk_widget_hide (expander_advanced);
+ }
}
}
@@ -1948,7 +1988,8 @@ add_register_buttons (EmpathyAccountWidget *self,
if (!tp_connection_manager_protocol_can_register (protocol))
return;
- if (account_widget_is_gtalk (self) || account_widget_is_facebook (self))
+ if (account_widget_is_gtalk (self) || account_widget_is_facebook (self) ||
+ account_widget_is_ovi (self))
return;
if (priv->simple)