]> err.no Git - mapper/commitdiff
Merge commit 'origin'
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 15 Oct 2007 12:56:25 +0000 (15:56 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 15 Oct 2007 12:56:25 +0000 (15:56 +0300)
Conflicts:

src/mapper.c

1  2 
src/gtkcompass.c
src/mapper.c
src/ui-common.c

Simple merge
diff --cc src/mapper.c
index c1d5c1af4bac59c21471cb1dea3f47ed8b46167d,860a9baffc596d8881aee9a54293b53c28c88ae6..82efa050159b372934bfef632621f5e27c151087
@@@ -170,38 -189,71 +189,72 @@@ localtime_r(&time1, &time2)
  _gmtoffset = time2.tm_gmtoff;
  }
  
- static void 
- mapper_init(gint argc, gchar ** argv)
+ static gboolean
+ mapper_init(gpointer data)
  {
- DBusGConnection *dbus_conn;
  GError *error = NULL;
+ gboolean ret=TRUE;
  
- g_set_application_name("Mapper");
- mapper_init_variables();
- track_init();
- route_init();
- config_init();
- map_download_init();
- osm_init();
- gps_init();
+ switch (mis) {
+       case MAPPER_INIT_START:
+               _conn_state = RCVR_OFF;
+               curl_global_init(CURL_GLOBAL_NOTHING);
+               gnome_vfs_init();
+               timezone_init();
+               gpx_init();
+               mapper_init_variables();
+               track_init();
+               route_init();
+               mis=MAPPER_INIT_CONFIG;
+       break;
+       case MAPPER_INIT_CONFIG:
+               config_init();
+               map_download_init();
+               mis=MAPPER_INIT_GPS;
+       break;
+       case MAPPER_INIT_GPS:
+               gps_init();
+               mis=MAPPER_INIT_DB;
+       break;
+       case MAPPER_INIT_DB:
+               osm_init();
+               mis=MAPPER_INIT_VOICE;
+       break;
+       case MAPPER_INIT_VOICE:
+               #if defined (WITH_GST) && defined (WITH_ESPEAK)
+               speak_init("en",_voice_speed,_voice_pitch);
+               #endif
+               mis=MAPPER_INIT_MISC;
+       break;
+       case MAPPER_INIT_MISC:
+               #ifdef WITH_OSSO
+               osso_hw_set_event_cb(_osso, NULL, osso_cb_hw_state, NULL);
+               #endif
  
- #ifdef WITH_OSSO
- osso_hw_set_event_cb(_osso, NULL, osso_cb_hw_state, NULL);
- #endif
- /* Initialize D-Bus. */
- if (NULL == (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) {
-       g_printerr("Failed to open connection to D-Bus: %s.\n", error->message);
-       error = NULL;
- }
- #ifdef WITH_HILDON_DBUS_BT
- if (NULL == (_rfcomm_req_proxy = dbus_g_proxy_new_for_name(dbus_conn, BTCOND_SERVICE, BTCOND_REQ_PATH, BTCOND_REQ_INTERFACE))) {
-       g_printerr("Failed to open connection to %s.\n", BTCOND_REQ_INTERFACE);
+               /* Initialize D-Bus. */
+               if (NULL == (dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error))) {
+                       g_printerr("Failed to open connection to D-Bus: %s.\n", error->message);
+                       error = NULL;
+               }
+               #ifdef WITH_HILDON_DBUS_BT
+               if (NULL == (_rfcomm_req_proxy = dbus_g_proxy_new_for_name(dbus_conn, BTCOND_SERVICE, BTCOND_REQ_PATH, BTCOND_REQ_INTERFACE))) {
+                       g_printerr("Failed to open connection to %s.\n", BTCOND_REQ_INTERFACE);
+               }
+               #endif
+               mis=MAPPER_INIT_UI;
+       break;
+       case MAPPER_INIT_UI:
+               mapper_ui_init();
+               mis=MAPPER_INIT_DONE;
+       break;
+       case MAPPER_INIT_DONE:
+               progress_dialog_remove(init_dialog);
+               return FALSE;
+       break;
  }
- #endif
 +
- mapper_ui_init();
+ gtk_progress_bar_pulse(GTK_PROGRESS(init_progress));
+ return ret;
  }
  
  gint 
diff --cc src/ui-common.c
Simple merge