152 |
dialog->dialog = gtk_dialog_new(); |
dialog->dialog = gtk_dialog_new(); |
153 |
|
|
154 |
gtk_dialog_set_has_separator(GTK_DIALOG(dialog->dialog), FALSE); |
gtk_dialog_set_has_separator(GTK_DIALOG(dialog->dialog), FALSE); |
155 |
gtk_window_set_title(GTK_WINDOW(dialog->dialog), _("Loading...")); |
gtk_window_set_title(GTK_WINDOW(dialog->dialog), _("Loading")); |
156 |
gtk_window_set_default_size(GTK_WINDOW(dialog->dialog), 300, 10); |
gtk_window_set_default_size(GTK_WINDOW(dialog->dialog), 300, 10); |
157 |
|
|
158 |
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE); |
gtk_window_set_modal(GTK_WINDOW(dialog->dialog), TRUE); |
159 |
gtk_window_set_transient_for(GTK_WINDOW(dialog->dialog), GTK_WINDOW(parent)); |
gtk_window_set_transient_for(GTK_WINDOW(dialog->dialog), GTK_WINDOW(parent)); |
160 |
|
|
161 |
dialog->label = gtk_label_new("---"); |
dialog->label = gtk_label_new("---"); |
764 |
/* neither geocaching.com GC* nor opencaching.com OC* nor */ |
/* neither geocaching.com GC* nor opencaching.com OC* nor */ |
765 |
/* geocaching australia GA* waypoint */ |
/* geocaching australia GA* waypoint */ |
766 |
if(cache->id && |
if(cache->id && |
767 |
|
(strncasecmp(cache->id, "__", 2) != 0) && |
768 |
(strncasecmp(cache->id, "GC", 2) != 0) && |
(strncasecmp(cache->id, "GC", 2) != 0) && |
769 |
(strncasecmp(cache->id, "OC", 2) != 0) && |
(strncasecmp(cache->id, "OC", 2) != 0) && |
770 |
(strncasecmp(cache->id, "GA", 2) != 0)) { |
(strncasecmp(cache->id, "GA", 2) != 0)) { |
1070 |
*dot = 0; |
*dot = 0; |
1071 |
snprintf(wpts_name, sizeof(wpts_name), "%s-wpts.gpx", filename); |
snprintf(wpts_name, sizeof(wpts_name), "%s-wpts.gpx", filename); |
1072 |
*dot = '.'; |
*dot = '.'; |
|
|
|
1073 |
if(g_file_test(wpts_name, G_FILE_TEST_EXISTS)) { |
if(g_file_test(wpts_name, G_FILE_TEST_EXISTS)) { |
|
|
|
1074 |
xmlTextReaderPtr reader = xmlReaderForFile(wpts_name, NULL, 0); |
xmlTextReaderPtr reader = xmlReaderForFile(wpts_name, NULL, 0); |
1075 |
if (reader != NULL) { |
if (reader != NULL) { |
1076 |
gpx = process_root(reader, dialog, wpts_name, gpx); |
gpx = process_root(reader, dialog, wpts_name, gpx); |
1355 |
distance_str(str, len, dist, mil); |
distance_str(str, len, dist, mil); |
1356 |
} |
} |
1357 |
|
|
|
/* http://library.gnome.org/devel/gtk/unstable/GtkRadioButton.html */ |
|
1358 |
void gpx_sort(gpx_t *gpx, int by, pos_t *refpos) { |
void gpx_sort(gpx_t *gpx, int by, pos_t *refpos) { |
1359 |
cache_t **new; |
cache_t **new; |
1360 |
cache_t *cur = gpx->cache; |
cache_t *cur = gpx->cache; |
1363 |
|
|
1364 |
gpx->cache = NULL; /* detach old chain */ |
gpx->cache = NULL; /* detach old chain */ |
1365 |
while(cur) { |
while(cur) { |
1366 |
float cur_dist = gpx_pos_get_distance(*refpos, gpx_cache_pos(cur), 0); |
float cur_dist = -1; |
1367 |
int cur_cnt = 0; |
int cur_cnt = 0; |
1368 |
|
|
1369 |
|
if(!isnan(cur->pos.lat) && !isnan(cur->pos.lon)) |
1370 |
|
cur_dist = gpx_pos_get_distance(*refpos, gpx_cache_pos(cur), 0); |
1371 |
|
|
1372 |
new = &(gpx->cache); |
new = &(gpx->cache); |
1373 |
|
|
1374 |
/* search for currect insertion point */ |
/* search for currect insertion point */ |