From: Kaj-Michael Lang Date: Fri, 19 Oct 2007 11:22:44 +0000 (+0300) Subject: Use a hardcoded POI list for quick POI dialog X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc04268db991800a6fd42427a2afc709d618fd2c;p=mapper Use a hardcoded POI list for quick POI dialog --- diff --git a/src/poi-gui.c b/src/poi-gui.c index 86328b6..4a6b76f 100644 --- a/src/poi-gui.c +++ b/src/poi-gui.c @@ -25,6 +25,7 @@ #include "ui-common.h" #include "settings.h" #include "poi-gui.h" +#include "osm.h" #define POI_QUICK_BUTTONS (9) @@ -36,6 +37,27 @@ struct _PoiCategoryEditInfo { guint cat_id; }; +/* XXX: Load this from somewhere instead of hc... */ +struct _quick_poi_categories { + node_type_t type; + const gchar *name; +}; + +static struct _quick_poi_categories quick_poi_categories[] = { + { NODE_AMENITY_SPEEDCAM, "Speedcam", }, + { NODE_AMENITY_FUEL, "Fuel", }, + { NODE_AMENITY_PARKING, "Parking", }, + + { NODE_AMENITY_PUB, "Pub", }, + { NODE_AMENITY_CAFE, "Cafe", }, + { NODE_AMENITY_FOOD, "Food", }, + + { NODE_AMENITY_SHOP, "Shop", }, + { NODE_AMENITY_BANK, "Bank", }, + { NODE_AMENITY_ATM, "ATM", }, +}; + + static gboolean category_delete(GtkWidget *widget, delete_poi *dpoi) { @@ -747,11 +769,10 @@ for (x=1;x<=3;x++) { for (y=1;y<=3;y++) { gchar *btnlabel; - btnlabel=g_strdup_printf("(%d) %s", (x*y), "Poi name goes here..."); - buttons[x*y]=gtk_button_new_with_label(btnlabel); + buttons[x*y]=gtk_button_new_with_label(quick_poi_categories[x*y-1].name); gtk_table_attach(GTK_TABLE(table), buttons[x*y], x-1, x, y-1, y, GTK_FILL, 0, 2, 4); g_free(btnlabel); - g_signal_connect(G_OBJECT(buttons[x*y]), "clicked", G_CALLBACK(poi_quick_button_cb), NULL); + g_signal_connect(G_OBJECT(buttons[x*y]), "clicked", G_CALLBACK(poi_quick_button_cb), GINT_TO_POINTER(quick_poi_categories[x*y-1].type)); } }