projects
/
harbour-pedalo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Corrently add, edit and list journey details
[harbour-pedalo.git]
/
qml
/
pages
/
MainPage.qml
diff --git
a/qml/pages/MainPage.qml
b/qml/pages/MainPage.qml
index
31b1447
..
03d86a2
100644
(file)
--- a/
qml/pages/MainPage.qml
+++ b/
qml/pages/MainPage.qml
@@
-3,7
+3,6
@@
import Sailfish.Silica 1.0
Page {
id: page
Page {
id: page
- property bool cycling: false
// The effective value will be restricted by ApplicationWindow.allowedOrientations
allowedOrientations: Orientation.All
// The effective value will be restricted by ApplicationWindow.allowedOrientations
allowedOrientations: Orientation.All
@@
-40,17
+39,17
@@
Page {
Button {
anchors.horizontalCenter: parent.horizontalCenter
Button {
anchors.horizontalCenter: parent.horizontalCenter
- text: cycling ? qsTr("Finish") : qsTr("Start a journey")
+ text: currentStatus.cycling ? qsTr("Finish") : qsTr("Start a journey")
onClicked: {
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() {
dialog.accepted.connect(function() {
- cycling = false
+ currentStatus.cycling = false
})
}
else {
})
}
else {
- cycling = true
+ currentStatus.startJourney()
}
}
}
}
}
}