From: Guillaume Desmottes Date: Wed, 24 Aug 2011 11:53:05 +0000 (+0200) Subject: account-widget-sip: add option to mark account as being able to call phones X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=96d638486a06118b91086f00d3a6b9d89eb8d445 account-widget-sip: add option to mark account as being able to call phones https://bugzilla.gnome.org/show_bug.cgi?id=657220 --- diff --git a/libempathy-gtk/empathy-account-widget-sip.c b/libempathy-gtk/empathy-account-widget-sip.c index 21eeec0c..405981b9 100644 --- a/libempathy-gtk/empathy-account-widget-sip.c +++ b/libempathy-gtk/empathy-account-widget-sip.c @@ -93,6 +93,21 @@ keep_alive_mechanism_combobox_change_cb (GtkWidget *widget, g_free (mechanism); } +static void +checkbutton_tel_toggled ( + GtkWidget *checkbox, + EmpathyAccountWidgetSip *sip_settings) +{ + EmpathyAccountSettings *settings; + + settings = empathy_account_widget_get_settings (sip_settings->self); + + empathy_account_settings_set_uri_scheme_tel (settings, + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))); + + empathy_account_widget_changed (sip_settings->self); +} + void empathy_account_widget_sip_build (EmpathyAccountWidget *self, const char *filename, @@ -123,6 +138,7 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self, GtkListStore *store; GtkTreeIter iter; GtkCellRenderer *renderer; + GtkToggleButton *checkbutton_tel; settings = g_slice_new0 (EmpathyAccountWidgetSip); settings->self = self; @@ -138,9 +154,14 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self, "checkbutton_discover-stun", &settings->checkbutton_discover_stun, "spinbutton_keepalive-interval", &settings->spinbutton_keepalive_interval, + "checkbutton_tel", &checkbutton_tel, NULL); settings->vbox_settings = vbox_settings; + gtk_toggle_button_set_active (checkbutton_tel, + empathy_account_settings_has_uri_scheme_tel ( + empathy_account_widget_get_settings (self))); + empathy_account_widget_handle_params (self, "entry_userid", "account", "entry_password", "password", @@ -164,6 +185,7 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self, "vbox_sip_settings", "destroy", account_widget_sip_destroy_cb, "checkbutton_discover-stun", "toggled", account_widget_sip_discover_stun_toggled_cb, + "checkbutton_tel", "toggled", checkbutton_tel_toggled, NULL); self->ui_details->default_focus = g_strdup ("entry_userid"); diff --git a/libempathy-gtk/empathy-account-widget-sip.ui b/libempathy-gtk/empathy-account-widget-sip.ui index 52bde8cc..488becaf 100644 --- a/libempathy-gtk/empathy-account-widget-sip.ui +++ b/libempathy-gtk/empathy-account-widget-sip.ui @@ -23,7 +23,7 @@ True False - 4 + 5 2 12 6 @@ -122,6 +122,23 @@ + + + Use this account to call _landlines and mobile phones + True + True + True + False + False + 0 + True + + + 2 + 4 + 5 + +