]> git.street.me.uk Git - andy/viking.git/commitdiff
Add advanced setting to create TrackWaypoint layers without asking for details.
authorRob Norris <rw_norris@hotmail.com>
Tue, 17 Mar 2015 22:26:11 +0000 (22:26 +0000)
committerRob Norris <rw_norris@hotmail.com>
Tue, 17 Mar 2015 22:26:11 +0000 (22:26 +0000)
help/C/viking.xml
src/viklayerspanel.c

index ebfb7360214d1b2b930f27d0c621d363fee25a0a..a5fef066cc28b775eb720480687115a48f300099 100644 (file)
@@ -3341,6 +3341,10 @@ Accept: */*
         <para>Some values in this file are <emphasis>read only</emphasis>, 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.</para>
         <para>Here is the list of the <emphasis>read only</emphasis> keys and their default values.</para>
        <orderedlist>
+         <listitem>
+           <para>layers_create_trw_auto_default=false</para>
+           <para>Create new TrackWaypoint layers without showing the layer properties dialog first.</para>
+         </listitem>
          <listitem>
            <para>maps_max_tiles=1000</para>
          </listitem>
index 4205eac93eba8901de1157c06991d48601011137..cc4f6a999de69638a59bf8780c1c8b17bc7e63c9 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 
 #include "viking.h"
+#include "settings.h"
 
 #include <string.h>
 
@@ -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 );