X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=qml%2Fpages%2FMainPage.qml;h=03d86a2e4b39c29b93bceb623c8a6e48cb1837f9;hp=31b14470c3db2e558d8a690850f82a45354edec4;hb=371dcf3335b355f8d421352a394161dc6d9b9f24;hpb=e917baa52e7157c7c41424527c3881c22ff65588 diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 31b1447..03d86a2 100644 --- a/qml/pages/MainPage.qml +++ b/qml/pages/MainPage.qml @@ -3,7 +3,6 @@ import Sailfish.Silica 1.0 Page { id: page - property bool cycling: false // The effective value will be restricted by ApplicationWindow.allowedOrientations allowedOrientations: Orientation.All @@ -40,17 +39,17 @@ Page { Button { anchors.horizontalCenter: parent.horizontalCenter - text: cycling ? qsTr("Finish") : qsTr("Start a journey") + text: currentStatus.cycling ? qsTr("Finish") : qsTr("Start a journey") onClicked: { - if (cycling) { - var dialog = pageStack.push(Qt.resolvedUrl("AddJourney.qml")) + if (currentStatus.cycling) { + var dialog = pageStack.push(Qt.resolvedUrl("AddJourney.qml"), {title: "Finish journey", start: journeymodel.epochToDateTime(currentStatus.startTime), duration: currentStatus.getDuration()}) dialog.accepted.connect(function() { - cycling = false + currentStatus.cycling = false }) } else { - cycling = true + currentStatus.startJourney() } } }