--- /usr/lib/qt4/imports/ovi/connector/map/MapSettingsUI.qml-original 2012-08-05 10:32:11.841604448 +0200 +++ /usr/lib/qt4/imports/ovi/connector/map/MapSettingsUI.qml 2012-08-05 10:51:35.667375649 +0200 @@ -78,6 +78,17 @@ id: trafficObject } + Timer { + id: trafficTimer + repeat: false + interval: 500 + onTriggered: { + //trafficInfo.text="Triggered"; + trafficObject.requestTrafficAt(mapView.center, 50); + } + + } + Connections { target: mapView ignoreUnknownSignals: true @@ -314,7 +325,7 @@ SettingOption { id: traffic objectName: "traffic" - visible: false // ak20110329 - requested override + visible: true // ak20110329 - requested override text: qsTranslate("Maps", "qtn_mapconnector_settings_traffic"); //"Traffic" --- /usr/lib/qt4/imports/ovi/connector/map/MapViewer.qml-original 2012-08-05 10:32:11.813604310 +0200 +++ /usr/lib/qt4/imports/ovi/connector/map/MapViewer.qml 2012-08-05 10:53:25.963922519 +0200 @@ -453,6 +453,8 @@ DebugOverlayPanel { id: debugLogger } + // TMO patch + //Text { id: trafficInfo; font.bold: true; font.pixelSize:24; text: "Loading Traffic"} ] Component.onCompleted: { --- /usr/lib/qt4/imports/ovi/connector/map/MapBehaviors.qml-original 2012-08-05 10:32:11.877604626 +0200 +++ /usr/lib/qt4/imports/ovi/connector/map/MapBehaviors.qml 2012-08-05 10:49:37.042787329 +0200 @@ -207,8 +207,8 @@ var mode3d = rs["mode3d"] == "true" ? true : false; var landmarksVisible = rs["landmarksVisible"] == "true" ? true : false; - // var trafficInfoVisible = rs["trafficInfoVisible"] == "true" ? true : false; - var trafficInfoVisible = false; + var trafficInfoVisible = rs["trafficInfoVisible"] == "true" ? true : false; + //var trafficInfoVisible = false; var publicTransportMode = rs["publicTransportMode"] == "true" ? true : false; //var publicTransportModePartial = rs["publicTransportModePartial"] == "true" ? true : false; @@ -235,7 +235,7 @@ //mapView.mapSharedData.mapMode = mapMode; mapView.mapSharedData.mode3d = mode3d; mapView.mapSharedData.landmarksVisible = landmarksVisible; - //mapView.mapSharedData.trafficInfoVisible = trafficInfoVisible; + mapView.mapSharedData.trafficInfoVisible = trafficInfoVisible; mapView.mapSharedData.publicTransportMode = publicTransportMode; mapView.mapSharedData.publicTransportModePartial = publicTransportModePartial; mapView.mapSharedData.publicTransportLineHightlighted = publicTransportLineHightlighted; --- /usr/lib/qt4/imports/ovi/connector/map/MapApi.js-original 2012-08-05 10:32:11.857604528 +0200 +++ /usr/lib/qt4/imports/ovi/connector/map/MapApi.js 2012-08-05 10:47:13.438075172 +0200 @@ -310,11 +310,15 @@ } var _askForTraffic = function () { - if (!latestTrafficFix || mapView.center.distance(latestTrafficFix) > 5 * 1000) { + // TMO patch: Increase trigger distance diff & use timer + if (!latestTrafficFix || mapView.center.distance(latestTrafficFix) > 7000) { latestTrafficFix = spareGeoCoordinates.createObject(mapView); latestTrafficFix.latitude = mapView.center.latitude; latestTrafficFix.longitude = mapView.center.longitude; - trafficObject.requestTrafficAt(mapView.center); + //trafficObject.requestTrafficAt(mapView.center, 30); + //trafficInfo.text="Done"; + + trafficTimer.restart(); } } --- /usr/lib/drive-qml/components/qmldir-original 2012-07-19 09:16:06.019114972 +0200 +++ /usr/lib/drive-qml/components/qmldir 2012-08-08 12:08:35.067243458 +0200 @@ -67,6 +67,7 @@ ToggleSwitch 1.0 ToggleSwitch.qml TrackingHelper 1.0 TrackingHelper.qml TrafficButton 1.0 TrafficButton.qml +TrafficEventHeader 1.0 TrafficEventHeader.qml Window 1.0 Window.qml QuickZoomButton 1.0 QuickZoomButton.qml QuickZoom 1.0 QuickZoom.qml --- /usr/lib/drive-qml/components/styles.js-original 2012-07-19 09:16:06.095115343 +0200 +++ /usr/lib/drive-qml/components/styles.js 2012-08-08 12:08:35.071243491 +0200 @@ -1076,6 +1076,33 @@ } }; +var TrafficEventHeader = { + height: 60, + margins: 10, + radius: 5, + trafficIcon: { + width: 300, + height: 60, + //source: "resources/traffic/indicator" + source: "" + }, + arrow: { + source: "../resources/arrow_list_item.png", + bgcolor: "black", + width: 80, + left: { + normal: { x:0,y:0 }, + down: { x:5,y:5 }, + disabled: { x:0,y:0 } + }, + right: { + normal: { x:0,y:0 }, + down: { x:5,y:5 }, + disabled: { x:0,y:0 } + } + } +}; + //unused //ActionButtonWithBase.qml --- /usr/lib/drive-qml/components/SpeedWarnerSwitch.qml-original 2012-07-19 09:16:06.051115140 +0200 +++ /usr/lib/drive-qml/components/SpeedWarnerSwitch.qml 2012-10-20 15:18:27.719810961 +0200 @@ -30,14 +30,13 @@ preSelected: false imageSource: "" //"../resources/visual_acoustic_alert.png" } - /* ListElement { - label: "" + label: "!MUTE" identifier: 2 buttonWidth: 0 preSelected: false - imageSource: "../resources/no_acoustic_alert.png" - } */ + imageSource: "" //"../resources/no_acoustic_alert.png" + } ListElement { label: "!OFF" identifier: 3 @@ -54,12 +53,9 @@ guidanceSettingsModel.speedWarnerOnChanged.connect(loadSelected); switcher.buttonModel.get(0).label = qsTrId("qtn_drive_on_tgl"); - switcher.buttonModel.get(1).label = qsTrId("qtn_drive_off_tgl"); + switcher.buttonModel.get(1).label = qsTrId("MUTE"); + switcher.buttonModel.get(2).label = qsTrId("qtn_drive_off_tgl"); loadSelected(); - - // switcher.buttonModel.get(0).label = qsTrId("ON"); - // switcher.buttonModel.get(1).label = qsTrId("MUTE"); - // switcher.buttonModel.get(2).label = qsTrId("OFF"); } function save(uid) { @@ -84,13 +80,10 @@ function loadSelected() { var guidanceSettingsModel = modelFactory.getModel("GuidanceSettingsModel"); var warner = guidanceSettingsModel.speedWarnerOn - //var audio = guidanceSettingsModel.speedWarnerAudioOn - - //toggleSwitchModel.get(0).preSelected = (warner === true) && (audio === true); - //toggleSwitchModel.get(1).preSelected = (warner === true) && (audio === false); - //toggleSwitchModel.get(2).preSelected = (warner === false); + var audio = guidanceSettingsModel.speedWarnerAudioOn - toggleSwitchModel.get(0).preSelected = (warner === true); - toggleSwitchModel.get(1).preSelected = (warner === false); + toggleSwitchModel.get(0).preSelected = (warner === true) && (audio === true); + toggleSwitchModel.get(1).preSelected = (warner === true) && (audio === false); + toggleSwitchModel.get(2).preSelected = (warner === false); } } --- /usr/lib/drive-qml/components/InfoDistance.qml-original 2012-07-19 09:16:05.971114729 +0200 +++ /usr/lib/drive-qml/components/InfoDistance.qml 2012-09-07 14:37:36.988752269 +0200 @@ -4,6 +4,7 @@ Item { id: distance property bool isLandscape + property int dispMode: 0 property string value property string unit property variant infoDistanceStyle: Style.InfoDistance --- /usr/lib/drive-qml/components/TrafficEventHeader.qml-original 2012-07-19 09:16:06.027115001 +0200 +++ /usr/lib/drive-qml/components/TrafficEventHeader.qml 2012-08-08 12:08:35.067243458 +0200 @@ -38,6 +38,7 @@ when: mouseAreaLeft.pressed && !root.leftButtonDisabled PropertyChanges { target: leftButton + color: "gray" iconX: headerStyle.arrow.left.down.x iconY: headerStyle.arrow.left.down.y @@ -48,6 +49,7 @@ when: mouseAreaRight.pressed && !root.rightButtonDisabled PropertyChanges { target: rightButton + color: "gray" iconX: headerStyle.arrow.right.down.x iconY: headerStyle.arrow.right.down.y @@ -62,21 +64,33 @@ anchors.verticalCenter: parent.verticalCenter height: parent.height anchors.margins: headerStyle.margins - color: root.color + //color: root.color + color: "#111111" + border.width: 1 + border.color: "#999999" radius: headerStyle.radius - Item { - width: headerStyle.trafficIcon.width - height: headerStyle.trafficIcon.height - anchors.centerIn: parent - clip: true - opacity: 1 + //Item { + //width: headerStyle.trafficIcon.width + //height: headerStyle.trafficIcon.height + //anchors.centerIn: parent + //clip: true + //opacity: 1 + Text { + anchors.centerIn: parent + font.pixelSize: 32 + color: "ivory" + text: (trafficModel.trafficEvents.length==0) ? "-" : (trafficModel.selectedEventIndex+1)+" ("+trafficModel.trafficEvents.length+")" + } + + /* Image { source: headerStyle.trafficIcon.source anchors.centerIn: parent } - } + */ + //} } Rectangle { @@ -90,17 +104,20 @@ radius: headerStyle.radius property int iconX: root.leftButtonDisabled ? headerStyle.arrow.left.disabled.x : headerStyle.arrow.left.normal.x property int iconY: root.leftButtonDisabled ? headerStyle.arrow.left.disabled.y : headerStyle.arrow.left.normal.y + visible: !root.leftButtonDisabled Item { anchors.centerIn: parent width: parent.width height: headerStyle.arrow.height - clip: true + //clip: true opacity: 1 Image { source: headerStyle.arrow.source - x: leftButton.iconX - y: leftButton.iconY + mirror: true + anchors.centerIn: parent + //x: leftButton.iconX + //y: leftButton.iconY } } @@ -144,18 +161,20 @@ radius: headerStyle.radius property int iconX: root.rightButtonDisabled ? headerStyle.arrow.right.disabled.x : headerStyle.arrow.right.normal.x property int iconY: root.rightButtonDisabled ? headerStyle.arrow.right.disabled.y : headerStyle.arrow.right.normal.y + visible: !root.rightButtonDisabled Item { anchors.centerIn: parent width: parent.width height: headerStyle.arrow.height - clip: true + //clip: true opacity: 1 Image { source: headerStyle.arrow.source - x: rightButton.iconX - y: rightButton.iconY + anchors.centerIn: parent + //x: rightButton.iconX + //y: rightButton.iconY } } --- /usr/lib/drive-qml/components/Dashboard.qml-original 2012-07-19 09:16:06.075115241 +0200 +++ /usr/lib/drive-qml/components/Dashboard.qml 2012-09-07 14:37:36.988752269 +0200 @@ -11,6 +11,10 @@ property string speedUnit property string distanceValue property string distanceUnit + property string durationValue + property string durationUnit + property string arrivalValue + property string arrivalUnit signal menuButtonClicked() @@ -134,8 +138,12 @@ id: distanceInfo anchors.fill: distance isLandscape: assistance.isLandscape - value: assistance.distanceValue - unit: assistance.distanceUnit + value: (dispMode == 1) ? assistance.durationValue : (dispMode == 2) ? assistance.arrivalValue : assistance.distanceValue + unit: (dispMode == 1) ? assistance.durationUnit : (dispMode == 2) ? assistance.arrivalUnit : assistance.distanceUnit + } + + onClicked: { + distanceInfo.dispMode = (distanceInfo.dispMode + 1) % 3 } } --- /usr/lib/drive-qml/views/assistancePage.qml-original 2012-07-19 09:16:08.199125783 +0200 +++ /usr/lib/drive-qml/views/assistancePage.qml 2012-07-22 16:58:42.068431358 +0200 @@ -91,18 +91,18 @@ minimap.show(); // TODO: Uncomment when management makes up their minds - //setupTraffic(false, restartTraffic); + setupTraffic(false, restartTraffic); } else { mapModel.center = minimap.map.center; minimap.startupInitialization(); // app startup, defer initialization defferConfigTimer.running = true; - /** TODO: enable when this is fixed in plugin + var mapSettingsModel = ModelFactory.getModel("MapSettingsModel"); if (mapSettingsModel.dayNightMode === "auto") { mapSettingsModel.setNightMode(mapSettingsModel.isNight()); } - */ + } } @@ -117,15 +117,15 @@ // TODO: Uncomment when management makes up their minds // Setup traffic after application startup - //setupTraffic(true, false); + setupTraffic(true, false); application.setup(); } } onBeforeHide: { // TODO: Uncomment when management makes up their minds - //trafficModel.trafficError.disconnect(onTrafficError); - //trafficModel.trafficError.disconnect(onTrafficReady); + trafficModel.trafficError.disconnect(onTrafficError); + trafficModel.trafficError.disconnect(onTrafficReady); trackingHelper.pauseTracking(); minimap.setTransitionMap(); minimap.stopMapAnimation(); @@ -431,7 +431,7 @@ name: (positioningModel && positioningModel.currentStreetName) ? positioningModel.currentStreetName : "" hasGPS: (positioningModel && positioningModel.hasGPS) ? positioningModel.hasGPS : false // TODO: Uncomment when management makes up their minds - loadingTraffic: false //(trafficModel && trafficModel.isLoadingTraffic) ? trafficModel.isLoadingTraffic : false + loadingTraffic: (trafficModel && trafficModel.isLoadingTraffic) ? trafficModel.isLoadingTraffic : false } // dashboard @@ -443,6 +443,8 @@ speedValue: currentSpeed.value distanceUnit: elapsedDistanceUnit distanceValue: elapsedDistance ? elapsedDistance.value : "-" + durationUnit: elapsedDistanceUnit + durationValue: elapsedDistance ? elapsedDistance.value : "-" onMenuButtonClicked: window.push("settings/assistanceModeSettingsPage.qml", { invokingPage: tag }) } --- /usr/lib/drive-qml/views/trafficDetailsPage.qml-original 2012-07-19 09:16:08.151125545 +0200 +++ /usr/lib/drive-qml/views/trafficDetailsPage.qml 2012-08-08 12:08:35.075243501 +0200 @@ -29,6 +29,7 @@ rightButtonDisabled: trafficModel.selectedEventIndex === trafficModel.trafficEvents.length-1 } + /* ButtonItem { id: distance itemId: "distance" @@ -38,6 +39,7 @@ title: "Distance to" subtitle: distanceText.value + ' ' + distanceText.unit } + */ ButtonItem { id: length @@ -46,7 +48,7 @@ hasIcon: false hideArrow: true title: "Length" - subtitle: lengthText.value + ' ' + lengthText.unit + subtitle: (lengthText.value===undefined) ? "-" : lengthText.value + ' ' + lengthText.unit } ButtonItem { @@ -56,7 +58,7 @@ hasIcon: false hideArrow: true title: "Average speed" - subtitle: speedText.value + ' ' + speedText.unit + subtitle: (speedText.value===undefined) ? "-" : speedText.value + ' ' + speedText.unit } /* This info is not available from plugin @@ -135,19 +137,31 @@ } function onLeftButtonClicked() { - trafficModel.loadPreviousTrafficEvent(); + trafficModel.selectedEventIndex--; + + //trafficModel.loadPreviousTrafficEvent(); updateTrafficInfo(); } function onRightButtonClicked() { - trafficModel.loadNextTrafficEvent(); + if (trafficModel.trafficEvents.length!=0) + trafficModel.selectedEventIndex++; + + //trafficModel.loadNextTrafficEvent(); updateTrafficInfo(); } function updateTrafficInfo() { - distanceText = trafficViewHelper.getDistanceToTrafficEvent(trafficModel.selectedTrafficEvent); - lengthText = Units.getReadableDistanceVisual(trafficModel.selectedTrafficEvent.affectedLength); - speedText = Units.getReadableSpeed(trafficModel.selectedTrafficEvent.speedLimit); + trafficModel.selectedTrafficEvent = trafficModel.trafficEvents[trafficModel.selectedEventIndex]; + + //distanceText = trafficViewHelper.getDistanceToTrafficEvent(trafficModel.selectedTrafficEvent); + //lengthText = Units.getReadableDistanceVisual(trafficModel.selectedTrafficEvent.affectedLength); + //speedText = Units.getReadableSpeed(trafficModel.selectedTrafficEvent.speedLimit); + lengthText = trafficModel.selectedTrafficEvent.affectedLength; + //console.log("DBG:"+trafficModel.selectedTrafficEvent.affectedLength); + + speedText = trafficModel.selectedTrafficEvent.speedLimit; + //console.log("DBG:"+trafficModel.selectedTrafficEvent.speedLimit); //delayText = '-'; // not available from plugin } @@ -160,7 +174,7 @@ Component.onCompleted: { positioningModel = modelFactory.getModel("PositioningModel"); trafficModel = modelFactory.getModel("TrafficModel"); - trafficViewHelper = modelFactory.getModel("TrafficViewHelper"); + //trafficViewHelper = modelFactory.getModel("TrafficViewHelper"); updateTrafficInfo(); } --- /usr/lib/drive-qml/views/guidancePage.qml-original 2012-07-19 09:16:08.123125395 +0200 +++ /usr/lib/drive-qml/views/guidancePage.qml 2012-09-07 14:37:36.992752279 +0200 @@ -33,6 +33,10 @@ getNextManeuverDistance() property variant destinationDistance: ((appSettingsModel && appSettingsModel.currentUnitSystem) !== undefined) && getDestinationDistance() + property variant destinationDuration: ((appSettingsModel && appSettingsModel.currentUnitSystem) !== undefined) && + getTTD() + property variant destinationArrival: ((appSettingsModel && appSettingsModel.currentUnitSystem) !== undefined) && + getArrivalTime() property bool laneInfoAvailable: false property bool recalculateRoute: false @@ -241,7 +245,7 @@ name: (positioningModel && positioningModel.currentStreetName) ? positioningModel.currentStreetName : "" hasGPS: (positioningModel && positioningModel.hasGPS) ? positioningModel.hasGPS : false // TODO: Uncomment when management makes up their minds - loadingTraffic: false //trafficModel === undefined ? false : trafficModel.isLoadingTraffic + loadingTraffic: trafficModel === undefined ? false : trafficModel.isLoadingTraffic } Dashboard { @@ -252,6 +256,10 @@ speedValue: typeof currentSpeed === "object" ? currentSpeed.value : "0" distanceUnit: destinationDistance ? destinationDistance.unit : Units.getCurrentShortDistanceUnit() distanceValue: destinationDistance ? destinationDistance.value : "-" + durationUnit: destinationDuration ? destinationDuration.unit : "hr" + durationValue: destinationDuration ? destinationDuration.value : "-" + arrivalUnit: destinationArrival ? destinationArrival.unit : "Arrival" + arrivalValue: destinationArrival ? destinationArrival.value : "--:--" onMenuButtonClicked: window.push("guidanceMenuPage.qml") } @@ -388,7 +396,7 @@ } // TODO: Uncomment when management makes up their minds - //setupTraffic(firstShow); + setupTraffic(firstShow); minimap.initializeMap(); //gotta do it again because showOnMap will override our map settings page.state != "mapInteraction" && (guidanceModel.mapUpdateMode = Guidance.MAP_UPDATE_ROADVIEW); @@ -399,8 +407,8 @@ onBeforeHide: { // TODO: Uncomment when management makes up their minds - //trafficModel.trafficError.disconnect(onTrafficReady); - //trafficModel.trafficError.disconnect(onTrafficError); + trafficModel.trafficError.disconnect(onTrafficReady); + trafficModel.trafficError.disconnect(onTrafficError); guidanceModel.mapUpdateMode = Guidance.MAP_UPDATE_NONE; //For the sake of transitions, stop the map movement minimap.setTransitionMap(); minimap.stopMapAnimation(); @@ -613,7 +621,43 @@ function getDestinationDistance() { var distance = guidanceModel ? guidanceModel.destinationDistance : 0 - return Units.getReadableDistanceVisual(distance); + var readableDistance = Units.getReadableDistanceVisual(distance); + var distTime = Units.getReadableDistanceVisual(distance); + distTime.unit = readableDistance.unit; + if (distTime.value > 0) { + distTime.value = readableDistance.value; + } else { + distTime.value = "-"; + } + return distTime; + } + + function getArrivalTime() { + var duration = guidanceModel ? guidanceModel.timeToArrival : 0 + var today = new Date(); + var m; + if (duration > 0) { + today.setTime(today.getTime() + duration * 1000); + m = today.getMinutes(); + return { value: today.getHours() + (m < 10 ? ":0" : ":") + m, unit: "Arrival" }; + } else { + return { value: "--:--", unit: "Arrival" }; + } + } + + function getTTD() { + var duration = guidanceModel ? guidanceModel.timeToArrival : 0 + var readableDuration = Units.getReadableTime(duration); + var distTime; + if (readableDuration.unit == "s") { + readableDuration.value = Math.round(readableDuration.value / 5) * 5; + } + if (duration > 0) { + distTime = readableDuration.value; + } else { + distTime = "-"; + } + return { value: distTime, unit: readableDuration.unit }; } function onTrafficError() { --- /usr/lib/drive-qml/views/settings/mapModeSettingsPage.qml-original 2012-07-19 09:16:08.271126138 +0200 +++ /usr/lib/drive-qml/views/settings/mapModeSettingsPage.qml 2012-07-17 07:46:05.000000000 +0200 @@ -35,7 +35,6 @@ group: group } - /** TODO: enable when plugin is fixed ButtonItem { id: autoMode itemId: "auto" @@ -44,7 +43,6 @@ style: Components.RadioButton group: group } - */ } List { --- /usr/lib/drive-qml/views/settings/assistanceModeSettingsPage.qml-original 2012-07-19 09:16:08.279126176 +0200 +++ /usr/lib/drive-qml/views/settings/assistanceModeSettingsPage.qml 2012-08-08 12:08:35.075243501 +0200 @@ -21,6 +21,7 @@ traffic_off: qsTrId("qtn_drive_trafficoff_item"), settings: qsTrId("qtn_drive_settings_item"), about: qsTrId("qtn_drive_about_item"), + td: "Traffic Details", feedback: qsTrId("qtn_drive_feedback_item") } property variant icons: { @@ -30,6 +31,7 @@ traffic_off: "traffic_off", settings: "settings", about: "about", + td: "traffic_on", feedback: "feedback" } @@ -38,9 +40,10 @@ ListElement { _itemId: "destination"; _targetPage: "locationPicker.qml" } ListElement { _itemId: "saveLocation"; _hideArrow: true } // TODO: Uncomment when management makes up their minds -// ListElement { _itemId: "traffic_on"; _hideArrow: true } + ListElement { _itemId: "traffic_on"; _hideArrow: true } ListElement { _itemId: "settings"; _targetPage: "settings/settingsPage.qml" } ListElement { _itemId: "about"; _targetPage: "aboutPage.qml" } + ListElement { _itemId: "td"; _targetPage: "trafficDetailsPage.qml" } ListElement { _itemId: "feedback"; _targetPage: "npsPage.qml" } function indexById(str) { @@ -165,6 +168,8 @@ if (itemId == "destination") { appModel.setHomeFlow(); } else if (itemId == "feedback") { + trafficModel.selectedEventIndex = 0; + } else if (itemId == "feedback") { if (!appSettingsModel.get('allowConnections') || !device.online) { feedbackOnline(); return; // prevent directly forward to npsPage, since itemArgs is not editable @@ -205,6 +210,7 @@ onBeforeShow: { buttonModel.updateFeedback(); + buttonModel.updateTraffic(); } Component.onCompleted: { --- /usr/lib/drive-qml/views/settings/settingsPage.qml-original 2012-07-19 09:16:08.291126228 +0200 +++ /usr/lib/drive-qml/views/settings/settingsPage.qml 2012-07-17 07:46:05.000000000 +0200 @@ -69,7 +69,7 @@ subtitle: "" } - /** TODO: uncomment when management makes up their minds + ButtonItem { id: traffic itemId: "traffic" @@ -77,7 +77,7 @@ subtitle: trafficSettingsSubtitle(); iconUrl: "../../resources/traffic/list_item/traffic_on.png" } - */ + ButtonItem { id: home --- /usr/lib/drive-qml/views/guidanceMenuPage.qml-original 2012-07-19 09:16:08.143125501 +0200 +++ /usr/lib/drive-qml/views/guidanceMenuPage.qml 2012-08-08 12:08:35.071243491 +0200 @@ -14,8 +14,8 @@ property variant stopGuidanceDialog // TODO: Uncomment when management makes up their minds - //property string trafficTxt: modelFactory.getModel("AppSettingsModel").trafficOn ? qsTrId("qtn_drive_trafficoff_item") : qsTrId("qtn_drive_trafficon_item") - //property string trafficIcon: modelFactory.getModel("AppSettingsModel").trafficOn ? "traffic_off.png" : "traffic_on.png" + property string trafficTxt: modelFactory.getModel("AppSettingsModel").trafficOn ? qsTrId("qtn_drive_trafficoff_item") : qsTrId("qtn_drive_trafficon_item") + property string trafficIcon: modelFactory.getModel("AppSettingsModel").trafficOn ? "traffic_off.png" : "traffic_on.png" VisualItemModel { id: listModel @@ -42,7 +42,7 @@ } // TODO: Uncomment when management makes up their minds - /** + ButtonItem { id: toggletraffic itemId: "toggletraffic" @@ -50,7 +50,7 @@ iconUrl: Components.imagePath + "traffic/list_item/"+trafficIcon hideArrow: true } - */ + ButtonItem { id: settings @@ -65,6 +65,14 @@ title: qsTrId("qtn_drive_about_item") iconUrl: Components.imagePath + "listitems/about.png" } + + ButtonItem { + id: tafficDetails + itemId: "td" + title: "Traffic Details" + iconUrl: Components.imagePath + "traffic/list_item/"+trafficIcon + } + } List { @@ -84,6 +92,9 @@ case "about": nextPageName = "aboutPage.qml"; break; + case "td": + nextPageName = "trafficDetailsPage.qml"; + break; case "stopnavigation": stopGuidance(); break; --- /usr/lib/drive-qml/models/AppSettingsModel.qml-original 2012-07-19 09:16:08.411126833 +0200 +++ /usr/lib/drive-qml/models/AppSettingsModel.qml 2012-07-17 07:46:05.000000000 +0200 @@ -20,7 +20,7 @@ routeOptions: 63, serviceAgreedOn: "", ssoDone: false, - traffic: false, //true, // TODO: change back when management makes up their mind + traffic: true, // TODO: change back when management makes up their mind trafficUpdateInterval: 5, unitSystem: "" } @@ -163,7 +163,7 @@ gpsPowersaving = get('gpsPowersaving'); // TODO: change back when management makes up their minds - trafficOn = false; //get('traffic'); + trafficOn = get('traffic'); mapSensorEnabled = get('mapSensor'); trafficUpdateInterval = get('trafficUpdateInterval'); @@ -178,7 +178,7 @@ Units.currentSystem = getUnitSystem(); // TODO: change back when management makes up their minds - trafficOn = false; //get('allowConnections') && get('mapSensor') && get('traffic') && device.online; + trafficOn = get('allowConnections') && get('mapSensor') && get('traffic') && device.online; } Component.onCompleted: { --- /usr/lib/drive-qml/models/TrafficModel.qml-original 2012-07-19 09:16:08.419126872 +0200 +++ /usr/lib/drive-qml/models/TrafficModel.qml 2012-08-08 12:08:35.071243491 +0200 @@ -18,6 +18,8 @@ property bool mapPanning: (map !== undefined) ? map.hasUserInteraction : false property variant lastRequestCenter property variant map + property int selectedEventIndex: 0 + property variant selectedTrafficEvent property Timer requestTimer: Timer { id: trafficRequestTimer --- /usr/lib/drive-qml/models/RoutingModel.qml-original 2012-07-19 09:16:08.415126851 +0200 +++ /usr/lib/drive-qml/models/RoutingModel.qml 2012-08-08 12:08:35.071243491 +0200 @@ -23,6 +23,7 @@ Router { id: router + useTraffic: true onRoutingDone: { console.log("ROUTINGMODEL -> onRoutingDone: error code = " + errorCode); clearRoute(); @@ -42,6 +43,7 @@ id: routeOptions routeMode: RouteOptions.MODE_CAR routeType: RouteOptions.TYPE_FASTEST + //routeType: RouteOptions.TYPE_SHORTEST } Component.onCompleted: { --- /usr/lib/drive-qml/models/MapSettingsModel.qml-original 2012-07-19 09:16:08.435126945 +0200 +++ /usr/lib/drive-qml/models/MapSettingsModel.qml 2012-07-17 07:46:05.000000000 +0200 @@ -35,7 +35,7 @@ Component.onCompleted: { loadMapSettings(); - //MapsPlugin.dayNightSwitch.connect(onDayNightSwitch); + MapsPlugin.dayNightSwitch.connect(onDayNightSwitch); } //The settings party starts here @@ -84,11 +84,11 @@ dayNightMode = newvalue; //do plugin connecting here //possible values for newvalue string:"day", string:"night", string:"auto" - /* + if (newvalue === "auto") { setNightMode(isNight()); } - else*/ { + else { setNightMode(newvalue === "night"); } } @@ -126,7 +126,7 @@ return ModelHelper.serialize(); } - /** TODO: Fix when plugin support automatic day/night + function isNight() { var positioningModel = ModelFactory.getModel("PositioningModel"), pos = positioningModel.getReferencePosition(); @@ -137,8 +137,8 @@ var lat_rad = pos.latitude * (Math.PI/180); var declination = (23.4*Math.PI)/180 * Math.sin(2*Math.PI * (284+dayOfTheYear)/365); var omega = Math.acos(-Math.tan(declination) * Math.tan(lat_rad)); - var sunset = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60; - var sunrise = 24 - sunset; //(1/15) * omega * (180/Math.PI) - pos.longitude/15 + today.getTimezoneOffset()/60; + var sunset = 12 + (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60; + var sunrise = 12 - (1/15) * omega * (180/Math.PI) - pos.longitude/15 - today.getTimezoneOffset()/60; console.log("Sunset:" + sunset); console.log("Sunrise:" + sunrise); @@ -158,5 +158,5 @@ setNightMode(isNight()); } } - */ + }