From: Kaj-Michael Lang Date: Mon, 29 Oct 2007 14:51:32 +0000 (+0200) Subject: Add set destination from POI X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=354c6b476ef6b8c203b4e024a972e6b46c6ac73d;p=mapper Add set destination from POI --- diff --git a/src/poi-gui.c b/src/poi-gui.c index 15fc86e..591400e 100644 --- a/src/poi-gui.c +++ b/src/poi-gui.c @@ -449,6 +449,7 @@ gtk_tree_model_get(model, &iter, POI_LAT, &lat, -1); gtk_tree_model_get(model, &iter, POI_LON, &lon, -1); map_center_latlon(lat, lon); +map_update_location_from_center(); return TRUE; } @@ -456,6 +457,23 @@ return TRUE; static gboolean poi_route_to_cb(GtkWidget *widget, gpointer data) { +GtkTreeIter iter; +GtkTreeView *tree=GTK_TREE_VIEW(data); +GtkTreeModel *model = GTK_TREE_MODEL(data); + +if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)), NULL, &iter)) + return TRUE; + +model=gtk_tree_view_get_model(GTK_TREE_VIEW(tree)); +if (!model) + return TRUE; + +_dest.valid=TRUE; +gtk_tree_model_get(model, &iter, POI_LAT, &_dest.lat, -1); +gtk_tree_model_get(model, &iter, POI_LON, &_dest.lon, -1); + +map_update_location_from_center(); + return TRUE; }