From 9d8e0c6767a613f25030f7c8898a8e7a678e0664 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 25 Mar 2008 08:53:59 +0000 Subject: Add a widget to configure SIP accounts. Fixes bug #513679 (Baptiste Mille-Mathias). svn path=/trunk/; revision=823 --- libempathy-gtk/Makefile.am | 1 + libempathy-gtk/empathy-account-widget-sip.glade | 506 ++++++++++++++++++++++++ libempathy-gtk/empathy-account-widget.c | 49 +++ libempathy-gtk/empathy-account-widget.h | 1 + libempathy-gtk/empathy-accounts-dialog.c | 4 + 5 files changed, 561 insertions(+) create mode 100644 libempathy-gtk/empathy-account-widget-sip.glade diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am index d29a11f6b..1b9a24500 100644 --- a/libempathy-gtk/Makefile.am +++ b/libempathy-gtk/Makefile.am @@ -110,6 +110,7 @@ glade_DATA = \ empathy-account-widget-generic.glade \ empathy-account-widget-jabber.glade \ empathy-account-widget-msn.glade \ + empathy-account-widget-sip.glade \ empathy-account-widget-salut.glade \ empathy-account-widget-irc.glade \ empathy-account-widget-icq.glade \ diff --git a/libempathy-gtk/empathy-account-widget-sip.glade b/libempathy-gtk/empathy-account-widget-sip.glade new file mode 100644 index 000000000..9acb2b4ad --- /dev/null +++ b/libempathy-gtk/empathy-account-widget-sip.glade @@ -0,0 +1,506 @@ + + + + + + False + + + True + + + True + 3 + 2 + 12 + 6 + + + True + True + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + _Registar: + True + entry_registar + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Pass_word: + True + entry_password + + + 1 + 2 + GTK_FILL + + + + + + True + True + + + 1 + 2 + + + + + + True + 0 + _Username: + True + entry_password + + + GTK_FILL + + + + + + True + + + True + True + + + + + True + True + Forget password and clear the entry. + 0 + + + True + gtk-clear + 1 + + + + + False + 1 + + + + + 1 + 2 + 1 + 2 + + + + + + False + False + + + + + True + True + + + True + 0 + 12 + + + True + 14 + 2 + 6 + 6 + + + True + True + 0 0 65536 1 10 10 + 1 + + + 1 + 2 + 1 + 2 + + + + + True + True + + + 1 + 2 + 9 + 10 + + + + + True + True + + + 1 + 2 + 7 + 8 + + + + + True + True + + + 1 + 2 + 5 + 6 + + + + + True + True + + + 1 + 2 + 4 + 5 + + + + + True + True + + + 1 + 2 + 2 + 3 + + + + + True + True + + + 1 + 2 + + + + + True + 0 + Local IP Address: + entry_local-ip + + + 9 + 10 + GTK_FILL + + + + + + True + 0 + Stun port: + spinbutton_stun-port + + + 8 + 9 + GTK_FILL + + + + + + True + 0 + Stun Server: + entry_stun-server + + + 7 + 8 + GTK_FILL + + + + + + True + 0 + Keepalive Interval: + entry_keepalive-interval + + + 5 + 6 + GTK_FILL + + + + + + True + 0 + Keepalive Mechanism: + entry_keepalive-mechanism + + + 4 + 5 + GTK_FILL + + + + + + True + 0 + Transport: + entry_transport + + + 2 + 3 + GTK_FILL + + + + + + True + 0 + Port: + spinbutton_stun-port + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Proxy Server: + entry_proxy + + + GTK_FILL + + + + + + True + True + 0 0 65536 1 10 10 + 1 + + + 1 + 2 + 8 + 9 + + + + + True + True + Discover Binding + True + 0 + True + + + 2 + 3 + 4 + GTK_FILL + + + + + + True + True + Discover Stun + True + 0 + True + + + 2 + 6 + 7 + GTK_FILL + + + + + + True + 0 + Local Port: + spinbutton_local-port + + + 10 + 11 + GTK_FILL + + + + + + True + 0 + Extra Auth User: + entry_extra-auth-user + + + 11 + 12 + GTK_FILL + + + + + + True + 0 + Extra Auth Password: + entry_extra-auth-password + + + 12 + 13 + GTK_FILL + + + + + + True + True + Avoid Difficult + True + 0 + True + + + 2 + 13 + 14 + GTK_FILL + + + + + + True + True + 0 0 65536 1 10 10 + 1 + + + 1 + 2 + 10 + 11 + + + + + True + True + + + 1 + 2 + 12 + 13 + + + + + True + True + + + 1 + 2 + 11 + 12 + + + + + + + + + True + <b>Advanced</b> + True + + + label_item + + + + + False + False + 1 + + + + + + diff --git a/libempathy-gtk/empathy-account-widget.c b/libempathy-gtk/empathy-account-widget.c index 1519a2f5a..a22949235 100644 --- a/libempathy-gtk/empathy-account-widget.c +++ b/libempathy-gtk/empathy-account-widget.c @@ -537,6 +537,55 @@ empathy_account_widget_msn_new (McAccount *account) return widget; } +GtkWidget * +empathy_account_widget_sip_new (McAccount *account) +{ + GladeXML *glade; + GtkWidget *widget; + gchar *filename; + + filename = empathy_file_lookup ("empathy-account-widget-sip.glade", + "libempathy-gtk"); + + glade = empathy_glade_get_file (filename, + "vbox_sip_settings", + NULL, + "vbox_sip_settings", &widget, + NULL); + + g_free (filename); + + empathy_account_widget_handle_params (account, glade, + "entry_userid", "account", + "entry_password", "password", + "entry_registar", "registar", + "entry_proxy","proxy-host", + "spinbutton_port", "port", + "entry_transport", "transport", + "checkbutton_discover-binding","discover-binding", + "entry_keepalive-mechanism", "keepalive-mechanism", + "entry_keepalive-interval", "keepalive-interval", + "checkbutton_discover-stun", "discover-stun", + "entry_stun-server", "stun-server", + "spinbutton_stun-port", "stun-port", + "entry_local-ip", "local-ip-address", + "spinbutton_local-port", "local-port", + "entry_extra-auth-user", "extra-auth-user", + "entry_extra-auth-password", "extra-auth-password", + "checkbutton_avoid-difficult", "avoid-difficult", + NULL); + + empathy_account_widget_add_forget_button (account, glade, + "button_forget", + "entry_password"); + + g_object_unref (glade); + + gtk_widget_show (widget); + + return widget; +} + GtkWidget * empathy_account_widget_jabber_new (McAccount *account) { diff --git a/libempathy-gtk/empathy-account-widget.h b/libempathy-gtk/empathy-account-widget.h index 2e4344c06..b7ebb6742 100644 --- a/libempathy-gtk/empathy-account-widget.h +++ b/libempathy-gtk/empathy-account-widget.h @@ -46,6 +46,7 @@ GtkWidget *empathy_account_widget_msn_new (McAccount *account); GtkWidget *empathy_account_widget_jabber_new (McAccount *account); GtkWidget *empathy_account_widget_icq_new (McAccount *account); GtkWidget *empathy_account_widget_yahoo_new (McAccount *account); +GtkWidget *empathy_account_widget_sip_new (McAccount *account); G_END_DECLS diff --git a/libempathy-gtk/empathy-accounts-dialog.c b/libempathy-gtk/empathy-accounts-dialog.c index dc2c13622..75b3c5472 100644 --- a/libempathy-gtk/empathy-accounts-dialog.c +++ b/libempathy-gtk/empathy-accounts-dialog.c @@ -281,6 +281,10 @@ accounts_dialog_update_account (EmpathyAccountsDialog *dialog, dialog->settings_widget = empathy_account_widget_yahoo_new (account); } + else if (!tp_strdiff (config_ui, "sofiasip")) { + dialog->settings_widget = + empathy_account_widget_sip_new (account); + } else { dialog->settings_widget = empathy_account_widget_generic_new (account); -- cgit v1.2.3