]> git.street.me.uk Git - andy/viking.git/blame - src/globals.c
Allow import of file format with *any* readable components as supported by GPSBabel.
[andy/viking.git] / src / globals.c
CommitLineData
2936913d
GB
1/*
2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
3 *
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
a482007a 5 * Copyright (C) 2008, Guilhem Bonnefille <guilhem.bonnefille@gmail.com>
1219fd23 6 * Copyright (C) 2010-2013, Rob Norris <rw_norris@hotmail.com>
2936913d
GB
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
a58aaed4
GB
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
6cdf89e5
RN
26#ifdef HAVE_STDLIB_H
27#include <stdlib.h>
28#endif
a58aaed4
GB
29
30#include <glib/gi18n.h>
2936913d
GB
31
32#include "globals.h"
a58aaed4 33#include "preferences.h"
6cdf89e5 34#include "math.h"
20015a31 35#include "dir.h"
2936913d
GB
36
37gboolean vik_debug = FALSE;
38gboolean vik_verbose = FALSE;
39gboolean vik_version = FALSE;
40
6cdf89e5
RN
41/**
42 * viking_version_to_number:
43 * @version: The string of the Viking version.
44 * This should be in the form of N.N.N.N, where the 3rd + 4th numbers are optional
45 * Often you'll want to pass in VIKING_VERSION
46 *
47 * Returns: a single number useful for comparison
48 */
49gint viking_version_to_number ( gchar *version )
50{
51 // Basic method, probably can be improved
52 gint version_number = 0;
53 gchar** parts = g_strsplit ( version, ".", 0 );
54 gint part_num = 0;
55 gchar *part = parts[part_num];
56 // Allow upto 4 parts to the version number
57 while ( part && part_num < 4 ) {
58 // Allow each part to have upto 100
59 version_number = version_number + ( atol(part) * pow(100, 3-part_num) );
60 part_num++;
61 part = parts[part_num];
62 }
63 g_strfreev ( parts );
64 return version_number;
65}
66
c62f6241 67static gchar * params_degree_formats[] = {"DDD", "DMM", "DMS", N_("Raw"), NULL};
6f9336aa 68static gchar * params_units_distance[] = {"Kilometres", "Miles", NULL};
a4c92313 69static gchar * params_units_speed[] = {"km/h", "mph", "m/s", "knots", NULL};
6027a9c5 70static gchar * params_units_height[] = {"Metres", "Feet", NULL};
5210c3d3
GB
71static VikLayerParamScale params_scales_lat[] = { {-90.0, 90.0, 0.05, 2} };
72static VikLayerParamScale params_scales_long[] = { {-180.0, 180.0, 0.05, 2} };
88542aa9
RN
73static gchar * params_vik_fileref[] = {N_("Absolute"), N_("Relative"), NULL};
74
4fe48116 75static VikLayerParam general_prefs[] = {
63959706
RN
76 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "degree_format", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Degree format:"), VIK_LAYER_WIDGET_COMBOBOX, params_degree_formats, NULL, NULL, NULL, NULL, NULL },
77 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "units_distance", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Distance units:"), VIK_LAYER_WIDGET_COMBOBOX, params_units_distance, NULL, NULL, NULL, NULL, NULL },
78 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "units_speed", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Speed units:"), VIK_LAYER_WIDGET_COMBOBOX, params_units_speed, NULL, NULL, NULL, NULL, NULL },
79 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "units_height", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Height units:"), VIK_LAYER_WIDGET_COMBOBOX, params_units_height, NULL, NULL, NULL, NULL, NULL },
80 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "use_large_waypoint_icons", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, N_("Use large waypoint icons:"), VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL, NULL, NULL, NULL, NULL },
81 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "default_latitude", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_GROUP_NONE, N_("Default latitude:"), VIK_LAYER_WIDGET_SPINBUTTON, params_scales_lat, NULL, NULL, NULL, NULL, NULL },
82 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_NAMESPACE "default_longitude", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_GROUP_NONE, N_("Default longitude:"), VIK_LAYER_WIDGET_SPINBUTTON, params_scales_long, NULL, NULL, NULL, NULL, NULL },
5210c3d3
GB
83};
84
60dbd0ad
RN
85/* External/Export Options */
86
87static gchar * params_kml_export_units[] = {"Metric", "Statute", "Nautical", NULL};
b02cd3a3 88static gchar * params_gpx_export_trk_sort[] = {N_("Alphabetical"), N_("Time"), N_("Creation"), NULL };
72f067ad 89static gchar * params_gpx_export_wpt_symbols[] = {N_("Title Case"), N_("Lowercase"), NULL};
60dbd0ad
RN
90
91static VikLayerParam io_prefs[] = {
a87f8fa1
RN
92 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "kml_export_units", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("KML File Export Units:"), VIK_LAYER_WIDGET_COMBOBOX, params_kml_export_units, NULL, NULL, NULL, NULL, NULL },
93 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "gpx_export_track_sort", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("GPX Track Order:"), VIK_LAYER_WIDGET_COMBOBOX, params_gpx_export_trk_sort, NULL, NULL, NULL, NULL, NULL },
72f067ad 94 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "gpx_export_wpt_sym_names", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("GPX Waypoint Symbols:"), VIK_LAYER_WIDGET_COMBOBOX, params_gpx_export_wpt_symbols, NULL,
a87f8fa1 95 N_("Save GPX Waypoint Symbol names in the specified case. May be useful for compatibility with various devices"), NULL, NULL, NULL },
60dbd0ad
RN
96};
97
3317dc4e
RN
98#ifndef WINDOWS
99static VikLayerParam io_prefs_non_windows[] = {
63959706 100 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "image_viewer", VIK_LAYER_PARAM_STRING, VIK_LAYER_GROUP_NONE, N_("Image Viewer:"), VIK_LAYER_WIDGET_FILEENTRY, NULL, NULL, NULL, NULL, NULL, NULL },
3317dc4e
RN
101};
102#endif
103
ccccf356 104static VikLayerParam io_prefs_external_gpx[] = {
63959706
RN
105 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "external_gpx_1", VIK_LAYER_PARAM_STRING, VIK_LAYER_GROUP_NONE, N_("External GPX Program 1:"), VIK_LAYER_WIDGET_FILEENTRY, NULL, NULL, NULL, NULL, NULL, NULL },
106 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_IO_NAMESPACE "external_gpx_2", VIK_LAYER_PARAM_STRING, VIK_LAYER_GROUP_NONE, N_("External GPX Program 2:"), VIK_LAYER_WIDGET_FILEENTRY, NULL, NULL, NULL, NULL, NULL, NULL },
ccccf356
RN
107};
108
50843c96
RN
109static VikLayerParamScale params_recent_files[] = { {-1, 25, 1, 0} };
110
88542aa9
RN
111static VikLayerParam prefs_advanced[] = {
112 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_ADVANCED_NAMESPACE "save_file_reference_mode", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Save File Reference Mode:"), VIK_LAYER_WIDGET_COMBOBOX, params_vik_fileref, NULL,
a87f8fa1 113 N_("When saving a Viking .vik file, this determines how the directory paths of filenames are written."), NULL, NULL, NULL },
63959706 114 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_ADVANCED_NAMESPACE "create_track_tooltip", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, N_("Show Tooltip during Track Creation:"), VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL, NULL, NULL, NULL, NULL },
50843c96
RN
115 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_ADVANCED_NAMESPACE "number_recent_files", VIK_LAYER_PARAM_INT, VIK_LAYER_GROUP_NONE, N_("The number of recent files:"), VIK_LAYER_WIDGET_SPINBUTTON, params_recent_files, NULL,
116 N_("Only applies to new windows or on application restart. -1 means all available files."), NULL, NULL, NULL },
88542aa9
RN
117};
118
a14f46cf 119static gchar * params_startup_methods[] = {N_("Home Location"), N_("Last Location"), N_("Specified File"), N_("Auto Location"), NULL};
7143d1e4 120
1219fd23
RN
121static VikLayerParam startup_prefs[] = {
122 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "restore_window_state", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, N_("Restore Window Setup:"), VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL,
a87f8fa1 123 N_("Restore window size and layout"), NULL, NULL, NULL},
8fa25c61 124 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "add_default_map_layer", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, N_("Add a Default Map Layer:"), VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL,
a87f8fa1
RN
125 N_("The default map layer added is defined by the Layer Defaults. Use the menu Edit->Layer Defaults->Map... to change the map type and other values."), NULL, NULL, NULL},
126 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "startup_method", VIK_LAYER_PARAM_UINT, VIK_LAYER_GROUP_NONE, N_("Startup Method:"), VIK_LAYER_WIDGET_COMBOBOX, params_startup_methods, NULL, NULL, NULL, NULL, NULL },
7143d1e4 127 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "startup_file", VIK_LAYER_PARAM_STRING, VIK_LAYER_GROUP_NONE, N_("Startup File:"), VIK_LAYER_WIDGET_FILEENTRY, NULL, NULL,
a87f8fa1 128 N_("The default file to load on startup. Only applies when the startup method is set to 'Specified File'"), NULL, NULL, NULL },
91fc9c76 129 { VIK_LAYER_NUM_TYPES, VIKING_PREFERENCES_STARTUP_NAMESPACE "check_version", VIK_LAYER_PARAM_BOOLEAN, VIK_LAYER_GROUP_NONE, N_("Check For New Version:"), VIK_LAYER_WIDGET_CHECKBUTTON, NULL, NULL,
a87f8fa1 130 N_("Periodically check to see if a new version of Viking is available"), NULL, NULL, NULL },
1219fd23 131};
60dbd0ad
RN
132/* End of Options static stuff */
133
20015a31
RN
134/**
135 * Detect when Viking is run for the very first time
136 * Call this very early in the startup sequence to ensure subsequent correct results
137 * The return value is cached, since later on the test will no longer be true
138 */
139gboolean a_vik_very_first_run ()
140{
141 static gboolean vik_very_first_run_known = FALSE;
142 static gboolean vik_very_first_run = FALSE;
143
144 // use cached result if available
145 if ( vik_very_first_run_known )
146 return vik_very_first_run;
147
148 gchar *dir = a_get_viking_dir_no_create();
149 // NB: will need extra logic if default dir gets changed e.g. from ~/.viking to ~/.config/viking
150 if ( dir ) {
151 // If directory exists - Viking has been run before
152 vik_very_first_run = ! g_file_test ( dir, G_FILE_TEST_EXISTS );
153 g_free ( dir );
154 }
155 else
156 vik_very_first_run = TRUE;
157 vik_very_first_run_known = TRUE;
158
159 return vik_very_first_run;
160}
161
a58aaed4
GB
162void a_vik_preferences_init ()
163{
6cdf89e5
RN
164 g_debug ( "VIKING VERSION as number: %d", viking_version_to_number (VIKING_VERSION) );
165
f02faa96 166 // Defaults for the options are setup here
1b03d66d 167 a_preferences_register_group ( VIKING_PREFERENCES_GROUP_KEY, _("General") );
a58aaed4
GB
168
169 VikLayerParamData tmp;
170 tmp.u = VIK_DEGREE_FORMAT_DMS;
4fe48116 171 a_preferences_register(&general_prefs[0], tmp, VIKING_PREFERENCES_GROUP_KEY);
6f9336aa
RN
172
173 tmp.u = VIK_UNITS_DISTANCE_KILOMETRES;
4fe48116 174 a_preferences_register(&general_prefs[1], tmp, VIKING_PREFERENCES_GROUP_KEY);
13bdea80
RN
175
176 tmp.u = VIK_UNITS_SPEED_KILOMETRES_PER_HOUR;
4fe48116 177 a_preferences_register(&general_prefs[2], tmp, VIKING_PREFERENCES_GROUP_KEY);
6027a9c5
RN
178
179 tmp.u = VIK_UNITS_HEIGHT_METRES;
4fe48116 180 a_preferences_register(&general_prefs[3], tmp, VIKING_PREFERENCES_GROUP_KEY);
9be0449f
RN
181
182 tmp.b = TRUE;
4fe48116 183 a_preferences_register(&general_prefs[4], tmp, VIKING_PREFERENCES_GROUP_KEY);
5210c3d3
GB
184
185 /* Maintain the default location to New York */
186 tmp.d = 40.714490;
4fe48116 187 a_preferences_register(&general_prefs[5], tmp, VIKING_PREFERENCES_GROUP_KEY);
5210c3d3 188 tmp.d = -74.007130;
4fe48116 189 a_preferences_register(&general_prefs[6], tmp, VIKING_PREFERENCES_GROUP_KEY);
2702f416 190
b49d8528
RN
191 // New Tab
192 a_preferences_register_group ( VIKING_PREFERENCES_STARTUP_GROUP_KEY, _("Startup") );
193
1219fd23
RN
194 tmp.b = FALSE;
195 a_preferences_register(&startup_prefs[0], tmp, VIKING_PREFERENCES_STARTUP_GROUP_KEY);
196
8fa25c61
RN
197 tmp.b = FALSE;
198 a_preferences_register(&startup_prefs[1], tmp, VIKING_PREFERENCES_STARTUP_GROUP_KEY);
199
7143d1e4
RN
200 tmp.u = VIK_STARTUP_METHOD_HOME_LOCATION;
201 a_preferences_register(&startup_prefs[2], tmp, VIKING_PREFERENCES_STARTUP_GROUP_KEY);
202
203 tmp.s = "";
204 a_preferences_register(&startup_prefs[3], tmp, VIKING_PREFERENCES_STARTUP_GROUP_KEY);
205
91fc9c76
RN
206 tmp.b = FALSE;
207 a_preferences_register(&startup_prefs[4], tmp, VIKING_PREFERENCES_STARTUP_GROUP_KEY);
208
2702f416
RN
209 // New Tab
210 a_preferences_register_group ( VIKING_PREFERENCES_IO_GROUP_KEY, _("Export/External") );
60dbd0ad
RN
211
212 tmp.u = VIK_KML_EXPORT_UNITS_METRIC;
213 a_preferences_register(&io_prefs[0], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
3317dc4e 214
d13f1a57
RN
215 tmp.u = VIK_GPX_EXPORT_TRK_SORT_TIME;
216 a_preferences_register(&io_prefs[1], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
217
5f2a108d 218 tmp.b = VIK_GPX_EXPORT_WPT_SYM_NAME_TITLECASE;
72f067ad
RN
219 a_preferences_register(&io_prefs[2], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
220
3317dc4e 221#ifndef WINDOWS
0b386bf3 222 tmp.s = "xdg-open";
3317dc4e
RN
223 a_preferences_register(&io_prefs_non_windows[0], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
224#endif
ccccf356 225
1e6db2e3 226 // JOSM for OSM editing around a GPX track
ccccf356
RN
227 tmp.s = "josm";
228 a_preferences_register(&io_prefs_external_gpx[0], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
ff02058b
RN
229 // Add a second external program - another OSM editor by default
230 tmp.s = "merkaartor";
231 a_preferences_register(&io_prefs_external_gpx[1], tmp, VIKING_PREFERENCES_IO_GROUP_KEY);
29277258
RN
232
233 // 'Advanced' Properties
234 a_preferences_register_group ( VIKING_PREFERENCES_ADVANCED_GROUP_KEY, _("Advanced") );
88542aa9
RN
235
236 tmp.u = VIK_FILE_REF_FORMAT_ABSOLUTE;
237 a_preferences_register(&prefs_advanced[0], tmp, VIKING_PREFERENCES_ADVANCED_GROUP_KEY);
90611609
RN
238
239 tmp.b = TRUE;
240 a_preferences_register(&prefs_advanced[1], tmp, VIKING_PREFERENCES_ADVANCED_GROUP_KEY);
50843c96
RN
241
242 tmp.i = 10; // Seemingly GTK's default for the number of recent files
243 a_preferences_register(&prefs_advanced[2], tmp, VIKING_PREFERENCES_ADVANCED_GROUP_KEY);
a58aaed4
GB
244}
245
246vik_degree_format_t a_vik_get_degree_format ( )
247{
248 vik_degree_format_t format;
249 format = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "degree_format")->u;
250 return format;
a58aaed4 251}
6f9336aa
RN
252
253vik_units_distance_t a_vik_get_units_distance ( )
254{
255 vik_units_distance_t units;
256 units = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "units_distance")->u;
257 return units;
258}
13bdea80
RN
259
260vik_units_speed_t a_vik_get_units_speed ( )
261{
262 vik_units_speed_t units;
263 units = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "units_speed")->u;
264 return units;
265}
6027a9c5
RN
266
267vik_units_height_t a_vik_get_units_height ( )
268{
269 vik_units_height_t units;
270 units = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "units_height")->u;
271 return units;
272}
9be0449f
RN
273
274gboolean a_vik_get_use_large_waypoint_icons ( )
275{
276 gboolean use_large_waypoint_icons;
277 use_large_waypoint_icons = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "use_large_waypoint_icons")->b;
278 return use_large_waypoint_icons;
279}
5210c3d3
GB
280
281gdouble a_vik_get_default_lat ( )
282{
283 gdouble data;
284 data = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "default_latitude")->d;
285 return data;
286}
287
288gdouble a_vik_get_default_long ( )
289{
290 gdouble data;
291 data = a_preferences_get(VIKING_PREFERENCES_NAMESPACE "default_longitude")->d;
292 return data;
293}
60dbd0ad
RN
294
295/* External/Export Options */
296
297vik_kml_export_units_t a_vik_get_kml_export_units ( )
298{
299 vik_kml_export_units_t units;
71eede92 300 units = a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "kml_export_units")->u;
60dbd0ad
RN
301 return units;
302}
3317dc4e 303
d13f1a57
RN
304vik_gpx_export_trk_sort_t a_vik_get_gpx_export_trk_sort ( )
305{
306 vik_gpx_export_trk_sort_t sort;
307 sort = a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "gpx_export_track_sort")->u;
308 return sort;
309}
310
72f067ad
RN
311vik_gpx_export_wpt_sym_name_t a_vik_gpx_export_wpt_sym_name ( )
312{
313 gboolean val;
5f2a108d 314 val = a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "gpx_export_wpt_sym_names")->b;
72f067ad
RN
315 return val;
316}
317
3317dc4e
RN
318#ifndef WINDOWS
319const gchar* a_vik_get_image_viewer ( )
320{
321 return a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "image_viewer")->s;
322}
323#endif
ccccf356
RN
324
325const gchar* a_vik_get_external_gpx_program_1 ( )
326{
327 return a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "external_gpx_1")->s;
328}
ff02058b
RN
329
330const gchar* a_vik_get_external_gpx_program_2 ( )
331{
332 return a_preferences_get(VIKING_PREFERENCES_IO_NAMESPACE "external_gpx_2")->s;
333}
88542aa9 334
50843c96 335// Advanced Options
88542aa9
RN
336vik_file_ref_format_t a_vik_get_file_ref_format ( )
337{
338 vik_file_ref_format_t format;
339 format = a_preferences_get(VIKING_PREFERENCES_ADVANCED_NAMESPACE "save_file_reference_mode")->u;
340 return format;
341}
90611609
RN
342
343gboolean a_vik_get_create_track_tooltip ( )
344{
345 return a_preferences_get(VIKING_PREFERENCES_ADVANCED_NAMESPACE "create_track_tooltip")->b;
346}
1219fd23 347
50843c96
RN
348gint a_vik_get_recent_number_files ( )
349{
350 return a_preferences_get(VIKING_PREFERENCES_ADVANCED_NAMESPACE "number_recent_files")->i;
351}
352
1219fd23
RN
353// Startup Options
354gboolean a_vik_get_restore_window_state ( )
355{
356 gboolean data;
357 data = a_preferences_get(VIKING_PREFERENCES_STARTUP_NAMESPACE "restore_window_state")->b;
358 return data;
359}
8fa25c61
RN
360
361gboolean a_vik_get_add_default_map_layer ( )
362{
363 gboolean data;
364 data = a_preferences_get(VIKING_PREFERENCES_STARTUP_NAMESPACE "add_default_map_layer")->b;
365 return data;
366}
7143d1e4
RN
367
368vik_startup_method_t a_vik_get_startup_method ( )
369{
370 vik_startup_method_t data;
371 data = a_preferences_get(VIKING_PREFERENCES_STARTUP_NAMESPACE "startup_method")->u;
372 return data;
373}
374
375const gchar *a_vik_get_startup_file ( )
376{
377 return a_preferences_get(VIKING_PREFERENCES_STARTUP_NAMESPACE "startup_file")->s;
378}
91fc9c76
RN
379
380gboolean a_vik_get_check_version ( )
381{
382 return a_preferences_get(VIKING_PREFERENCES_STARTUP_NAMESPACE "check_version")->b;
383}