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) }, |
91 |
{ "map_zoom", STORE_INT, OFFSET(map.zoom) }, |
{ "map_zoom", STORE_INT, OFFSET(map.zoom) }, |
92 |
{ "map_source", STORE_INT, OFFSET(map.source) }, |
{ "map_source", STORE_INT, OFFSET(map.source) }, |
93 |
#endif |
#endif |
94 |
|
|
95 |
|
{ "gt_username", STORE_STRING, OFFSET(gt.username) }, |
96 |
|
{ "gt_password", STORE_STRING, OFFSET(gt.password) }, |
97 |
|
{ "gt_filename", STORE_STRING, OFFSET(gt.filename) }, |
98 |
|
{ "gt_distance", STORE_FLOAT, OFFSET(gt.distance) }, |
99 |
|
{ "gt_lat", STORE_FLOAT, OFFSET(gt.lat) }, |
100 |
|
{ "gt_lon", STORE_FLOAT, OFFSET(gt.lon) }, |
101 |
|
{ "gt_flags", STORE_INT, OFFSET(gt.flags) }, |
102 |
|
|
103 |
{ NULL, -1, -1 } |
{ NULL, -1, -1 } |
104 |
}; |
}; |
105 |
|
|
142 |
void gconf_save_state(appdata_t *appdata) { |
void gconf_save_state(appdata_t *appdata) { |
143 |
int entries = 0; |
int entries = 0; |
144 |
|
|
145 |
|
/* free proxy settings */ |
146 |
|
if(appdata->proxy) { |
147 |
|
proxy_t *proxy = appdata->proxy; |
148 |
|
|
149 |
|
if(proxy->authentication_password) g_free(proxy->authentication_password); |
150 |
|
if(proxy->authentication_user) g_free(proxy->authentication_user); |
151 |
|
if(proxy->host) g_free(proxy->host); |
152 |
|
if(proxy->ignore_hosts) g_free(proxy->ignore_hosts); |
153 |
|
|
154 |
|
g_free(proxy); |
155 |
|
appdata->proxy = NULL; |
156 |
|
} |
157 |
|
|
158 |
gpx_t *gpx = appdata->gpx; |
gpx_t *gpx = appdata->gpx; |
159 |
while(gpx) { |
while(gpx) { |
160 |
char str[128]; |
char str[128]; |
193 |
if((char*)(*ptr)) { |
if((char*)(*ptr)) { |
194 |
gconf_client_set_string(appdata->gconf_client, key, (char*)(*ptr), NULL); |
gconf_client_set_string(appdata->gconf_client, key, (char*)(*ptr), NULL); |
195 |
} |
} |
196 |
|
g_free((char*)(*ptr)); |
197 |
|
*ptr = NULL; |
198 |
break; |
break; |
199 |
|
|
200 |
case STORE_BOOL: |
case STORE_BOOL: |
232 |
appdata->manual_goto.lat = appdata->manual_goto.lon = NAN; |
appdata->manual_goto.lat = appdata->manual_goto.lon = NAN; |
233 |
appdata->gps.lat = appdata->gps.lon = NAN; |
appdata->gps.lat = appdata->gps.lon = NAN; |
234 |
|
|
235 |
|
appdata->gt.lat = appdata->gt.lon = NAN; |
236 |
|
|
237 |
|
/* ------------- get proxy settings -------------------- */ |
238 |
|
if(gconf_client_get_bool(appdata->gconf_client, |
239 |
|
PROXY_KEY "use_http_proxy", NULL)) { |
240 |
|
proxy_t *proxy = appdata->proxy = g_new0(proxy_t, 1); |
241 |
|
|
242 |
|
/* get basic settings */ |
243 |
|
proxy->host = gconf_client_get_string(appdata->gconf_client, |
244 |
|
PROXY_KEY "host", NULL); |
245 |
|
proxy->port = gconf_client_get_int(appdata->gconf_client, |
246 |
|
PROXY_KEY "port", NULL); |
247 |
|
proxy->ignore_hosts = |
248 |
|
gconf_client_get_string(appdata->gconf_client, |
249 |
|
PROXY_KEY "ignore_hosts", NULL); |
250 |
|
|
251 |
|
/* check for authentication */ |
252 |
|
proxy->use_authentication = |
253 |
|
gconf_client_get_bool(appdata->gconf_client, |
254 |
|
PROXY_KEY "use_authentication", NULL); |
255 |
|
|
256 |
|
if(proxy->use_authentication) { |
257 |
|
proxy->authentication_user = |
258 |
|
gconf_client_get_string(appdata->gconf_client, |
259 |
|
PROXY_KEY "authentication_user", NULL); |
260 |
|
proxy->authentication_password = |
261 |
|
gconf_client_get_string(appdata->gconf_client, |
262 |
|
PROXY_KEY "authentication_password", NULL); |
263 |
|
} |
264 |
|
} |
265 |
|
|
266 |
int i, entries = gconf_client_get_int(appdata->gconf_client, |
int i, entries = gconf_client_get_int(appdata->gconf_client, |
267 |
GCONF_KEY_CNT, NULL); |
GCONF_KEY_CNT, NULL); |
268 |
|
|
380 |
appdata->search = SEARCH_NAME | SEARCH_ID; |
appdata->search = SEARCH_NAME | SEARCH_ID; |
381 |
|
|
382 |
if(!appdata->image_path) { |
if(!appdata->image_path) { |
383 |
|
#ifdef USE_MAEMO |
384 |
|
/* update cachelist by default */ |
385 |
|
appdata->cachelist_update = TRUE; |
386 |
|
#endif |
387 |
|
|
388 |
/* use gps by default */ |
/* use gps by default */ |
389 |
appdata->use_gps = TRUE; |
appdata->use_gps = TRUE; |