_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