]> git.street.me.uk Git - andy/viking.git/commitdiff
On all GPS Uploads/Downloads always update progress status with 'Status: Working...'
authorRob Norris <rw_norris@hotmail.com>
Sun, 30 Sep 2012 18:13:09 +0000 (19:13 +0100)
committerRob Norris <rw_norris@hotmail.com>
Fri, 19 Oct 2012 21:39:47 +0000 (22:39 +0100)
Otherwise still says 'Status: detecting gpsbabel' which is not true!

src/datasource_gps.c
src/vikgpslayer.c

index 4f85f993fc9b389173f2aaaadb9ee28471cda16c..afa812f96fad5c7093b8d2b97ead14fa9c02624f 100644 (file)
@@ -258,6 +258,12 @@ static void datasource_gps_progress ( BabelProgressCode c, gpointer data, acq_di
   case BABEL_DIAG_OUTPUT:
     line = (gchar *)data;
 
+    gdk_threads_enter();
+    if (w->ok) {
+      gtk_label_set_text ( GTK_LABEL(w->status), _("Status: Working...") );
+    }
+    gdk_threads_leave();
+
     /* tells us how many items there will be */
     if (strstr(line, "Xfer Wpt")) { 
       gps_data->progress_label = gps_data->wp_label;
index 3b85138a662bc06e8996bdcdd74d82c6d068dca4..7985ae1fba6ee6168645fc79106f25bf17e100a8 100644 (file)
@@ -963,6 +963,14 @@ static void gps_download_progress_func(BabelProgressCode c, gpointer data, GpsSe
   case BABEL_DIAG_OUTPUT:
     line = (gchar *)data;
 
+    gdk_threads_enter();
+    g_mutex_lock(sess->mutex);
+    if (sess->ok) {
+      gtk_label_set_text ( GTK_LABEL(sess->status_label), _("Status: Working...") );
+    }
+    g_mutex_unlock(sess->mutex);
+    gdk_threads_leave();
+
     /* tells us how many items there will be */
     if (strstr(line, "Xfer Wpt")) { 
       sess->progress_label = sess->wp_label;
@@ -1047,6 +1055,14 @@ static void gps_upload_progress_func(BabelProgressCode c, gpointer data, GpsSess
   case BABEL_DIAG_OUTPUT:
     line = (gchar *)data;
 
+    gdk_threads_enter();
+    g_mutex_lock(sess->mutex);
+    if (sess->ok) {
+      gtk_label_set_text ( GTK_LABEL(sess->status_label), _("Status: Working...") );
+    }
+    g_mutex_unlock(sess->mutex);
+    gdk_threads_leave();
+
     if (strstr(line, "PRDDAT")) {
       gchar **tokens = g_strsplit(line, " ", 0);
       gchar info[128];