--- trunk/src/misc.c 2009/11/25 20:19:32 213 +++ trunk/src/misc.c 2009/11/26 10:05:23 214 @@ -628,7 +628,7 @@ GtkWidget *lat_entry, GtkWidget *lon_entry) { GtkWidget *menu = gtk_menu_new(); - menu_add(menu, appdata, icon_get_widget(ICON_POS, 7), + menu_add(menu, appdata, icon_get_widget(ICON_POS, 18), _("Current position (GPS)"), cb_gps, lon_entry, lat_entry); menu_add(menu, appdata, NULL, _("Geomath projection"), cb_geomath, lon_entry, lat_entry); @@ -636,12 +636,14 @@ menu_add(menu, appdata, NULL, _("Map position"), cb_map, lon_entry, lat_entry); #endif + + printf("popup cache present: %s\n", appdata->cur_cache?"Yes":"No"); if(appdata->cur_cache) { cache_t *cache = appdata->cur_cache; if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) { - menu_add(menu, appdata, icon_get_widget(ICON_CACHE_TYPE, cache->type), + menu_add(menu, appdata, icon_get_widget(ICON_POS, cache->type + 6), cache->id, cb_cache, lon_entry, lat_entry); } @@ -692,7 +694,7 @@ (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH)); #endif - 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)); gtk_widget_set_tooltip_text(button, _("Preset coordinates")); @@ -715,3 +717,10 @@ return hildon_entry_new(HILDON_SIZE_AUTO); #endif } + +gboolean pos_differ(pos_t *pos1, pos_t *pos2) { + int lat1 = (60000 * pos1->lat)+0.5, lon1 = (60000 * pos1->lon)+0.5; + int lat2 = (60000 * pos2->lat)+0.5, lon2 = (60000 * pos2->lon)+0.5; + + return((lat1 != lat2) || (lon1 != lon2)); +}