]> err.no Git - mapper/commitdiff
Display proper progress instead of pulsating
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 20 Dec 2007 13:24:16 +0000 (15:24 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 20 Dec 2007 13:24:16 +0000 (15:24 +0200)
src/mapper.c

index 9bb6d2e185cf600790493408274bda04740c5dbc..4857844afd084c38657d2842b432e59b08f4df1c 100644 (file)
@@ -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;
 }