--- trunk/src/map-tool.c 2009/10/23 06:28:21 141 +++ trunk/src/map-tool.c 2009/10/26 10:40:06 142 @@ -444,6 +444,50 @@ 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->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; + while(gpx && !is_in) { + cache_t *cur = gpx->cache; + while(cur && !is_in) { + if(cur == cache) + is_in = gpx; + cur = cur->next; + } + gpx = gpx->next; + } + + if(is_in) + gpxlist_goto_cachelist(context->appdata, is_in); + + } else + /* 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->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)); + } + } + } } else if(event->type == OSM_GPS_MAP_BALLOON_EVENT_TYPE_REMOVED) { printf("removed\n"); context->balloon = NULL; @@ -602,7 +646,7 @@ } if(name) { - char *title = g_strdup_printf(_("Map - %s"), name); + char *title = g_strdup_printf("%s - %s", _("Map"), name); g_free(name); gtk_window_set_title(GTK_WINDOW(context->window), title);