return TRUE;
}
+static void
+poi_button_set_icon(GtkWidget *button, node_type_t t)
+{
+const gchar *iname;
+GdkPixbuf *icon=NULL;
+
+iname=poi_get_icon_from_type(t);
+if (iname)
+ icon=poi_get_icon(iname, TRUE);
+if (icon) {
+ gtk_button_set_image(button, gtk_image_new_from_pixbuf(icon));
+ gtk_button_set_image_position(button, GTK_POS_TOP);
+}
+}
+
gboolean
poi_quick_dialog(gdouble lat, gdouble lon)
{
GtkWidget *table;
GtkWidget *buttons[POI_QUICK_BUTTONS];
+GtkWidget *otherbtn;
guint x,y;
qp.lat=lat;
for (x=0;x<3;x++) {
for (y=0;y<3;y++) {
guint p=x+y*3;
- const gchar *iname;
- GdkPixbuf *icon=NULL;
buttons[p]=gtk_button_new_with_label(quick_poi_categories[p].name);
- iname=poi_get_icon_from_type(quick_poi_categories[p].type);
- if (iname)
- icon=poi_get_icon(iname, TRUE);
- if (icon)
- gtk_button_set_image(buttons[p], gtk_image_new_from_pixbuf(icon));
-
+ poi_button_set_icon(buttons[p], quick_poi_categories[p].type);
gtk_table_attach(GTK_TABLE(table), buttons[p], x, x+1, y, y+1, GTK_FILL, 0, 2, 4);
g_signal_connect(G_OBJECT(buttons[p]), "clicked", G_CALLBACK(poi_quick_button_cb), GINT_TO_POINTER(quick_poi_categories[p].type));
}
}
+/* Other POI button */
+otherbtn=gtk_button_new_with_label("Other POI");
+poi_button_set_icon(otherbtn, NODE_AMENITY_GENERIC);
+g_signal_connect(G_OBJECT(otherbtn), "clicked", G_CALLBACK(poi_quick_button_cb), GINT_TO_POINTER(NODE_AMENITY_GENERIC));
+gtk_box_pack_start(GTK_BOX(GTK_DIALOG(qp.dialog)->vbox), otherbtn, TRUE, TRUE, 0);
+
+/* Optional Label */
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(qp.dialog)->vbox), qp.label = gtk_entry_new(), TRUE, TRUE, 0);
gtk_widget_show_all(qp.dialog);
{ NODE_AMENITY_TOWNHALL, "Townhall", "" , "", "#408090" },
{ NODE_AMENITY_WC, "WC/Toilets", "" , "public/toilets", "#e1d62c" },
{ NODE_AMENITY_TELEPHONE, "Telephone", "Public telephone" , "public/telephone", "#208060" },
- { NODE_TOURISM_ATTRACTION, "Attraction", "Something interesting" , "generic", "#005000" },
+ { NODE_TOURISM_ATTRACTION, "Attraction", "Something interesting" , "misc", "#005000" },
{ NODE_HISTORIC_MUSEUM, "Museum", "A place where objects of historical, artistic, or scientific interest are exhibited, preserved or studied." , "sightseeing/museum", "#202020" },
{ NODE_HISTORIC_CASTLE, "Castle", "Historical building or group of building used for defense by military forces, whose main structures are walls and towers." , "sightseeing/castle", "#404040" },
{ NODE_SPORT_SOCCER, "Soccer", "" , "sports/soccer", "#102080" },
{ NODE_SPORT_GOLF, "Golf", "" , "sports/golf", "#102080" },
{ NODE_SPORT_TENNIS, "Tennis", "" , "sports/tennis", "#101080" },
- { NODE_SPORT_BOWLING, "Bowling", "" , "", "#101080" },
- { NODE_SPORT_RUGBY, "Rugby", "" , "", "#101080" },
- { NODE_SPORT_CLIMBING, "Climbing", "" , "", "#101080" },
+ { NODE_SPORT_BOWLING, "Bowling", "" , "sports", "#101080" },
+ { NODE_SPORT_RUGBY, "Rugby", "" , "sports", "#101080" },
+ { NODE_SPORT_CLIMBING, "Climbing", "" , "sports", "#101080" },
{ NODE_SPORT_CYCLING, "Cycling", "" , "sports/bicycle", "#101080" },
- { NODE_SPORT_MOTOR, "Motor sport", "" , "", "#101080" },
- { NODE_SPORT_HOCKEY, "Hockey", "" , "", "#5050A0" },
- { NODE_SPORT_SKATING, "Skating", "" , "", "#5050A0" },
- { NODE_SPORT_SKATEBOARD, "Skateboard", "" , "", "#101080" },
+ { NODE_SPORT_MOTOR, "Motor sport", "" , "sports", "#101080" },
+ { NODE_SPORT_HOCKEY, "Hockey", "" , "sports", "#5050A0" },
+ { NODE_SPORT_SKATING, "Skating", "" , "sports", "#5050A0" },
+ { NODE_SPORT_SKATEBOARD, "Skateboard", "" , "sports", "#101080" },
{ NODE_SPORT_HORSES, "Horses", "Horse riding or racing" , "sports/riding", "#101080" },
- { NODE_SPORT_DOG, "Dog racing", "" , "", "#101080" },
- { NODE_SPORT_BASKETBALL, "Basketball", "" , "", "#101080" },
- { NODE_SPORT_BASEBALL, "Baseball", "" , "", "#101080" },
+ { NODE_SPORT_DOG, "Dog racing", "" , "sports", "#101080" },
+ { NODE_SPORT_BASKETBALL, "Basketball", "" , "sports", "#101080" },
+ { NODE_SPORT_BASEBALL, "Baseball", "" , "sports", "#101080" },
{ NODE_SPORT_CANOE, "Canoe", "" , "", "#101080" },
- { NODE_SPORT_CROQUET, "Croquet", "" , "", "#101080" },
- { NODE_SPORT_CRICKET, "Cricket", "" , "", "#101080" },
- { NODE_SPORT_SHOOTING, "Shooting", "Shooting range" , "", "#101080" },
- { NODE_SPORT_PAINTBALL, "Paintball", "Run around and shoot people with paintballs" , "", "#101080" },
- { NODE_SPORT_TABLE_TENNIS, "Table tennis", "" , "", "#101080" },
- { NODE_SPORT_PELOTA, "Pelota", "" , "", "#101080" },
+ { NODE_SPORT_CROQUET, "Croquet", "" , "sports", "#101080" },
+ { NODE_SPORT_CRICKET, "Cricket", "" , "sports", "#101080" },
+ { NODE_SPORT_SHOOTING, "Shooting", "Shooting range" , "sports", "#101080" },
+ { NODE_SPORT_PAINTBALL, "Paintball", "Run around and shoot people with paintballs" , "sports", "#101080" },
+ { NODE_SPORT_TABLE_TENNIS, "Table tennis", "" , "sports", "#101080" },
+ { NODE_SPORT_PELOTA, "Pelota", "" , "sports", "#101080" },
{ NODE_SPORT_RACQUET, "Racquet", "" , "sports/racquetball", "#101080" },
- { NODE_SPORT_BOWLS, "Lawn Bowls", "" , "", "#101080" },
- { NODE_SPORT_ATHLETICS, "Athletics", "" , "", "#101080" },
+ { NODE_SPORT_BOWLS, "Lawn Bowls", "" , "sports", "#101080" },
+ { NODE_SPORT_ATHLETICS, "Athletics", "" , "sports", "#101080" },
{ NODE_SPORT_OTHER, "Other Sports", "" , "sports/stadium", "#101077" },
- { NODE_AMENITY_GENERIC, "Other", "Miscellaneous category for everything else." , "generic", "#002000" },
+ { NODE_AMENITY_GENERIC, "Other", "Miscellaneous category for everything else." , "misc", "#002000" },
{ NODE_POI_END, NULL, NULL }
};
}
const gchar *
-poi_get_icon_from_type(gint t)
+poi_get_icon_from_type(node_type_t t)
{
guint i;