ekiga r7481 - in trunk: . lib/engine/components/opal src/gui



Author: dsandras
Date: Sun Dec 28 19:06:22 2008
New Revision: 7481
URL: http://svn.gnome.org/viewvc/ekiga?rev=7481&view=rev

Log:
Fixed #562347: It is now possible to disable STUN in the preferences.


Modified:
   trunk/ChangeLog
   trunk/ekiga.schemas.in.in
   trunk/lib/engine/components/opal/opal-call-manager.cpp
   trunk/lib/engine/components/opal/opal-call-manager.h
   trunk/lib/engine/components/opal/opal-gmconf-bridge.cpp
   trunk/lib/engine/components/opal/opal-main.cpp
   trunk/src/gui/main.cpp
   trunk/src/gui/preferences.cpp

Modified: trunk/ekiga.schemas.in.in
==============================================================================
--- trunk/ekiga.schemas.in.in	(original)
+++ trunk/ekiga.schemas.in.in	Sun Dec 28 19:06:22 2008
@@ -510,6 +510,17 @@
       </locale>
     </schema>
     <schema>
+      <key>/schemas/apps/@PACKAGE_NAME@/nat/disable_stun</key>
+      <applyto>/apps/@PACKAGE_NAME@/nat/disable_stun</applyto>
+      <owner>Ekiga</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+	<short>Disable STUN network detection</short>
+	<long>Disable the automatic network setup resulting from the STUN test</long>
+      </locale>
+    </schema>
+    <schema>
       <key>/schemas/apps/@PACKAGE_NAME@/protocols/sip/binding_timeout</key>
       <applyto>/apps/@PACKAGE_NAME@/protocols/sip/binding_timeout</applyto>
       <owner>Ekiga</owner>

Modified: trunk/lib/engine/components/opal/opal-call-manager.cpp
==============================================================================
--- trunk/lib/engine/components/opal/opal-call-manager.cpp	(original)
+++ trunk/lib/engine/components/opal/opal-call-manager.cpp	Sun Dec 28 19:06:22 2008
@@ -116,6 +116,7 @@
   forward_on_no_answer = false;
   forward_on_busy = false;
   unconditional_forward = false;
+  stun_enabled = false;
 
   // Create video devices
   PVideoDevice::OpenArgs video = GetVideoOutputDevice();
@@ -168,11 +169,15 @@
 
 void CallManager::start ()
 {
-  // Ready
-  new StunDetector (stun_server, *this, queue);
-
-  patience = 20;
-  runtime->run_in_main (sigc::mem_fun (this, &CallManager::HandleSTUNResult), 1);
+  if (stun_enabled) {
+    
+    // Ready
+    new StunDetector (stun_server, *this, queue);
+    patience = 20;
+    runtime->run_in_main (sigc::mem_fun (this, &CallManager::HandleSTUNResult), 1);
+  }
+  else
+    ready.emit ();
 }
 
 
@@ -492,7 +497,12 @@
 void CallManager::set_stun_server (const std::string & server)
 {
   stun_server = server;
-  start ();
+}
+
+
+void CallManager::set_stun_enabled (bool enabled)
+{
+  stun_enabled = enabled;
 }
 
 

Modified: trunk/lib/engine/components/opal/opal-call-manager.h
==============================================================================
--- trunk/lib/engine/components/opal/opal-call-manager.h	(original)
+++ trunk/lib/engine/components/opal/opal-call-manager.h	Sun Dec 28 19:06:22 2008
@@ -133,6 +133,7 @@
                         unsigned & max_port) const;
 
     void set_stun_server (const std::string & server);
+    void set_stun_enabled (bool);
 
     /**/
     struct VideoOptions 
@@ -191,6 +192,7 @@
     bool forward_on_busy;
     bool unconditional_forward;
     bool forward_on_no_answer;
+    bool stun_enabled;
   };
 };
 #endif

Modified: trunk/lib/engine/components/opal/opal-gmconf-bridge.cpp
==============================================================================
--- trunk/lib/engine/components/opal/opal-gmconf-bridge.cpp	(original)
+++ trunk/lib/engine/components/opal/opal-gmconf-bridge.cpp	Sun Dec 28 19:06:22 2008
@@ -110,6 +110,7 @@
   keys.push_back (H323_KEY "forward_host"); 
 
   keys.push_back (NAT_KEY "stun_server");
+  keys.push_back (NAT_KEY "disable_stun");
 
   load (keys);
 }
@@ -170,6 +171,10 @@
     const char *stun_server = gm_conf_entry_get_string (entry);
     manager.set_stun_server (stun_server ? stun_server : "stun.ekiga.net");
   }
+  else if (key == NAT_KEY "disable_stun") {
+
+    manager.set_stun_enabled (!gm_conf_entry_get_bool (entry));
+  }
 
 
   // 

Modified: trunk/lib/engine/components/opal/opal-main.cpp
==============================================================================
--- trunk/lib/engine/components/opal/opal-main.cpp	(original)
+++ trunk/lib/engine/components/opal/opal-main.cpp	Sun Dec 28 19:06:22 2008
@@ -132,6 +132,7 @@
 
   // Add the bank of accounts when the CallManager is ready
   call_manager->ready.connect (sigc::bind (sigc::ptr_fun (on_call_manager_ready_cb), &core));
+  call_manager->start ();
 
   if (contact_core) { 
 

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Sun Dec 28 19:06:22 2008
@@ -495,12 +495,6 @@
 /* 
  * Engine Callbacks 
  */
-static void on_ready_cb (gpointer self)
-{
-  ekiga_main_window_set_busy (EKIGA_MAIN_WINDOW (self), false);
-}
-
-
 static void on_registration_event (const Ekiga::Account & account,
                                    Ekiga::AccountCore::RegistrationState state,
                                    std::string /*info*/,
@@ -4043,16 +4037,12 @@
     
   /* New Call Engine signals */
   gmref_ptr<Ekiga::CallCore> call_core = mw->priv->core->get ("call-core");
-  gmref_ptr<Ekiga::AccountCore> account_core
-    = mw->priv->core->get ("account-core");
+  gmref_ptr<Ekiga::AccountCore> account_core = mw->priv->core->get ("account-core");
 
   /* Engine Signals callbacks */
   conn = account_core->registration_event.connect (sigc::bind (sigc::ptr_fun (on_registration_event), (gpointer) mw));
   mw->priv->connections.push_back (conn);
 
-  conn = call_core->ready.connect (sigc::bind (sigc::ptr_fun (on_ready_cb), (gpointer) mw));
-  mw->priv->connections.push_back (conn);
-
   conn = call_core->setup_call.connect (sigc::bind (sigc::ptr_fun (on_setup_call_cb), (gpointer) mw));
   mw->priv->connections.push_back (conn);
 
@@ -4131,9 +4121,6 @@
   g_signal_connect (G_OBJECT (status_icon), "notify::embedded",
 		    G_CALLBACK (on_status_icon_embedding_change), NULL);
 
-  /* Until we are ready, nothing possible  */
-  ekiga_main_window_set_busy (mw, true);
-
   return window;
 }
 

Modified: trunk/src/gui/preferences.cpp
==============================================================================
--- trunk/src/gui/preferences.cpp	(original)
+++ trunk/src/gui/preferences.cpp	Sun Dec 28 19:06:22 2008
@@ -479,6 +479,13 @@
                                 _("Video Display"), 1, 2);
 
   gnome_prefs_toggle_new (subsection, _("Place windows displaying video _above other windows"), VIDEO_DISPLAY_KEY "stay_on_top", _("Place windows displaying video above other windows during calls"), 0);
+
+  /* Network Settings */
+  subsection = gnome_prefs_subsection_new (prefs_window, container, 
+                                           _("Network Settings"), 1, 2);
+
+  gnome_prefs_toggle_new (subsection, _("Disable network _detection"), NAT_KEY "disable_stun", _("Disable the automatic network setup resulting from the STUN test"), 0);
+
 }
 
 static void



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