628 |
GtkWidget *lat_entry, GtkWidget *lon_entry) { |
GtkWidget *lat_entry, GtkWidget *lon_entry) { |
629 |
GtkWidget *menu = gtk_menu_new(); |
GtkWidget *menu = gtk_menu_new(); |
630 |
|
|
631 |
menu_add(menu, appdata, icon_get_widget(ICON_POS, 7), |
menu_add(menu, appdata, icon_get_widget(ICON_POS, 18), |
632 |
_("Current position (GPS)"), cb_gps, lon_entry, lat_entry); |
_("Current position (GPS)"), cb_gps, lon_entry, lat_entry); |
633 |
menu_add(menu, appdata, NULL, _("Geomath projection"), |
menu_add(menu, appdata, NULL, _("Geomath projection"), |
634 |
cb_geomath, lon_entry, lat_entry); |
cb_geomath, lon_entry, lat_entry); |
636 |
menu_add(menu, appdata, NULL, _("Map position"), |
menu_add(menu, appdata, NULL, _("Map position"), |
637 |
cb_map, lon_entry, lat_entry); |
cb_map, lon_entry, lat_entry); |
638 |
#endif |
#endif |
639 |
|
|
640 |
|
printf("popup cache present: %s\n", appdata->cur_cache?"Yes":"No"); |
641 |
|
|
642 |
if(appdata->cur_cache) { |
if(appdata->cur_cache) { |
643 |
cache_t *cache = appdata->cur_cache; |
cache_t *cache = appdata->cur_cache; |
644 |
|
|
645 |
if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) { |
if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) { |
646 |
menu_add(menu, appdata, icon_get_widget(ICON_CACHE_TYPE, cache->type), |
menu_add(menu, appdata, icon_get_widget(ICON_POS, cache->type + 6), |
647 |
cache->id, cb_cache, lon_entry, lat_entry); |
cache->id, cb_cache, lon_entry, lat_entry); |
648 |
} |
} |
649 |
|
|
694 |
(HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH)); |
(HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH)); |
695 |
#endif |
#endif |
696 |
|
|
697 |
gtk_button_set_image(GTK_BUTTON(button), icon_get_widget(ICON_POS, 6)); |
gtk_button_set_image(GTK_BUTTON(button), icon_get_widget(ICON_POS, 17)); |
698 |
|
|
699 |
gtk_widget_set_tooltip_text(button, _("Preset coordinates")); |
gtk_widget_set_tooltip_text(button, _("Preset coordinates")); |
700 |
|
|
717 |
return hildon_entry_new(HILDON_SIZE_AUTO); |
return hildon_entry_new(HILDON_SIZE_AUTO); |
718 |
#endif |
#endif |
719 |
} |
} |
720 |
|
|
721 |
|
gboolean pos_differ(pos_t *pos1, pos_t *pos2) { |
722 |
|
int lat1 = (60000 * pos1->lat)+0.5, lon1 = (60000 * pos1->lon)+0.5; |
723 |
|
int lat2 = (60000 * pos2->lat)+0.5, lon2 = (60000 * pos2->lon)+0.5; |
724 |
|
|
725 |
|
return((lat1 != lat2) || (lon1 != lon2)); |
726 |
|
} |