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 | 6179fe3830f1c7a13294d29e33aa5bbc7b1db3f5 (patch) | |
tree | 1e279c8134a197832d4dbd60624ba9d5a988e369 /navit/gui/internal/gui_internal.c | |
parent | e2baf1f6db5808534f86ec4fa5673dd4a3036a44 (diff) | |
download | navit-6179fe3830f1c7a13294d29e33aa5bbc7b1db3f5.tar.gz |
Add:gui_internal:Add route distance and time to route description
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5486 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/gui/internal/gui_internal.c')
-rw-r--r-- | navit/gui/internal/gui_internal.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index 059be0ab6..ef02f2fa5 100644 --- a/navit/gui/internal/gui_internal.c +++ b/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, |