aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-account-widget-sip.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-17 02:00:02 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-23 23:06:37 +0800
commitdb4180342c107e1641ae528739409e4168ba7d91 (patch)
tree469f75701eab53bec1c4504edb4c32cf003bec25 /libempathy-gtk/empathy-account-widget-sip.c
parent8c92880ac4be339e9047cb03f981c7ec5de9cbfb (diff)
downloadgsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar.gz
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar.bz2
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar.lz
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar.xz
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.tar.zst
gsoc2013-empathy-db4180342c107e1641ae528739409e4168ba7d91.zip
unsensitive the keep-alive spin button if keep-alive is disabled
Diffstat (limited to 'libempathy-gtk/empathy-account-widget-sip.c')
-rw-r--r--libempathy-gtk/empathy-account-widget-sip.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-account-widget-sip.c b/libempathy-gtk/empathy-account-widget-sip.c
index fba053f33..71efa4f24 100644
--- a/libempathy-gtk/empathy-account-widget-sip.c
+++ b/libempathy-gtk/empathy-account-widget-sip.c
@@ -28,6 +28,7 @@
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
+#include <telepathy-glib/util.h>
#include <libempathy/empathy-utils.h>
#include "empathy-account-widget.h"
@@ -44,6 +45,7 @@ typedef struct {
GtkWidget *checkbutton_discover_stun;
GtkWidget *combobox_transport;
GtkWidget *combobox_keep_alive_mechanism;
+ GtkWidget *spinbutton_keepalive_interval;
} EmpathyAccountWidgetSip;
static void
@@ -65,6 +67,21 @@ account_widget_sip_discover_stun_toggled_cb (
gtk_widget_set_sensitive (settings->spinbutton_stun_part, !active);
}
+static void
+keep_alive_mechanism_combobox_change_cb (GtkWidget *widget,
+ EmpathyAccountWidgetSip *self)
+{
+ const gchar *mechanism;
+ gboolean enabled;
+
+ /* Unsensitive the keep-alive spin button if keep-alive is disabled */
+ mechanism = gtk_combo_box_get_active_text (GTK_COMBO_BOX (widget));
+
+ enabled = tp_strdiff (mechanism, "none");
+
+ gtk_widget_set_sensitive (self->spinbutton_keepalive_interval, enabled);
+}
+
void
empathy_account_widget_sip_build (EmpathyAccountWidget *self,
const char *filename,
@@ -102,6 +119,8 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self,
"entry_stun-server", &settings->entry_stun_server,
"spinbutton_stun-port", &settings->spinbutton_stun_part,
"checkbutton_discover-stun", &settings->checkbutton_discover_stun,
+ "spinbutton_keepalive-interval",
+ &settings->spinbutton_keepalive_interval,
NULL);
settings->vbox_settings = vbox_settings;
@@ -165,6 +184,9 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self,
gtk_combo_box_append_text (
GTK_COMBO_BOX (settings->combobox_keep_alive_mechanism), "none");
+ g_signal_connect (settings->combobox_keep_alive_mechanism, "changed",
+ G_CALLBACK (keep_alive_mechanism_combobox_change_cb), settings);
+
account_widget_setup_widget (self,
settings->combobox_keep_alive_mechanism, "keepalive-mechanism");