on xenial help sign in
update some more things
513912dMichael Zanetti
qml/Components/VirtualTouchPad.qml+12−4
@@ -29,6 +29,7 @@ Item {
29 function runTutorial() {
29 function runTutorial() {
30 tutorial.start()
30 tutorial.start()
31 }
31 }
32+ signal tutorialDone();
32
33
33 readonly property bool pressed: point1.pressed || point2.pressed || leftButton.pressed || rightButton.pressed
34 readonly property bool pressed: point1.pressed || point2.pressed || leftButton.pressed || rightButton.pressed
34
35
@@ -218,7 +219,7 @@ Item {
218 SequentialAnimation {
219 SequentialAnimation {
219 id: tutorial
220 id: tutorial
220 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
221 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.") }
222 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
223 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
223 SequentialAnimation {
224 SequentialAnimation {
224 loops: 2
225 loops: 2
@@ -230,7 +231,7 @@ Item {
230 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
231 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
231
232
232 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
233 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.") }
234 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
235 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
235 SequentialAnimation {
236 SequentialAnimation {
236 loops: 2
237 loops: 2
@@ -242,7 +243,7 @@ Item {
242 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
243 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
243
244
244 PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
245 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.") }
246 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
247 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 1; duration: UbuntuAnimation.FastDuration }
247 PropertyAction { target: tutorialFinger1; property: "x"; value: root.width / 2 - tutorialFinger1.width - units.gu(1) }
248 PropertyAction { target: tutorialFinger1; property: "x"; value: root.width / 2 - tutorialFinger1.width - units.gu(1) }
248 PropertyAction { target: tutorialFinger2; property: "x"; value: root.width / 2 + tutorialFinger1.width + units.gu(1) - tutorialFinger2.width }
249 PropertyAction { target: tutorialFinger2; property: "x"; value: root.width / 2 + tutorialFinger1.width + units.gu(1) - tutorialFinger2.width }
@@ -282,8 +283,15 @@ Item {
282 UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
283 UbuntuNumberAnimation { target: tutorialFinger1; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
283 UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
284 UbuntuNumberAnimation { target: tutorialFinger2; property: "scale"; from: 1; to: 0; duration: UbuntuAnimation.FastDuration }
284 }
285 }
285− PauseAnimation { duration: UbuntuAnimation.SleepyDuration }
286+ PauseAnimation { duration: UbuntuAnimation.SlowDuration }
286 }
287 }
287 UbuntuNumberAnimation { target: tutorialLabel; property: "opacity"; to: 0; duration: UbuntuAnimation.FastDuration }
288 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(); }
288 }
296 }
289}
297}
qml/DisabledScreenNotice.qml+12−1
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.3
20import Unity.Session 0.1
20import Unity.Session 0.1
21import Unity.Screens 0.1
21import Unity.Screens 0.1
22import QtQuick.Window 2.2
22import QtQuick.Window 2.2
23+import Qt.labs.settings 1.0
23import "Components"
24import "Components"
24
25
25Item {
26Item {
@@ -81,16 +82,20 @@ Item {
81 }
82 }
82
83
83 VirtualTouchPad {
84 VirtualTouchPad {
85+ objectName: "virtualTouchPad"
84 anchors.fill: parent
86 anchors.fill: parent
85
87
86 onPressedChanged: {
88 onPressedChanged: {
87 if (pressed && infoNoteDisplayed) {
89 if (pressed && infoNoteDisplayed) {
88 infoNoteDisplayed = false;
90 infoNoteDisplayed = false;
89− if (true) {
91+ if (!firstRunSettings.tutorialHasRun) {
90 runTutorial();
92 runTutorial();
91 }
93 }
92 }
94 }
93 }
95 }
96+ onTutorialDone: {
97+ firstRunSettings.tutorialHasRun = true;
98+ }
94 }
99 }
95
100
96 Item {
101 Item {
@@ -133,4 +138,10 @@ Item {
133 anchors.fill: parent
138 anchors.fill: parent
134 }
139 }
135 }
140 }
141+
142+ Settings {
143+ id: firstRunSettings
144+ objectName: "firstRunSettings"
145+ property bool tutorialHasRun: false
146+ }
136}
147}
tests/qmltests/tst_DisabledScreenNotice.qml+17
@@ -60,6 +60,7 @@ Item {
60 Column {
60 Column {
61 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
61 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
62 width: units.gu(40)
62 width: units.gu(40)
63+ spacing: units.gu(1)
63
64
64 ItemSelector {
65 ItemSelector {
65 id: orientationSelector
66 id: orientationSelector
@@ -77,6 +78,22 @@ Item {
77 Layout.fillWidth: true
78 Layout.fillWidth: true
78 }
79 }
79 }
80 }
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+ }
80 }
97 }
81
98
82 UnityTestCase {
99 UnityTestCase {