Add Pedalo Rules for viewing in the app
authorDavid Llewellyn-Jones <david@flypig.co.uk>
Tue, 17 Jul 2018 20:38:42 +0000 (21:38 +0100)
committerDavid Llewellyn-Jones <david@flypig.co.uk>
Tue, 17 Jul 2018 20:38:42 +0000 (21:38 +0100)
harbour-pedalo.pro
qml/pages/MainPage.qml
qml/pages/TheRules.qml [new file with mode: 0644]
translations/harbour-pedalo-de.ts
translations/harbour-pedalo.ts

index ce9b2c7..327a46e 100644 (file)
@@ -52,7 +52,8 @@ DISTFILES += qml/harbour-pedalo.qml \
     qml/pages/JourneyInfo.qml \
     qml/components/BarButton.qml \
     qml/cover/ClockView.qml \
-    qml/cover/LargeItem.qml
+    qml/cover/LargeItem.qml \
+    qml/pages/TheRules.qml
 
 SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172 256x256
 
index 8190afc..f5c0397 100644 (file)
@@ -20,6 +20,11 @@ Page {
                 text: qsTr("About")
                 onClicked: pageStack.push(Qt.resolvedUrl("About.qml"))
             }
+
+            MenuItem {
+                text: qsTr("The Pedalo Rules")
+                onClicked: pageStack.push(Qt.resolvedUrl("TheRules.qml"))
+            }
         }
 
         // Tell SilicaFlickable the height of its content.
@@ -51,7 +56,7 @@ Page {
 
             BarButton {
                 source: "image://pedalo/button-journey-add?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
-                text: "Add a journey"
+                text: qsTr("Add a journey")
                 onClicked: pageStack.push(Qt.resolvedUrl("JourneyEdit.qml"))
             }
         }
@@ -67,13 +72,13 @@ Page {
 
             BarButton {
                 source: "image://pedalo/button-stats?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
-                text: "View latest stats"
+                text: qsTr("View latest stats")
                 onClicked: pageStack.push(Qt.resolvedUrl("Stats.qml"))
             }
 
             BarButton {
                 source: "image://pedalo/button-list?" + (pressed ? Theme.primaryColor : Theme.highlightColor)
-                text: "Previous journeys"
+                text: qsTr("Previous journeys")
                 onClicked: pageStack.push(Qt.resolvedUrl("JourneyList.qml"))
             }
         }
diff --git a/qml/pages/TheRules.qml b/qml/pages/TheRules.qml
new file mode 100644 (file)
index 0000000..8a5cdc2
--- /dev/null
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+
+Page {
+    id: rulesPage
+
+    // The effective value will be restricted by ApplicationWindow.allowedOrientations
+    allowedOrientations: Orientation.All
+
+    VerticalScrollDecorator {}
+
+    SilicaFlickable {
+        anchors.fill: parent
+        contentHeight: rulesColumn.height + Theme.paddingLarge
+        flickableDirection: Flickable.VerticalFlick
+
+        Column {
+            id: rulesColumn
+            width: parent.width - 2 * Theme.horizontalPageMargin
+            anchors.horizontalCenter: parent.horizontalCenter
+
+            PageHeader {
+                id: headerItem
+                title: qsTr("The Pedalo Rules")
+            }
+
+            Label {
+                id: rulestext
+                width: parent.width
+                wrapMode: Text.WrapAtWordBoundaryOrAnywhere
+                textFormat: TextEdit.RichText
+                horizontalAlignment: Text.AlignLeft
+                font.pixelSize: Theme.fontSizeSmall
+                text: "
+To get an accurate reflection of your relative speed, it's important to follow some common-sense rules.
+<br/>
+<br/>
+On each journey keep a mental note of how many pedalos you overtake (<i>overtakees</i>), and how many other pedalos overtake you (<i>overtakers</i>). Enter these numbers in the app at the end of your journey.
+<br/>
+<br/>
+To keep track of these numbers in a sensible way:
+<br/>
+<ol>
+<li>Remember two numbers: how many pedalos you overtake, and how many pedalos overtake you.</li>
+<li>Don't count any overtakes that happen when you're at a junction, or slowing down for a junction.</li>
+<li>Only count overtakes with pedalos that are travelling on the same route and in the same direction as you.</li>
+<li>If you overtake a pedalo and add one to your <i>overtakees</i> value, but they then overtake you back, subtract it from your <i>overtakees</i> value, rather than adding it to your <i>overtakers<i> value.</li>
+<li>Similarly if it happens the other way around.</li>
+</ol>
+<br/>
+The master rule is that, whatever approach you use, be consistent and apply the same rules in the same way for people you overtake as you do for people who overtake you.
+<br/>
+<br/>
+Stay safe and cycle considerately!
+"
+            }
+        }
+    }
+
+
+}
+
+
index c974b69..9bd0677 100644 (file)
         <source>Finish your journey</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Rules</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>Stats</name>
         <translation type="unfinished"></translation>
     </message>
 </context>
+<context>
+    <name>TheRules</name>
+    <message>
+        <source>The Pedalo Rules</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
 </TS>
index c974b69..9bd0677 100644 (file)
         <source>Finish your journey</source>
         <translation type="unfinished"></translation>
     </message>
+    <message>
+        <source>Rules</source>
+        <translation type="unfinished"></translation>
+    </message>
 </context>
 <context>
     <name>Stats</name>
         <translation type="unfinished"></translation>
     </message>
 </context>
+<context>
+    <name>TheRules</name>
+    <message>
+        <source>The Pedalo Rules</source>
+        <translation type="unfinished"></translation>
+    </message>
+</context>
 </TS>