From: Kaj-Michael Lang Date: Tue, 15 Jan 2008 16:04:27 +0000 (+0200) Subject: Add textual progress X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cd97ddca961054258649f1e56633d6585ad864a;p=mapper Add textual progress --- diff --git a/src/mapper.c b/src/mapper.c index 855b8b6..c4fcab4 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -203,6 +203,7 @@ mapper_init(gpointer data) GError *error = NULL; gboolean ret=TRUE; gfloat p=0; +gchar *w="Starting"; switch (mis) { case MAPPER_INIT_START: @@ -217,17 +218,20 @@ switch (mis) { route_init(); mis=MAPPER_INIT_CONFIG; p=0.1; + w="Init"; break; case MAPPER_INIT_CONFIG: config_init(); map_download_init(); mis=MAPPER_INIT_GPS; p=0.2; + w="Config"; break; case MAPPER_INIT_GPS: gps_init(); mis=MAPPER_INIT_DB; p=0.3; + w="GPS"; break; case MAPPER_INIT_DB: if (db_connect(&_db, _mapper_db)) { @@ -236,16 +240,19 @@ switch (mis) { mis=MAPPER_INIT_VOICE; } p=0.5; + w="Database"; break; case MAPPER_INIT_POI: poi_init(&_db); mis=MAPPER_INIT_OSM; p=0.6; + w="POIs"; break; case MAPPER_INIT_OSM: osm_init(&_db); mis=MAPPER_INIT_VOICE; p=0.8; + w="OSM"; break; case MAPPER_INIT_VOICE: #if defined (WITH_GST) && defined (WITH_ESPEAK) @@ -256,6 +263,7 @@ switch (mis) { #endif mis=MAPPER_INIT_MISC; p=0.85; + w="Speech"; break; case MAPPER_INIT_MISC: /* Initialize D-Bus system connection. */ @@ -277,11 +285,13 @@ switch (mis) { #endif mis=MAPPER_INIT_UI; p=0.9; + w="Misc"; break; case MAPPER_INIT_UI: mapper_ui_init(); mis=MAPPER_INIT_GOTO; p=0.99; + w="UI"; break; case MAPPER_INIT_GOTO: if (map_goto_position(&_home)==FALSE) @@ -290,6 +300,7 @@ switch (mis) { map_center_unit(_center.unitx, _center.unity); mis=MAPPER_INIT_DONE; p=1.0; + w="Done"; break; case MAPPER_INIT_DONE: progress_dialog_remove(init_dialog); @@ -297,11 +308,8 @@ switch (mis) { break; } -#if 1 gtk_progress_bar_set_fraction(GTK_PROGRESS(init_progress), p); -#else -gtk_progress_bar_pulse(GTK_PROGRESS(init_progress)); -#endif +gtk_progress_bar_set_text(GTK_PROGRESS(init_progress), w); return ret; }