Diff of /trunk/src/map-tool.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 242 by harbaum, Sun Dec 13 19:57:02 2009 UTC revision 243 by harbaum, Mon Dec 14 20:07:54 2009 UTC
# Line 708  balloon_cb(osm_gps_map_balloon_event_t * Line 708  balloon_cb(osm_gps_map_balloon_event_t *
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;
# Line 734  balloon_cb(osm_gps_map_balloon_event_t * Line 738  balloon_cb(osm_gps_map_balloon_event_t *
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));

Legend:
Removed from v.242  
changed lines
  Added in v.243