From: Kaj-Michael Lang Date: Mon, 15 Oct 2007 12:56:25 +0000 (+0300) Subject: Merge commit 'origin' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa468ad0ecfdfb71d46308009164db4011ac3100;p=mapper Merge commit 'origin' Conflicts: src/mapper.c --- fa468ad0ecfdfb71d46308009164db4011ac3100 diff --cc src/mapper.c index c1d5c1a,860a9ba..82efa05 --- a/src/mapper.c +++ b/src/mapper.c @@@ -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