on xenial help sign in
update some more things
commit513912d46f77fca3449764ac2c097ba047df8897 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 1 Jul 2016, 12:22 (10 years ago) parent40d65dc
3 files changed+41−5
qml/Components/VirtualTouchPad.qml+12−4 qml/DisabledScreenNotice.qml+12−1 tests/qmltests/tst_DisabledScreenNotice.qml+17
qml/Components/VirtualTouchPad.qml+12−4
@@ -29,6 +29,7 @@ Item {
2929 function runTutorial() {
3030 tutorial.start()
3131 }
32+ signal tutorialDone();
3233
3334 readonly property bool pressed: point1.pressed || point2.pressed || leftButton.pressed || rightButton.pressed
3435
@@ -218,7 +219,7 @@ Item {
218219 SequentialAnimation {
219220 id: tutorial
220221 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
221− PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap left button to click") }
222+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap left button to click.") }
222223 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
223224 SequentialAnimation {
224225 loops: 2
@@ -230,7 +231,7 @@ Item {
230231 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
231232
232233 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
233− PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap right button to right click") }
234+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Tap right button to right click.") }
234235 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
235236 SequentialAnimation {
236237 loops: 2
@@ -242,7 +243,7 @@ Item {
242243 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
243244
244245 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
245− PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Swipe with two fingers to scroll") }
246+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Swipe with two fingers to scroll.") }
246247 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
247248 PropertyAction { target: tutorialFinger1; property: "x"; value: root.width / 2 - tutorialFinger1.width - units.gu(1) }
248249 PropertyAction { target: tutorialFinger2; property: "x"; value: root.width / 2 + tutorialFinger1.width + units.gu(1) - tutorialFinger2.width }
@@ -282,8 +283,15 @@ Item {
282283 UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
283284 UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
284285 }
285− PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
286+ PauseAnimation { duration: UbuntuAnimation.SlowDuration }
286287 }
287288 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
289+
290+ PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
291+ PropertyAction { target: tutorialLabel; property: "text"; value: i18n.tr("Find more settings in the system settings.") }
292+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
293+ PauseAnimation { duration: 2000 }
294+ UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
295+ ScriptAction { script: root.tutorialDone(); }
288296 }
289297}
qml/DisabledScreenNotice.qml+12−1
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.3
2020import Unity.Session 0.1
2121import Unity.Screens 0.1
2222import QtQuick.Window 2.2
23+import Qt.labs.settings 1.0
2324import "Components"
2425
2526Item {
@@ -81,16 +82,20 @@ Item {
8182 }
8283
8384 VirtualTouchPad {
85+ objectName: "virtualTouchPad"
8486 anchors.fill: parent
8587
8688 onPressedChanged: {
8789 if (pressed && infoNoteDisplayed) {
8890 infoNoteDisplayed = false;
89− if (true) {
91+ if (!firstRunSettings.tutorialHasRun) {
9092 runTutorial();
9193 }
9294 }
9395 }
96+ onTutorialDone: {
97+ firstRunSettings.tutorialHasRun = true;
98+ }
9499 }
95100
96101 Item {
@@ -133,4 +138,10 @@ Item {
133138 anchors.fill: parent
134139 }
135140 }
141+
142+ Settings {
143+ id: firstRunSettings
144+ objectName: "firstRunSettings"
145+ property bool tutorialHasRun: false
146+ }
136147}
tests/qmltests/tst_DisabledScreenNotice.qml+17
@@ -60,6 +60,7 @@ Item {
6060 Column {
6161 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
6262 width: units.gu(40)
63+ spacing: units.gu(1)
6364
6465 ItemSelector {
6566 id: orientationSelector
@@ -77,6 +78,22 @@ Item {
7778 Layout.fillWidth: true
7879 }
7980 }
81+ Button {
82+ text: "Reset first run settings"
83+ onClicked: {
84+ print("foooo")
85+ var settings = testCase.findInvisibleChild(touchScreenPad, "firstRunSettings");
86+ print("have settigs:", settings)
87+ settings.tutorialHasRun = false;
88+ }
89+ }
90+ Button {
91+ text: "Run tutorial now"
92+ onClicked: {
93+ var touchPad = testCase.findChild(touchScreenPad, "virtualTouchPad")
94+ touchPad.runTutorial();
95+ }
96+ }
8097 }
8198
8299 UnityTestCase {