diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-05-05 19:21:20 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-05-05 19:21:20 +0000 |
commit | c1791fcd225971ae08492b319322be2ac81fac89 (patch) | |
tree | 7cd0e275c16b04e1410fef76ed5433548df17d2d | |
parent | 40d034445b02eba690a3dafb2e6b0c6dfb8cbac2 (diff) | |
download | navit-c1791fcd225971ae08492b319322be2ac81fac89.tar.gz |
Add:gui_internal:Add route distance and time to route description
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@5486 ffa7fe5e-494d-0410-b361-a75ebd5db220
-rw-r--r-- | navit/navit/gui/internal/gui_internal.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/navit/navit/gui/internal/gui_internal.c b/navit/navit/gui/internal/gui_internal.c index 059be0ab6..ef02f2fa5 100644 --- a/navit/navit/gui/internal/gui_internal.c +++ b/navit/navit/gui/internal/gui_internal.c @@ -3092,7 +3092,7 @@ gui_internal_populate_route_table(struct gui_priv * this, struct navit * navit) struct map_rect * mr=NULL; struct navigation * nav = NULL; struct item * item =NULL; - struct attr attr; + struct attr attr,route; struct widget * label = NULL; struct widget * row = NULL; struct coord c; @@ -3110,6 +3110,25 @@ gui_internal_populate_route_table(struct gui_priv * this, struct navit * navit) if(toprow && toprow->data) topitem=((struct widget*)toprow->data)->item; gui_internal_widget_table_clear(this,this->route_data.route_table); + if (navit_get_attr(navit, attr_route, &route, NULL)) { + struct attr destination_length, destination_time; + char *length=NULL,*time=NULL,*length_time; + if (route_get_attr(route.u.route, attr_destination_length, &destination_length, NULL)) + length=attr_to_text_ext(&destination_length, NULL, attr_format_with_units, attr_format_default, NULL); + if (route_get_attr(route.u.route, attr_destination_time, &destination_time, NULL)) + time=attr_to_text_ext(&destination_time, NULL, attr_format_with_units, attr_format_default, NULL); + row = gui_internal_widget_table_row_new(this, + gravity_left + | flags_fill + | orientation_horizontal); + gui_internal_widget_append(this->route_data.route_table,row); + length_time=g_strdup_printf("%s %s",length,time); + label = gui_internal_label_new(this,length_time); + g_free(length_time); + g_free(length); + g_free(time); + gui_internal_widget_append(row,label); + } while((item = map_rect_get_item(mr))) { if(item_attr_get(item,attr_navigation_long,&attr)) { row = gui_internal_widget_table_row_new(this, |