584 |
g_strdup(gtk_label_get_text(GTK_LABEL(context->filename))); |
g_strdup(gtk_label_get_text(GTK_LABEL(context->filename))); |
585 |
|
|
586 |
/* get distance in kilometers */ |
/* get distance in kilometers */ |
587 |
appdata->gt.distance = dist_get(context->dst, FALSE); |
appdata->gt.distance = dist_entry_get(context->dst, FALSE); |
588 |
|
|
589 |
|
|
590 |
/* check for valid entries */ |
/* check for valid entries */ |
627 |
while(*gpx && strcmp((*gpx)->filename, appdata->gt.filename)) |
while(*gpx && strcmp((*gpx)->filename, appdata->gt.filename)) |
628 |
gpx = &(*gpx)->next; |
gpx = &(*gpx)->next; |
629 |
|
|
630 |
if(*gpx) { |
/* return main GUI to GPX list */ |
|
/* return main GUI to GPX list */ |
|
|
|
|
631 |
#ifdef USE_BREAD_CRUMB_TRAIL |
#ifdef USE_BREAD_CRUMB_TRAIL |
632 |
while(appdata->cur_gpx) |
while(appdata->cur_gpx) |
633 |
hildon_bread_crumb_trail_pop(HILDON_BREAD_CRUMB_TRAIL(appdata->bct)); |
hildon_bread_crumb_trail_pop(HILDON_BREAD_CRUMB_TRAIL(appdata->bct)); |
634 |
#elif defined(BCT) |
#elif defined(BCT) |
635 |
while(appdata->cur_gpx) |
while(appdata->cur_gpx) |
636 |
bct_pop(appdata->bct); |
bct_pop(appdata->bct); |
637 |
#else |
#else |
638 |
HildonWindowStack *stack = hildon_window_stack_get_default(); |
HildonWindowStack *stack = hildon_window_stack_get_default(); |
639 |
gint num = hildon_window_stack_size(stack)-1; |
gint num = hildon_window_stack_size(stack)-1; |
640 |
while(num--) { |
while(num--) { |
641 |
GtkWidget *top = hildon_window_stack_peek(stack); |
GtkWidget *top = hildon_window_stack_peek(stack); |
642 |
gtk_widget_destroy(top); |
gtk_widget_destroy(top); |
643 |
} |
} |
644 |
#endif |
#endif |
645 |
|
|
646 |
|
/* replace an existing entry or add to end of list */ |
647 |
|
if(*gpx) { |
648 |
GtkTreeIter iter; |
GtkTreeIter iter; |
649 |
g_assert(gpxlist_find(appdata, &iter, *gpx)); |
g_assert(gpxlist_find(appdata, &iter, *gpx)); |
650 |
|
|
666 |
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(appdata->gpxview), |
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(appdata->gpxview), |
667 |
path, NULL, TRUE, 0.0, 0.0); |
path, NULL, TRUE, 0.0, 0.0); |
668 |
gtk_tree_path_free(path); |
gtk_tree_path_free(path); |
669 |
|
} else { |
670 |
} else |
gpx_t *new = gpx_parse(NULL, appdata->gt.filename, appdata->username); |
671 |
printf("GPX file not imported\n"); |
if(new) gpxlist_add(appdata, new); |
672 |
|
} |
673 |
} |
} |
674 |
|
|
675 |
printf("main context free\n"); |
printf("main context free\n"); |