From: Kaj-Michael Lang Date: Thu, 20 Dec 2007 13:24:16 +0000 (+0200) Subject: Display proper progress instead of pulsating X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb88482b32af3646e11e1a109ba6088e13bcf6f7;p=mapper Display proper progress instead of pulsating --- diff --git a/src/mapper.c b/src/mapper.c index 9bb6d2e..4857844 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -202,6 +202,7 @@ mapper_init(gpointer data) { GError *error = NULL; gboolean ret=TRUE; +gfloat p; switch (mis) { case MAPPER_INIT_START: @@ -214,15 +215,18 @@ switch (mis) { track_init(); route_init(); mis=MAPPER_INIT_CONFIG; + p=0.1; break; case MAPPER_INIT_CONFIG: config_init(); map_download_init(); mis=MAPPER_INIT_GPS; + p=0.2; break; case MAPPER_INIT_GPS: gps_init(); mis=MAPPER_INIT_DB; + p=0.3; break; case MAPPER_INIT_DB: if (db_connect(&_db, _mapper_db)) { @@ -230,14 +234,17 @@ switch (mis) { } else { mis=MAPPER_INIT_VOICE; } + p=0.5; break; case MAPPER_INIT_POI: poi_init(&_db); mis=MAPPER_INIT_OSM; + p=0.6; break; case MAPPER_INIT_OSM: osm_init(&_db); mis=MAPPER_INIT_VOICE; + p=0.8; break; case MAPPER_INIT_VOICE: #if defined (WITH_GST) && defined (WITH_ESPEAK) @@ -247,6 +254,7 @@ switch (mis) { } #endif mis=MAPPER_INIT_MISC; + p=0.85; break; case MAPPER_INIT_MISC: /* Initialize D-Bus system connection. */ @@ -267,15 +275,20 @@ switch (mis) { } #endif mis=MAPPER_INIT_UI; + p=0.9; break; case MAPPER_INIT_UI: mapper_ui_init(); mis=MAPPER_INIT_GOTO; + p=0.99; break; case MAPPER_INIT_GOTO: if (map_goto_position(&_home)==FALSE) g_printerr("Home is not set.\n"); + else + map_center_unit(_center.unitx, _center.unity); mis=MAPPER_INIT_DONE; + p=1.0; break; case MAPPER_INIT_DONE: progress_dialog_remove(init_dialog); @@ -283,7 +296,11 @@ 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 return ret; }