From b9a07ebc208b54c1abdb2f8e4f7332759fe351e3 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Tue, 17 Mar 2015 22:26:11 +0000 Subject: [PATCH 1/1] Add advanced setting to create TrackWaypoint layers without asking for details. --- help/C/viking.xml | 4 ++++ src/viklayerspanel.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/help/C/viking.xml b/help/C/viking.xml index ebfb7360..a5fef066 100644 --- a/help/C/viking.xml +++ b/help/C/viking.xml @@ -3341,6 +3341,10 @@ Accept: */* Some values in this file are read only, in the sense that there is no way to set it other than by manually entering in the keys and values (the key will not exist in the file otherwise). This allows some fine tuning of &app; behaviours, without resorting to recompiling the code. However is it not expected that these values should need to be changed for a normal user, hence no GUI options for these have been provided. Here is the list of the read only keys and their default values. + + layers_create_trw_auto_default=false + Create new TrackWaypoint layers without showing the layer properties dialog first. + maps_max_tiles=1000 diff --git a/src/viklayerspanel.c b/src/viklayerspanel.c index 4205eac9..cc4f6a99 100644 --- a/src/viklayerspanel.c +++ b/src/viklayerspanel.c @@ -24,6 +24,7 @@ #endif #include "viking.h" +#include "settings.h" #include @@ -442,6 +443,7 @@ static void layers_popup_cb ( VikLayersPanel *vlp ) layers_popup ( vlp, NULL, 0 ); } +#define VIK_SETTINGS_LAYERS_TRW_CREATE_DEFAULT "layers_create_trw_auto_default" /** * vik_layers_panel_new_layer: * @type: type of the new layer @@ -452,7 +454,11 @@ gboolean vik_layers_panel_new_layer ( VikLayersPanel *vlp, VikLayerTypeEnum type { VikLayer *l; g_assert ( vlp->vvp ); - l = vik_layer_create ( type, vlp->vvp, TRUE ); + gboolean ask_user = FALSE; + if ( type == VIK_LAYER_TRW ) + a_settings_get_boolean ( VIK_SETTINGS_LAYERS_TRW_CREATE_DEFAULT, &ask_user ); + ask_user = !ask_user; + l = vik_layer_create ( type, vlp->vvp, ask_user ); if ( l ) { vik_layers_panel_add_layer ( vlp, l ); -- 2.39.5