gint map;
gint gps;
gint heading;
+ gint route;
};
struct ui_notebook_struct ui_notebook;
menu_maps_add_repos(void)
{
GList *curr;
-GtkWidget *last_repo = NULL;
static gint id=0;
gint i=0;
void
mapper_ui_init(void)
{
+GError *error = NULL;
GtkWidget *hbox, *mapvbox, *label, *vbox_main;
-GtkWidget *gpsvbox, *headingvbox;
+GtkWidget *vbox;
+GtkWidget *sw;
GtkNotebook *notebook;
GdkColor color;
-GError *error = NULL;
GtkToolItem *item;
+GtkTreeViewColumn *column;
+GtkCellRenderer *renderer;
#ifdef WITH_HILDON
/* Initialize _program. */
label = gtk_label_new("Map");
hbox = gtk_hpaned_new();
+/* GPS Panel */
+_gps_widget = gps_info_panel();
+gtk_widget_set_size_request(GTK_WIDGET(_gps_widget), 180, 0);
+gtk_paned_add1(GTK_PANED(hbox), _gps_widget);
+
mapvbox = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(mapvbox), hbox, TRUE, TRUE, 0);
ui_notebook.map=gtk_notebook_append_page(notebook, mapvbox, label);
gtk_widget_show_all(GTK_WIDGET(mapvbox));
+/* Map widget */
+_map_widget = gtk_drawing_area_new();
+gtk_paned_add2(GTK_PANED(hbox), _map_widget);
+gtk_widget_realize(_map_widget);
+
/* GPS Tab */
-gpsvbox = gtk_vbox_new(FALSE, 0);
+vbox = gtk_vbox_new(FALSE, 0);
label = gtk_label_new("Gps");
_gps_sat_view = gtk_gps_new(GTK_GPS_MODE_SKY, &_gps);
-gtk_box_pack_start(GTK_BOX(gpsvbox), _gps_sat_view, TRUE, TRUE, 0);
-ui_notebook.gps=gtk_notebook_append_page(notebook, gpsvbox, label);
-gtk_widget_show_all(GTK_WIDGET(gpsvbox));
+gtk_box_pack_start(GTK_BOX(vbox), _gps_sat_view, TRUE, TRUE, 0);
+ui_notebook.gps=gtk_notebook_append_page(notebook, vbox, label);
+gtk_widget_show_all(GTK_WIDGET(vbox));
-/* Heading */
-headingvbox = gtk_vbox_new(FALSE, 0);
+/* Heading Tab */
+vbox = gtk_vbox_new(FALSE, 0);
label = gtk_label_new("Heading");
_tab_compass = gtk_compass_new(&_gps);
-gtk_box_pack_start(GTK_BOX(headingvbox), _tab_compass, TRUE, TRUE, 0);
-ui_notebook.heading=gtk_notebook_append_page(notebook, headingvbox, label);
-gtk_widget_show_all(GTK_WIDGET(headingvbox));
+gtk_box_pack_start(GTK_BOX(vbox), _tab_compass, TRUE, TRUE, 0);
+ui_notebook.heading=gtk_notebook_append_page(notebook, vbox, label);
+gtk_widget_show_all(GTK_WIDGET(vbox));
-_gps_widget = gps_info_panel();
-gtk_widget_set_size_request(GTK_WIDGET(_gps_widget), 180, 0);
-gtk_paned_add1(GTK_PANED(hbox), _gps_widget);
+/* Route Tab */
+vbox=gtk_vbox_new(FALSE, 0);
+label=gtk_label_new("Route");
-_map_widget = gtk_drawing_area_new();
-gtk_paned_add2(GTK_PANED(hbox), _map_widget);
+route_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(vbox, sw, TRUE, TRUE, 0);
+gtk_container_add(GTK_CONTAINER(sw), route_tree_view);
+
+gtk_tree_selection_set_mode(gtk_tree_view_get_selection (GTK_TREE_VIEW(route_tree_view)), GTK_SELECTION_SINGLE);
+gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(route_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(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);
+
+ui_notebook.route=gtk_notebook_append_page(notebook, vbox, label);
+gtk_widget_show_all(GTK_WIDGET(vbox));
gps_show_info();
-gtk_widget_realize(_map_widget);
map_poi_init(_map_widget);
menu_maps_add_repos();
pango_font_description_set_size(_scale_font, 12 * PANGO_SCALE);
pango_layout_set_font_description(_scale_layout, _scale_font);
-/* speed limit */
+/* Speed limit */
_speed_limit_gc1 = gdk_gc_new(_map_widget->window);
color.red = 0xffff;
color.green = 0;