--- trunk/src/map-tool.c 2009/12/13 19:57:02 242 +++ trunk/src/map-tool.c 2009/12/14 20:07:54 243 @@ -708,17 +708,21 @@ printf("click %s event at %d %d\n", event->data.click.down?"down":"up", event->data.click.x, event->data.click.y); - + /* make the main screen jump to that cache */ if(!event->data.click.down) { if(context->appdata->cur_cache) { printf("ERROR: no current cache should be visible!\n"); } else { gpx_t *is_in = NULL; + + if(context->appdata->search_results) { + printf("click while in \"search results\" view\n"); - if(!context->appdata->cur_gpx) { + is_in = context->appdata->search_results; + } else if(!context->appdata->cur_gpx) { printf("click while in \"all\" view\n"); - + /* we first need to figure out which gpx file this cache */ /* is in so we can open it first */ gpx_t *gpx = context->appdata->gpx; @@ -734,19 +738,24 @@ if(is_in) gpxlist_goto_cachelist(context->appdata, is_in); - - } else + + } else { + printf("click while in \"cachelist\" view\n"); + /* the simple case: there already is an open gpx file and */ /* we just jump into the "cache" view */ is_in = context->appdata->cur_gpx; - + } + if(is_in) { printf("selecting %s in %s\n", cache->id, + context->appdata->search_results? + context->appdata->search_results->name: context->appdata->cur_gpx->name); - + cachelist_goto_cache(context->appdata, cache); - + /* give focus to main screen (important for maemo) */ printf("raising main window\n"); gtk_window_present(GTK_WINDOW(context->appdata->window));