78 |
{ "cachelist_items", STORE_INT, OFFSET(cachelist_items) }, |
{ "cachelist_items", STORE_INT, OFFSET(cachelist_items) }, |
79 |
{ "compass_damping", STORE_INT, OFFSET(compass_damping) }, |
{ "compass_damping", STORE_INT, OFFSET(compass_damping) }, |
80 |
{ "cachelist_hide_found", STORE_BOOL, OFFSET(cachelist_hide_found) }, |
{ "cachelist_hide_found", STORE_BOOL, OFFSET(cachelist_hide_found) }, |
81 |
|
{ "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, |
82 |
|
{ "disable_gcvote", STORE_BOOL, OFFSET(disable_gcvote) }, |
83 |
#ifdef USE_MAEMO |
#ifdef USE_MAEMO |
84 |
{ "mmpoi_dontlaunch", STORE_BOOL, OFFSET(mmpoi_dontlaunch) }, |
{ "mmpoi_dontlaunch", STORE_BOOL, OFFSET(mmpoi_dontlaunch) }, |
85 |
{ "cachelist_dss", STORE_BOOL, OFFSET(cachelist_disable_screensaver) }, |
{ "cachelist_dss", STORE_BOOL, OFFSET(cachelist_disable_screensaver) }, |
86 |
{ "goto_dss", STORE_BOOL, OFFSET(goto_disable_screensaver) }, |
{ "goto_dss", STORE_BOOL, OFFSET(goto_disable_screensaver) }, |
|
{ "cachelist_update", STORE_BOOL, OFFSET(cachelist_update) }, |
|
87 |
#endif |
#endif |
88 |
#ifdef ENABLE_OSM_GPS_MAP |
#ifdef ENABLE_OSM_GPS_MAP |
89 |
{ "map_lat", STORE_FLOAT, OFFSET(map.pos.lat) }, |
{ "map_lat", STORE_FLOAT, OFFSET(map.pos.lat) }, |
133 |
void gconf_save_state(appdata_t *appdata) { |
void gconf_save_state(appdata_t *appdata) { |
134 |
int entries = 0; |
int entries = 0; |
135 |
|
|
136 |
|
/* free proxy settings */ |
137 |
|
if(appdata->proxy) { |
138 |
|
proxy_t *proxy = appdata->proxy; |
139 |
|
|
140 |
|
if(proxy->authentication_password) g_free(proxy->authentication_password); |
141 |
|
if(proxy->authentication_user) g_free(proxy->authentication_user); |
142 |
|
if(proxy->host) g_free(proxy->host); |
143 |
|
if(proxy->ignore_hosts) g_free(proxy->ignore_hosts); |
144 |
|
|
145 |
|
g_free(proxy); |
146 |
|
appdata->proxy = NULL; |
147 |
|
} |
148 |
|
|
149 |
gpx_t *gpx = appdata->gpx; |
gpx_t *gpx = appdata->gpx; |
150 |
while(gpx) { |
while(gpx) { |
151 |
char str[128]; |
char str[128]; |
221 |
appdata->manual_goto.lat = appdata->manual_goto.lon = NAN; |
appdata->manual_goto.lat = appdata->manual_goto.lon = NAN; |
222 |
appdata->gps.lat = appdata->gps.lon = NAN; |
appdata->gps.lat = appdata->gps.lon = NAN; |
223 |
|
|
224 |
|
/* ------------- get proxy settings -------------------- */ |
225 |
|
if(gconf_client_get_bool(appdata->gconf_client, |
226 |
|
PROXY_KEY "use_http_proxy", NULL)) { |
227 |
|
proxy_t *proxy = appdata->proxy = g_new0(proxy_t, 1); |
228 |
|
|
229 |
|
/* get basic settings */ |
230 |
|
proxy->host = gconf_client_get_string(appdata->gconf_client, |
231 |
|
PROXY_KEY "host", NULL); |
232 |
|
proxy->port = gconf_client_get_int(appdata->gconf_client, |
233 |
|
PROXY_KEY "port", NULL); |
234 |
|
proxy->ignore_hosts = |
235 |
|
gconf_client_get_string(appdata->gconf_client, |
236 |
|
PROXY_KEY "ignore_hosts", NULL); |
237 |
|
|
238 |
|
/* check for authentication */ |
239 |
|
proxy->use_authentication = |
240 |
|
gconf_client_get_bool(appdata->gconf_client, |
241 |
|
PROXY_KEY "use_authentication", NULL); |
242 |
|
|
243 |
|
if(proxy->use_authentication) { |
244 |
|
proxy->authentication_user = |
245 |
|
gconf_client_get_string(appdata->gconf_client, |
246 |
|
PROXY_KEY "authentication_user", NULL); |
247 |
|
proxy->authentication_password = |
248 |
|
gconf_client_get_string(appdata->gconf_client, |
249 |
|
PROXY_KEY "authentication_password", NULL); |
250 |
|
} |
251 |
|
} |
252 |
|
|
253 |
int i, entries = gconf_client_get_int(appdata->gconf_client, |
int i, entries = gconf_client_get_int(appdata->gconf_client, |
254 |
GCONF_KEY_CNT, NULL); |
GCONF_KEY_CNT, NULL); |
255 |
|
|
279 |
/* restoring the gpx file failed, mark it as unusable, but save */ |
/* restoring the gpx file failed, mark it as unusable, but save */ |
280 |
/* its presence for later use */ |
/* its presence for later use */ |
281 |
|
|
282 |
/* create fake entry to remember this file for next load attempt */ |
/* create "closed" entry to remember this file for next */ |
283 |
|
/* load attempt */ |
284 |
*gpx = g_new0(gpx_t, 1); |
*gpx = g_new0(gpx_t, 1); |
285 |
(*gpx)->filename = fname; |
(*gpx)->filename = fname; |
286 |
(*gpx)->failed = TRUE; |
char *p = fname; |
287 |
|
if(strrchr(fname, '/')) |
288 |
|
p = strrchr(fname, '/')+1; |
289 |
|
|
290 |
|
(*gpx)->name = g_strdup_printf(_("Failed to load: %s"), p); |
291 |
|
(*gpx)->closed = TRUE; |
292 |
} else |
} else |
293 |
free(fname); |
free(fname); |
294 |
} |
} |
367 |
appdata->search = SEARCH_NAME | SEARCH_ID; |
appdata->search = SEARCH_NAME | SEARCH_ID; |
368 |
|
|
369 |
if(!appdata->image_path) { |
if(!appdata->image_path) { |
370 |
|
#ifdef USE_MAEMO |
371 |
|
/* update cachelist by default */ |
372 |
|
appdata->cachelist_update = TRUE; |
373 |
|
#endif |
374 |
|
|
375 |
/* use gps by default */ |
/* use gps by default */ |
376 |
appdata->use_gps = TRUE; |
appdata->use_gps = TRUE; |