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



Author: dsandras
Date: Sun Dec  7 15:20:44 2008
New Revision: 7440
URL: http://svn.gnome.org/viewvc/ekiga?rev=7440&view=rev

Log:
Do not show the assistant after an upgrade for which Ekiga was already
successfully setup.
Correctly migrate audio & video devices settings, as well as the full 
name and the ekiga.net / diamondcard settings. (#561180)


Modified:
   trunk/ChangeLog
   trunk/lib/engine/components/opal/opal-gmconf-bridge.cpp
   trunk/src/gui/assistant.cpp
   trunk/src/gui/conf.cpp
   trunk/src/gui/main.cpp

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  7 15:20:44 2008
@@ -44,8 +44,13 @@
 #include "opal-gmconf-bridge.h"
 #include "opal-call-manager.h"
 
+#ifdef HAVE_SIP
 #include "sip-endpoint.h"
+#endif 
+
+#ifdef HAVE_H323
 #include "h323-endpoint.h"
+#endif
 
 #define AUDIO_DEVICES_KEY "/apps/" PACKAGE_NAME "/devices/audio/"
 #define VIDEO_DEVICES_KEY "/apps/" PACKAGE_NAME "/devices/video/"

Modified: trunk/src/gui/assistant.cpp
==============================================================================
--- trunk/src/gui/assistant.cpp	(original)
+++ trunk/src/gui/assistant.cpp	Sun Dec  7 15:20:44 2008
@@ -1538,10 +1538,6 @@
 
   GtkWidget *main_window;
 
-  const int schema_version = MAJOR_VERSION * 1000
-                           + MINOR_VERSION * 10
-                           + BUILD_NUMBER;
-
   apply_personal_data_page (assistant);
   apply_ekiga_net_page (assistant);
   apply_ekiga_out_page (assistant);
@@ -1555,9 +1551,6 @@
   gtk_widget_hide (GTK_WIDGET (assistant));
   gtk_assistant_set_current_page (gtkassistant, 0);
   gtk_widget_show (main_window);
-
-  /* Update the version number */
-  gm_conf_set_int (GENERAL_KEY "version", schema_version);
 }
 
 

Modified: trunk/src/gui/conf.cpp
==============================================================================
--- trunk/src/gui/conf.cpp	(original)
+++ trunk/src/gui/conf.cpp	Sun Dec  7 15:20:44 2008
@@ -318,4 +318,80 @@
     gm_conf_set_string (NAT_KEY "public_ip_detector", 
 			"http://ekiga.net/ip/";);
   g_free (conf_url);
+
+  /* New full name key */
+  conf_url = gm_conf_get_string (PERSONAL_DATA_KEY "full_name");
+  if (!conf_url || (conf_url && !strcmp (conf_url, ""))) {
+
+    gchar *fullname = NULL;
+    gchar *firstname = gm_conf_get_string (PERSONAL_DATA_KEY "firstname");
+    gchar *lastname = gm_conf_get_string (PERSONAL_DATA_KEY "lastname");
+
+    if (firstname && lastname && strcmp (firstname, "") && strcmp (lastname, "")) {
+      fullname = g_strdup_printf ("%s %s", firstname, lastname);
+      gm_conf_set_string (PERSONAL_DATA_KEY "firstname", "");
+      gm_conf_set_string (PERSONAL_DATA_KEY "lastname", "");
+      gm_conf_set_string (PERSONAL_DATA_KEY "full_name", fullname);
+      g_free (fullname);
+    }
+    g_free (firstname);
+    g_free (lastname);
+  }
+  g_free (conf_url);
+
+  /* diamondcard is now set at sip.diamondcard.us */
+  GSList *accounts = gm_conf_get_string_list ("/apps/ekiga/protocols/accounts_list");
+  GSList *accounts_iter = accounts;
+  while (accounts_iter) {
+
+    PString acct = (gchar *) accounts_iter->data;
+    acct.Replace ("eugw.ast.diamondcard.us", "sip.diamondcard.us", TRUE);
+    g_free (accounts_iter->data);
+    accounts_iter->data = g_strdup ((const char *) acct);
+    accounts_iter = g_slist_next (accounts_iter);
+  }
+  gm_conf_set_string_list ("/apps/ekiga/protocols/accounts_list", accounts);
+  g_slist_foreach (accounts, (GFunc) g_free, NULL);
+  g_slist_free (accounts);
+
+  /* Audio devices */
+  gchar *plugin = NULL;
+  gchar *device = NULL;
+  gchar *new_device = NULL;
+  plugin = gm_conf_get_string (AUDIO_DEVICES_KEY "plugin");
+  if (plugin && strcmp (plugin, "")) {
+    device = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
+    new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
+    gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", "");
+    gm_conf_set_string (AUDIO_DEVICES_KEY "input_device", new_device);
+    g_free (device);
+    g_free (new_device);
+
+    device = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device");
+    new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
+    gm_conf_set_string (AUDIO_DEVICES_KEY "plugin", "");
+    gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", new_device);
+    g_free (device);
+    g_free (new_device);
+
+    device = gm_conf_get_string (SOUND_EVENTS_KEY "output_device");
+    new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
+    gm_conf_set_string (SOUND_EVENTS_KEY "plugin", "");
+    gm_conf_set_string (SOUND_EVENTS_KEY "output_device", new_device);
+    g_free (device);
+    g_free (new_device);
+  }
+  g_free (plugin);
+
+  /* Video devices */
+  plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "plugin");
+  if (plugin && strcmp (plugin, "")) {
+    device = gm_conf_get_string (VIDEO_DEVICES_KEY "input_device");
+    new_device = g_strdup_printf ("%s (PTLIB/%s)", device, plugin);
+    gm_conf_set_string (VIDEO_DEVICES_KEY "plugin", "");
+    gm_conf_set_string (VIDEO_DEVICES_KEY "input_device", new_device);
+    g_free (device);
+    g_free (new_device);
+  }
+  g_free (plugin);
 }

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Sun Dec  7 15:20:44 2008
@@ -4469,8 +4469,17 @@
         < 1000 * MAJOR_VERSION + 10 * MINOR_VERSION + BUILD_NUMBER) {
 
       gnomemeeting_conf_upgrade ();
-      assistant_window = GnomeMeeting::Process ()->GetAssistantWindow ();
-      gtk_widget_show_all (assistant_window);
+      // Only show the assistant window if version older than 2.00
+      if (gm_conf_get_int (GENERAL_KEY "version") < 2000) {
+        assistant_window = GnomeMeeting::Process ()->GetAssistantWindow ();
+        gtk_widget_show_all (assistant_window);
+      }
+      const int schema_version = MAJOR_VERSION * 1000
+                               + MINOR_VERSION * 10
+                               + BUILD_NUMBER;
+
+      /* Update the version number */
+      gm_conf_set_int (GENERAL_KEY "version", schema_version);
     }
     else {
 



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