From: eshe Date: Thu, 12 Aug 2010 10:01:45 +0000 (+0100) Subject: Changed default and white themes to show a speed camera warning image. Small fix... X-Git-Url: http://git.maemo.org/git/?p=jspeed;a=commitdiff_plain;h=5728fa7e539c5d826c1708bdfffb5daf0b23bdfd Changed default and white themes to show a speed camera warning image. Small fix to speed camera distance printing. --- diff --git a/src/data/themes/white.jspeed b/src/data/themes/white.jspeed index 171f527..5a2cf6e 100644 Binary files a/src/data/themes/white.jspeed and b/src/data/themes/white.jspeed differ diff --git a/src/poialerts.cpp b/src/poialerts.cpp index 2d8fe0d..67cf921 100644 --- a/src/poialerts.cpp +++ b/src/poialerts.cpp @@ -197,7 +197,10 @@ double PoiAlerts::getCurrentDistance() const return 0.0; } - return currentDistance_; + const Location::Fix* fix = &(Odometer::instance().getLatestFix()); + + return calculateDistance(currentPoi_->latitude, currentPoi_->longitude, + fix->latitude, fix->longitude); } QString PoiAlerts::getCurrentPoi() const @@ -232,7 +235,7 @@ void PoiAlerts::onDataUpdated() double travelled = Odometer::instance().getTotal(); - if(absValue(travelled - travelled_) > 0.02) + if(absValue(travelled - travelled_) > 0.015) { double distance; double inRouteMargin = IN_ROUTE_MARGIN + (fix->eph / 1000.0); @@ -268,7 +271,7 @@ void PoiAlerts::onDataUpdated() } else { - trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.16)) / distance)); + trackLimit = 90.0 - radToDeg(acos((inRouteMargin + (distance * 0.17)) / distance)); } qDebug() << "Tracklimit: " << trackLimit; @@ -277,7 +280,6 @@ void PoiAlerts::onDataUpdated() { found = true; currentPoi_ = &pois_[i]; - currentDistance_ = distance; emit visibilityChanged(true); playSound(i); } @@ -292,7 +294,6 @@ void PoiAlerts::onDataUpdated() { found = true; currentPoi_ = &pois_[i]; - currentDistance_ = distance; emit visibilityChanged(true); playSound(i); } diff --git a/src/poialerts.h b/src/poialerts.h index a8ba9fe..828bda1 100644 --- a/src/poialerts.h +++ b/src/poialerts.h @@ -32,7 +32,7 @@ class PoiAlerts : public QObject public: static int const POI_ALERT_INTERVAL = 120; - static int const IN_ROUTE_MARGIN = 20; + static int const IN_ROUTE_MARGIN = 22; static PoiAlerts& instance(); static QString getPoiDir(); ~PoiAlerts(); @@ -69,7 +69,6 @@ private: double distance_; double travelled_; PoiReader::Poi* currentPoi_; - double currentDistance_; bool loaded_; QString error_; diff --git a/src/resources.qrc b/src/resources.qrc index 24f58d4..314f1eb 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -15,5 +15,6 @@ resources/themes/default/theme.xml resources/themes/default/digital7.ttf resources/themes/default/background.png + resources/themes/default/speedcamera.png diff --git a/src/resources/themes/default/speedcamera.png b/src/resources/themes/default/speedcamera.png new file mode 100644 index 0000000..fd6b412 Binary files /dev/null and b/src/resources/themes/default/speedcamera.png differ diff --git a/src/resources/themes/default/theme.xml b/src/resources/themes/default/theme.xml index 9bfd8f3..c1ca87f 100644 --- a/src/resources/themes/default/theme.xml +++ b/src/resources/themes/default/theme.xml @@ -55,6 +55,25 @@ #a5efff + + speedcamera.png + 14 + 418 + + 500 + + poivisible + + + {POIDISTANCE} {DISTANCEUNIT} + 77 + 420 + Nokia Sans Bold + 20 + #e4ff00 + true + poivisible + @@ -105,5 +124,24 @@ #a5efff + + speedcamera.png + 14 + 738 + + 500 + + poivisible + + + {POIDISTANCE} {DISTANCEUNIT} + 77 + 740 + Nokia Sans Bold + 20 + #e4ff00 + true + poivisible + diff --git a/src/textelement.cpp b/src/textelement.cpp index d42b423..f1af21e 100644 --- a/src/textelement.cpp +++ b/src/textelement.cpp @@ -322,7 +322,7 @@ QString TextElement::formatString(double val) if(format.isEmpty()) { - format = "%.1lf"; + format = "%.0lf"; } QString result;