on xenial help sign in
disable tutorial when there's no touch screen
bb74553Lukáš Tinkl
qml/OrientedShell.qml+1
@@ -268,6 +268,7 @@ Item {
268 mode: applicationArguments.mode
268 mode: applicationArguments.mode
269 hasMouse: pointerInputDevices > 0
269 hasMouse: pointerInputDevices > 0
270 hasKeyboard: keyboardsModel.count > 0
270 hasKeyboard: keyboardsModel.count > 0
271+ hasTouchscreen: touchScreensModel.count > 0
271 // TODO: Factor in if the current screen is a touch screen and if the user wants to
272 // TODO: Factor in if the current screen is a touch screen and if the user wants to
272 // have multiple keyboards around. For now we only enable one keyboard at a time
273 // have multiple keyboards around. For now we only enable one keyboard at a time
273 // thus hiding it here if there is a physical one around or if we have a second
274 // thus hiding it here if there is a physical one around or if we have a second
qml/Shell.qml+3
@@ -69,6 +69,7 @@ StyledItem {
69 }
69 }
70 property bool hasMouse: false
70 property bool hasMouse: false
71 property bool hasKeyboard: false
71 property bool hasKeyboard: false
72+ property bool hasTouchscreen: false
72
73
73 // to be read from outside
74 // to be read from outside
74 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
75 readonly property int mainAppWindowOrientationAngle: stage.mainAppWindowOrientationAngle
@@ -625,6 +626,8 @@ StyledItem {
625 objectName: "tutorial"
626 objectName: "tutorial"
626 anchors.fill: parent
627 anchors.fill: parent
627
628
629+ enabled: shell.hasTouchscreen
630+ visible: enabled
628 paused: callManager.hasCalls || !greeter || greeter.active ||
631 paused: callManager.hasCalls || !greeter || greeter.active ||
629 wizard.active
632 wizard.active
630 delayed: dialogs.hasActiveDialog || notifications.hasNotification ||
633 delayed: dialogs.hasActiveDialog || notifications.hasNotification ||
tests/qmltests/tst_OrientedShell.qml+12
@@ -1640,5 +1640,17 @@ Rectangle {
1640 tryCompare(dialogLoader, "item", null);
1640 tryCompare(dialogLoader, "item", null);
1641 compare(window.activeFocusItem, surfaceItem);
1641 compare(window.activeFocusItem, surfaceItem);
1642 }
1642 }
1643+
1644+ function test_tutorialDisabledWithNoTouchscreen() {
1645+ loadShell("desktop");
1646+ usageModeSelector.selectWindowed();
1647+
1648+ MockInputDeviceBackend.addMockDevice("/touchscreen", InputInfo.TouchScreen);
1649+ var tutorial = findChild(shell, "tutorial");
1650+ tryCompare(tutorial, "enabled", true);
1651+
1652+ MockInputDeviceBackend.removeDevice("/touchscreen");
1653+ tryCompare(tutorial, "enabled", false);
1654+ }
1643 }
1655 }
1644}
1656}