444 |
event->data.click.down?"down":"up", |
event->data.click.down?"down":"up", |
445 |
event->data.click.x, event->data.click.y); |
event->data.click.x, event->data.click.y); |
446 |
|
|
447 |
|
/* make the main screen jump to that cache */ |
448 |
|
if(!event->data.click.down) { |
449 |
|
if(context->appdata->cur_cache) { |
450 |
|
printf("ERROR: no current cache should be visible!\n"); |
451 |
|
} else { |
452 |
|
gpx_t *is_in = NULL; |
453 |
|
|
454 |
|
if(!context->appdata->cur_gpx) { |
455 |
|
printf("click while in \"all\" view\n"); |
456 |
|
|
457 |
|
/* we first need to figure out which gpx file this cache */ |
458 |
|
/* is in so we can open it first */ |
459 |
|
gpx_t *gpx = context->appdata->gpx; |
460 |
|
while(gpx && !is_in) { |
461 |
|
cache_t *cur = gpx->cache; |
462 |
|
while(cur && !is_in) { |
463 |
|
if(cur == cache) |
464 |
|
is_in = gpx; |
465 |
|
cur = cur->next; |
466 |
|
} |
467 |
|
gpx = gpx->next; |
468 |
|
} |
469 |
|
|
470 |
|
if(is_in) |
471 |
|
gpxlist_goto_cachelist(context->appdata, is_in); |
472 |
|
|
473 |
|
} else |
474 |
|
/* the simple case: there already is an open gpx file and */ |
475 |
|
/* we just jump into the "cache" view */ |
476 |
|
is_in = context->appdata->cur_gpx; |
477 |
|
|
478 |
|
if(is_in) { |
479 |
|
printf("selecting %s in %s\n", |
480 |
|
cache->id, |
481 |
|
context->appdata->cur_gpx->name); |
482 |
|
|
483 |
|
cachelist_goto_cache(context->appdata, cache); |
484 |
|
|
485 |
|
/* give focus to main screen (important for maemo) */ |
486 |
|
printf("raising main window\n"); |
487 |
|
gtk_window_present(GTK_WINDOW(context->appdata->window)); |
488 |
|
} |
489 |
|
} |
490 |
|
} |
491 |
} else if(event->type == OSM_GPS_MAP_BALLOON_EVENT_TYPE_REMOVED) { |
} else if(event->type == OSM_GPS_MAP_BALLOON_EVENT_TYPE_REMOVED) { |
492 |
printf("removed\n"); |
printf("removed\n"); |
493 |
context->balloon = NULL; |
context->balloon = NULL; |
646 |
} |
} |
647 |
|
|
648 |
if(name) { |
if(name) { |
649 |
char *title = g_strdup_printf(_("Map - %s"), name); |
char *title = g_strdup_printf("%s - %s", _("Map"), name); |
650 |
g_free(name); |
g_free(name); |
651 |
|
|
652 |
gtk_window_set_title(GTK_WINDOW(context->window), title); |
gtk_window_set_title(GTK_WINDOW(context->window), title); |