#include "dialogs.h"
#include "help.h"
-gboolean
-menu_cb_route_download(GtkAction * action)
+static void
+track_tree_view_update_store(GtkWidget *tree_view, Path *track)
{
GtkListStore *store;
-route_download(NULL);
-store=route_generate_store(&_route);
+store=route_generate_store(track);
if (store!=NULL) {
- gtk_tree_view_set_model(route_tree_view, store);
+ gtk_tree_view_set_model(tree_view, store);
g_object_unref(G_OBJECT(store));
}
+}
+
+gboolean
+menu_cb_route_download(GtkAction * action)
+{
+route_download(NULL);
+track_tree_view_update_store(route_tree_view, &_route);
return TRUE;
}
GtkListStore *store;
route_open_file();
-store=route_generate_store(&_route);
-if (store!=NULL) {
- gtk_tree_view_set_model(route_tree_view, store);
- g_object_unref(G_OBJECT(store));
-}
+track_tree_view_update_store(route_tree_view, &_route);
return TRUE;
}
menu_cb_track_open(GtkAction * action)
{
track_open();
+track_tree_view_update_store(track_tree_view, &_track);
return TRUE;
}
menu_cb_track_insert_break(GtkAction * action)
{
track_insert_break();
+track_tree_view_update_store(track_tree_view, &_track);
return TRUE;
}
menu_cb_track_insert_mark(GtkAction * action)
{
track_insert_mark();
+track_tree_view_update_store(track_tree_view, &_track);
return TRUE;
}
menu_cb_track_clear(GtkAction * action)
{
track_clear();
+track_tree_view_update_store(track_tree_view, &_track);
return TRUE;
}
" <menuitem action='file_settings_osm'/>"
" </menu>"
" <separator/>"
+#if 0
+" <menuitem action='file_import_osm'/>"
+#endif
" <menuitem action='file_quit'/>"
" </menu>"
" <menu action='map' name='map'>"
#endif
" <separator/>"
" </toolbar>"
+" <toolbar name='MappingToolBar'>"
+" <toolitem action='goto_gps'/>"
+" <separator/>"
+" <toolitem action='poi_add'/>"
+" <toolitem action='poi_quick_add'/>"
+" <toolitem action='track_insert_break'/>"
+" <toolitem action='track_insert_mark'/>"
+" <separator/>"
+" <toolitem action='search_address'/>"
+" </toolbar>"
"</ui>";
static GtkActionEntry ui_entries[] = {
mapper_tree_view_new(GtkWidget *container)
{
GtkWidget *tree_view, *sw;
+GtkTreeViewColumn *column;
+GtkCellRenderer *renderer;
+
tree_view=gtk_tree_view_new();
sw=gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start(container, sw, TRUE, TRUE, 0);
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view)), GTK_SELECTION_SINGLE);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_view), TRUE);
+
+renderer=gtk_cell_renderer_text_new();
+column=gtk_tree_view_column_new_with_attributes(_("Location"), renderer, "text", ROUTE_LATLON, NULL);
+gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
+
+renderer=gtk_cell_renderer_text_new();
+column=gtk_tree_view_column_new_with_attributes(_("Distance"), renderer, "text", ROUTE_DISTANCE, NULL);
+gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
+
+renderer=gtk_cell_renderer_text_new();
+column=gtk_tree_view_column_new_with_attributes(_("Waypoint"), renderer, "text", ROUTE_WAYPOINT, NULL);
+gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
+
return tree_view;
}
vbox=gtk_vbox_new(FALSE, 0);
label=gtk_label_new("Route");
route_tree_view=mapper_tree_view_new(vbox);
-
-renderer=gtk_cell_renderer_text_new();
-column=gtk_tree_view_column_new_with_attributes(_("Location"), renderer, "text", ROUTE_LATLON, NULL);
-gtk_tree_view_append_column(GTK_TREE_VIEW(route_tree_view), column);
-
-renderer=gtk_cell_renderer_text_new();
-column=gtk_tree_view_column_new_with_attributes(_("Distance"), renderer, "text", ROUTE_DISTANCE, NULL);
-gtk_tree_view_append_column(GTK_TREE_VIEW(route_tree_view), column);
-
-renderer=gtk_cell_renderer_text_new();
-column=gtk_tree_view_column_new_with_attributes(_("Waypoint"), renderer, "text", ROUTE_WAYPOINT, NULL);
-gtk_tree_view_append_column(GTK_TREE_VIEW(route_tree_view), column);
-
#if 0
g_signal_connect(G_OBJECT(route_tree_view), "row-activated", G_CALLBACK(route_waypoint_activated_cb), NULL);
#endif