{ NODE_AMENITY_ATM, "ATM", },
};
+/* Argh... */
+static gdouble qp_lat, qp_lon;
static gboolean
category_delete(GtkWidget *widget, delete_poi *dpoi)
static gboolean
poi_quick_button_cb(GtkWidget *w, gpointer data)
{
+guint cat_id;
gtk_widget_destroy(dialog_qp);
+
+cat_id=GPOINTER_TO_INT(data);
+
+/* poi_add frees the label and desc so strdup them */
+if (poi_add(qp_lat, qp_lon, cat_id, g_strdup("QP"), g_strdup("Quick POI, update information please."))==FALSE) {
+ popup_error(_window, _("Problem adding POI"));
+} else {
+ map_render_data();
+}
+
return TRUE;
}
GtkWidget *table;
GtkWidget *buttons[POI_QUICK_BUTTONS];
guint x,y;
-poi_info poi;
-unit2latlon(unitx, unity, poi.lat, poi.lon);
+unit2latlon(unitx, unity, qp_lat, qp_lon);
dialog_qp = gtk_dialog_new_with_buttons(_("Quick POI"),
GTK_WINDOW(_window),
for (x=1;x<=3;x++) {
for (y=1;y<=3;y++) {
- gchar *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), GINT_TO_POINTER(quick_poi_categories[x*y-1].type));
}
}