[empathy] account-widget-sip: add UI to configure the keepalive-mechanism and keepalive-interval params



commit 8c92880ac4be339e9047cb03f981c7ec5de9cbfb
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Nov 16 17:51:42 2009 +0000

    account-widget-sip: add UI to configure the keepalive-mechanism and keepalive-interval params

 libempathy-gtk/empathy-account-widget-sip.c  |   22 ++++++++++++
 libempathy-gtk/empathy-account-widget-sip.ui |   46 +++++++++++++++++++++++++-
 2 files changed, 67 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-account-widget-sip.c b/libempathy-gtk/empathy-account-widget-sip.c
index 3a50ced..fba053f 100644
--- a/libempathy-gtk/empathy-account-widget-sip.c
+++ b/libempathy-gtk/empathy-account-widget-sip.c
@@ -43,6 +43,7 @@ typedef struct {
   GtkWidget *spinbutton_stun_part;
   GtkWidget *checkbutton_discover_stun;
   GtkWidget *combobox_transport;
+  GtkWidget *combobox_keep_alive_mechanism;
 } EmpathyAccountWidgetSip;
 
 static void
@@ -115,6 +116,7 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self,
           "spinbutton_port", "port",
           "checkbutton_loose-routing", "loose-routing",
           "checkbutton_discover-binding", "discover-binding",
+          "spinbutton_keepalive-interval", "keepalive-interval",
           NULL);
 
       account_widget_sip_discover_stun_toggled_cb (
@@ -150,6 +152,26 @@ empathy_account_widget_sip_build (EmpathyAccountWidget *self,
           settings->combobox_transport, 1, 2, 6, 7);
 
       gtk_widget_show (settings->combobox_transport);
+
+      /* Create the 'keep-alive mechanism' combo box */
+      settings->combobox_keep_alive_mechanism = gtk_combo_box_new_text ();
+
+      gtk_combo_box_append_text (
+          GTK_COMBO_BOX (settings->combobox_keep_alive_mechanism), "auto");
+      gtk_combo_box_append_text (
+          GTK_COMBO_BOX (settings->combobox_keep_alive_mechanism), "register");
+      gtk_combo_box_append_text (
+          GTK_COMBO_BOX (settings->combobox_keep_alive_mechanism), "options");
+      gtk_combo_box_append_text (
+          GTK_COMBO_BOX (settings->combobox_keep_alive_mechanism), "none");
+
+      account_widget_setup_widget (self,
+          settings->combobox_keep_alive_mechanism, "keepalive-mechanism");
+
+      gtk_table_attach_defaults (GTK_TABLE (table_advanced),
+          settings->combobox_keep_alive_mechanism, 1, 2, 9, 10);
+
+      gtk_widget_show (settings->combobox_keep_alive_mechanism);
     }
 
   self->ui_details->widget = vbox_settings;
diff --git a/libempathy-gtk/empathy-account-widget-sip.ui b/libempathy-gtk/empathy-account-widget-sip.ui
index 6471d9c..1bfeafe 100644
--- a/libempathy-gtk/empathy-account-widget-sip.ui
+++ b/libempathy-gtk/empathy-account-widget-sip.ui
@@ -134,7 +134,7 @@
             <child>
               <object class="GtkTable" id="table_advanced_sip_settings">
                 <property name="visible">True</property>
-                <property name="n_rows">9</property>
+                <property name="n_rows">11</property>
                 <property name="n_columns">2</property>
                 <property name="column_spacing">6</property>
                 <property name="row_spacing">6</property>
@@ -329,8 +329,47 @@ username.</property>
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkLabel" id="label_keepalive-mechanism">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Keep-alive Mechanism:</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">9</property>
+                    <property name="bottom_attach">10</property>
+                  </packing>
+                </child>
+                <child>
                   <placeholder/>
                 </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="label_keepalive-interval">
+                    <property name="visible">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Keep-alive Interval (seconds)</property>
+                  </object>
+                  <packing>
+                    <property name="top_attach">10</property>
+                    <property name="bottom_attach">11</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkSpinButton" id="spinbutton_keepalive-interval">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="invisible_char">&#x2022;</property>
+                    <property name="adjustment">adjustment3</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">10</property>
+                    <property name="bottom_attach">11</property>
+                  </packing>
+                </child>
               </object>
             </child>
           </object>
@@ -445,4 +484,9 @@ username.</property>
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
+  <object class="GtkAdjustment" id="adjustment3">
+    <property name="upper">10000</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
 </interface>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]