]> git.street.me.uk Git - andy/viking.git/blobdiff - src/datasource_gps.c
Enable Windows installation to search for and use deployed extension configuration...
[andy/viking.git] / src / datasource_gps.c
index f6aacda48b8bf57b20393dd863fb4183507f1b85..1fd2dd3cf2ebd665bbeecdb8508f25b90e6a7215 100644 (file)
@@ -53,7 +53,7 @@ static void datasource_gps_off ( gpointer add_widgets_data_not_used, gchar **bab
 VikDataSourceInterface vik_datasource_gps_interface = {
   N_("Acquire from GPS"),
   N_("Acquired from GPS"),
-  VIK_DATASOURCE_CREATENEWLAYER,
+  VIK_DATASOURCE_AUTO_LAYER_MANAGEMENT,
   VIK_DATASOURCE_INPUTTYPE_NONE,
   TRUE,
   TRUE,
@@ -66,7 +66,13 @@ VikDataSourceInterface vik_datasource_gps_interface = {
   (VikDataSourceProgressFunc)          datasource_gps_progress,
   (VikDataSourceAddProgressWidgetsFunc)        datasource_gps_add_progress_widgets,
   (VikDataSourceCleanupFunc)           datasource_gps_cleanup,
-  (VikDataSourceOffFunc)                datasource_gps_off
+  (VikDataSourceOffFunc)                datasource_gps_off,
+
+  NULL,
+  0,
+  NULL,
+  NULL,
+  0
 };
 
 /*********************************************************
@@ -479,7 +485,6 @@ void append_element (gpointer elem, gpointer user_data)
 }
 
 static gint find_entry = -1;
-static gint garmin_entry = -1;
 static gint wanted_entry = -1;
 
 static void find_protocol (gpointer elem, gpointer user_data)
@@ -509,15 +514,13 @@ static void datasource_gps_add_setup_widgets ( GtkWidget *dialog, VikViewport *v
       // Use setting
       if ( protocol )
         g_list_foreach (a_babel_device_list, find_protocol, protocol);
-      // If not found set it to the first entry, otherwise use the entry
-      last_active = ( wanted_entry < 0 ) ? 0 : wanted_entry;
     }
     else {
-      // Maintain default to Garmin devices (assumed most popular/numerous device)
-      garmin_entry = -1;
+      // Attempt to maintain default to Garmin devices (assumed most popular/numerous device)
       g_list_foreach (a_babel_device_list, find_protocol, "garmin");
-      last_active = ( garmin_entry < 0 ) ? 0 : garmin_entry;
     }
+    // If not found set it to the first entry, otherwise use the entry
+    last_active = ( wanted_entry < 0 ) ? 0 : wanted_entry;
   }
 
   gtk_combo_box_set_active (GTK_COMBO_BOX(w->proto_b), last_active);