aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-08-04 21:21:46 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-08-22 21:17:38 +0800
commitf75d35f22aa745688f9fd932a5de6a6903b3db04 (patch)
tree0c9c5d267e10ac9f6c4093ac1cfecba2a7f3e08a
parent712f5f9f45105ce66f0f8d4fff40857924943ae8 (diff)
downloadgsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar.gz
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar.bz2
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar.lz
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar.xz
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.tar.zst
gsoc2013-empathy-f75d35f22aa745688f9fd932a5de6a6903b3db04.zip
Implement a simple SIP widget
-rw-r--r--libempathy-gtk/empathy-account-widget-sip.c81
1 files changed, 51 insertions, 30 deletions
diff --git a/libempathy-gtk/empathy-account-widget-sip.c b/libempathy-gtk/empathy-account-widget-sip.c
index fedbf2aa6..afc20fecb 100644
--- a/libempathy-gtk/empathy-account-widget-sip.c
+++ b/libempathy-gtk/empathy-account-widget-sip.c
@@ -68,37 +68,58 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self,
const char *filename)
{
EmpathyAccountWidgetSip *settings;
-
- settings = g_slice_new0 (EmpathyAccountWidgetSip);
- settings->self = self;
-
- self->ui_details->gui = empathy_builder_get_file (filename,
- "vbox_sip_settings", &settings->vbox_settings,
- "entry_stun-server", &settings->entry_stun_server,
- "spinbutton_stun-port", &settings->spinbutton_stun_part,
- "checkbutton_discover-stun", &settings->checkbutton_discover_stun,
- NULL);
-
- empathy_account_widget_handle_params (self,
- "entry_userid", "account",
- "entry_password", "password",
- "checkbutton_discover-stun", "discover-stun",
- "entry_stun-server", "stun-server",
- "spinbutton_stun-port", "stun-port",
- NULL);
-
- account_widget_sip_discover_stun_toggled_cb (
- settings->checkbutton_discover_stun,
- settings);
-
- empathy_builder_connect (self->ui_details->gui, settings,
- "vbox_sip_settings", "destroy", account_widget_sip_destroy_cb,
- "checkbutton_discover-stun", "toggled",
+ GtkWidget *vbox_settings;
+ gboolean is_simple;
+
+ g_object_get (self, "simple", &is_simple, NULL);
+
+ if (is_simple)
+ {
+ self->ui_details->gui = empathy_builder_get_file (filename,
+ "vbox_sip_simple", &vbox_settings,
+ NULL);
+
+ empathy_account_widget_handle_params (self,
+ "entry_userid_simple", "account",
+ "entry_password_simple", "password",
+ NULL);
+
+ self->ui_details->default_focus = g_strdup ("entry_userid_simple");
+ }
+ else
+ {
+ settings = g_slice_new0 (EmpathyAccountWidgetSip);
+ settings->self = self;
+
+ self->ui_details->gui = empathy_builder_get_file (filename,
+ "vbox_sip_settings", &vbox_settings,
+ "entry_stun-server", &settings->entry_stun_server,
+ "spinbutton_stun-port", &settings->spinbutton_stun_part,
+ "checkbutton_discover-stun", &settings->checkbutton_discover_stun,
+ NULL);
+ settings->vbox_settings = vbox_settings;
+
+ empathy_account_widget_handle_params (self,
+ "entry_userid", "account",
+ "entry_password", "password",
+ "checkbutton_discover-stun", "discover-stun",
+ "entry_stun-server", "stun-server",
+ "spinbutton_stun-port", "stun-port",
+ NULL);
+
+ account_widget_sip_discover_stun_toggled_cb (
+ settings->checkbutton_discover_stun,
+ settings);
+
+ empathy_builder_connect (self->ui_details->gui, settings,
+ "vbox_sip_settings", "destroy", account_widget_sip_destroy_cb,
+ "checkbutton_discover-stun", "toggled",
account_widget_sip_discover_stun_toggled_cb,
- NULL);
+ NULL);
- self->ui_details->add_forget = TRUE;
- self->ui_details->default_focus = g_strdup ("entry_userid");
+ self->ui_details->add_forget = TRUE;
+ self->ui_details->default_focus = g_strdup ("entry_userid");
+ }
- self->ui_details->widget = settings->vbox_settings;
+ self->ui_details->widget = vbox_settings;
}