X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/aa6dfd27f2e17fd7bc2c4259d1564ba585478e93..25f2b8ef47071b00e26c0a1ba393e81f5404232e:/src/datasource_gps.c?ds=sidebyside diff --git a/src/datasource_gps.c b/src/datasource_gps.c index f6aacda4..1fd2dd3c 100644 --- a/src/datasource_gps.c +++ b/src/datasource_gps.c @@ -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);