ekiga r7439 - in branches/gnome-2-24: . src/gui



Author: dsandras
Date: Sun Dec  7 15:19:26 2008
New Revision: 7439
URL: http://svn.gnome.org/viewvc/ekiga?rev=7439&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:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/src/gui/assistant.cpp
   branches/gnome-2-24/src/gui/conf.cpp
   branches/gnome-2-24/src/gui/main.cpp

Modified: branches/gnome-2-24/src/gui/assistant.cpp
==============================================================================
--- branches/gnome-2-24/src/gui/assistant.cpp	(original)
+++ branches/gnome-2-24/src/gui/assistant.cpp	Sun Dec  7 15:19:26 2008
@@ -1529,10 +1529,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);
@@ -1546,9 +1542,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: branches/gnome-2-24/src/gui/conf.cpp
==============================================================================
--- branches/gnome-2-24/src/gui/conf.cpp	(original)
+++ branches/gnome-2-24/src/gui/conf.cpp	Sun Dec  7 15:19:26 2008
@@ -320,4 +320,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: branches/gnome-2-24/src/gui/main.cpp
==============================================================================
--- branches/gnome-2-24/src/gui/main.cpp	(original)
+++ branches/gnome-2-24/src/gui/main.cpp	Sun Dec  7 15:19:26 2008
@@ -4755,8 +4755,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]