From: tegzed Date: Mon, 6 Dec 2010 19:17:25 +0000 (+0000) Subject: Add:osd/core:added support for ${time} template parameter in odometer label string X-Git-Tag: navit-0.5.0.5194svn~1437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41d64a057bced5e771a9ca8fc1564942ef12ea47;p=profile%2Fivi%2Fnavit.git Add:osd/core:added support for ${time} template parameter in odometer label string git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3758 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/navit/osd/core/osd_core.c b/navit/navit/osd/core/osd_core.c index 7a7aa6e..c006f5b 100644 --- a/navit/navit/osd/core/osd_core.c +++ b/navit/navit/osd/core/osd_core.c @@ -288,6 +288,7 @@ osd_odometer_draw(struct odometer *this, struct navit *nav, char *dist_buffer=0; char *spd_buffer=0; + char *time_buffer = 0; struct point p, bbox[4]; struct attr position_attr,vehicle_attr; enum projection pro; @@ -327,13 +328,29 @@ osd_odometer_draw(struct odometer *this, struct navit *nav, char buffer2[64+1]=""; dist_buffer = format_distance(this->sum_dist,""); spd_buffer = format_speed(spd,""); + int remainder = this->time_all; + int days = remainder / (24*60*60); + remainder = remainder % (24*60*60); + int hours = remainder / (60*60); + remainder = remainder % (60*60); + int mins = remainder / (60); + remainder = remainder % (60); + int secs = remainder; + if(0text) { - str_replace(buffer2,this->text,"${avg_spd}",spd_buffer); - str_replace(buffer,buffer2,"${distance}",dist_buffer); + str_replace(buffer,this->text,"${avg_spd}",spd_buffer); + str_replace(buffer2,buffer,"${distance}",dist_buffer); + str_replace(buffer,buffer2,"${time}",time_buffer); } + g_free(time_buffer); graphics_get_text_bbox(this->osd_item.gr, this->osd_item.font, buffer, 0x10000, 0, bbox, 0); p.x=(this->osd_item.w-bbox[2].x)/2;