]> err.no Git - mapper/commitdiff
Add set destination from POI
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 29 Oct 2007 14:51:32 +0000 (16:51 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 29 Oct 2007 14:51:32 +0000 (16:51 +0200)
src/poi-gui.c

index 15fc86ee3f267018d8426fa3acdb6012b2401931..591400e12fa41841743a17e058e762a377127ac7 100644 (file)
@@ -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;
 }