X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=qml%2Fpages%2FMainPage.qml;h=5c0c16bdda3d7867c75a938ff70ecdf0abaa8790;hp=31b14470c3db2e558d8a690850f82a45354edec4;hb=5fc520bad80dccf9bf2e0f16552c9f2605417067;hpb=0108947ead4cc9e0ff23fee82db2fb1fd7cb2dad diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml index 31b1447..5c0c16b 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 @@ -12,16 +11,18 @@ Page { SilicaFlickable { anchors.fill: parent + VerticalScrollDecorator {} + // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { MenuItem { - text: qsTr("Show Page 2") - onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml")) + text: qsTr("About") + onClicked: pageStack.push(Qt.resolvedUrl("About.qml")) } } // Tell SilicaFlickable the height of its content. - contentHeight: column.height + contentHeight: column.implicitHeight + Theme.paddingLarge // Place our content in a Column. The PageHeader is always placed at the top // of the page, followed by our content. @@ -40,17 +41,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("JourneyEdit.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() } } } @@ -62,7 +63,7 @@ Page { Button { anchors.horizontalCenter: parent.horizontalCenter text: qsTr("Enter journey") - onClicked: pageStack.push(Qt.resolvedUrl("AddJourney.qml")) + onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml")) } SectionHeader {