708 |
printf("click %s event at %d %d\n", |
printf("click %s event at %d %d\n", |
709 |
event->data.click.down?"down":"up", |
event->data.click.down?"down":"up", |
710 |
event->data.click.x, event->data.click.y); |
event->data.click.x, event->data.click.y); |
711 |
|
|
712 |
/* make the main screen jump to that cache */ |
/* make the main screen jump to that cache */ |
713 |
if(!event->data.click.down) { |
if(!event->data.click.down) { |
714 |
if(context->appdata->cur_cache) { |
if(context->appdata->cur_cache) { |
715 |
printf("ERROR: no current cache should be visible!\n"); |
printf("ERROR: no current cache should be visible!\n"); |
716 |
} else { |
} else { |
717 |
gpx_t *is_in = NULL; |
gpx_t *is_in = NULL; |
718 |
|
|
719 |
|
if(context->appdata->search_results) { |
720 |
|
printf("click while in \"search results\" view\n"); |
721 |
|
|
722 |
if(!context->appdata->cur_gpx) { |
is_in = context->appdata->search_results; |
723 |
|
} else if(!context->appdata->cur_gpx) { |
724 |
printf("click while in \"all\" view\n"); |
printf("click while in \"all\" view\n"); |
725 |
|
|
726 |
/* we first need to figure out which gpx file this cache */ |
/* we first need to figure out which gpx file this cache */ |
727 |
/* is in so we can open it first */ |
/* is in so we can open it first */ |
728 |
gpx_t *gpx = context->appdata->gpx; |
gpx_t *gpx = context->appdata->gpx; |
738 |
|
|
739 |
if(is_in) |
if(is_in) |
740 |
gpxlist_goto_cachelist(context->appdata, is_in); |
gpxlist_goto_cachelist(context->appdata, is_in); |
741 |
|
|
742 |
} else |
} else { |
743 |
|
printf("click while in \"cachelist\" view\n"); |
744 |
|
|
745 |
/* the simple case: there already is an open gpx file and */ |
/* the simple case: there already is an open gpx file and */ |
746 |
/* we just jump into the "cache" view */ |
/* we just jump into the "cache" view */ |
747 |
is_in = context->appdata->cur_gpx; |
is_in = context->appdata->cur_gpx; |
748 |
|
} |
749 |
|
|
750 |
if(is_in) { |
if(is_in) { |
751 |
printf("selecting %s in %s\n", |
printf("selecting %s in %s\n", |
752 |
cache->id, |
cache->id, |
753 |
|
context->appdata->search_results? |
754 |
|
context->appdata->search_results->name: |
755 |
context->appdata->cur_gpx->name); |
context->appdata->cur_gpx->name); |
756 |
|
|
757 |
cachelist_goto_cache(context->appdata, cache); |
cachelist_goto_cache(context->appdata, cache); |
758 |
|
|
759 |
/* give focus to main screen (important for maemo) */ |
/* give focus to main screen (important for maemo) */ |
760 |
printf("raising main window\n"); |
printf("raising main window\n"); |
761 |
gtk_window_present(GTK_WINDOW(context->appdata->window)); |
gtk_window_present(GTK_WINDOW(context->appdata->window)); |