]> err.no Git - mapper/commitdiff
Use a hardcoded POI list for quick POI dialog
authorKaj-Michael Lang <milang@angel.tal.org>
Fri, 19 Oct 2007 11:22:44 +0000 (14:22 +0300)
committerKaj-Michael Lang <milang@angel.tal.org>
Fri, 19 Oct 2007 11:22:44 +0000 (14:22 +0300)
src/poi-gui.c

index 86328b62237d4408d4818a94b418088b5a6464fc..4a6b76f99e260790093d50e32715e5359191e492 100644 (file)
@@ -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));
        }
 }