on xenial help sign in
skip the page when there's no HW keyboard attached
commit9e024845beed039ce539834a6c2650c6e190df68 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateWed 18 May 2016, 14:25 (10 years ago) parentf3d9288
2 files changed+16
qml/Wizard/Pages/20-keyboard.qml+10 tests/qmltests/Wizard/tst_Wizard.qml+6
qml/Wizard/Pages/20-keyboard.qml+10
@@ -20,6 +20,7 @@ import Ubuntu.Components 1.3
2020import Ubuntu.Components.ListItems 1.3
2121import Ubuntu.SystemSettings.LanguagePlugin 1.0
2222import Wizard 0.1
23+import Unity.InputInfo 0.1
2324import ".." as LocalComponents
2425
2526LocalComponents.Page {
@@ -28,6 +29,9 @@ LocalComponents.Page {
2829 title: i18n.tr("Hardware Keyboard")
2930 forwardButtonSourceComponent: forwardButton
3031
32+ skip: keyboardsModel.count == 0
33+ skipValid: false
34+
3135 UbuntuLanguagePlugin {
3236 id: langPlugin
3337 }
@@ -37,6 +41,12 @@ LocalComponents.Page {
3741 language: selectedLanguage
3842 }
3943
44+ InputDeviceModel {
45+ id: keyboardsModel
46+ deviceFilter: InputInfo.Keyboard
47+ Component.onCompleted: skipValid = true;
48+ }
49+
4050 Component.onCompleted: print("Initial language:", i18n.language)
4151
4252 readonly property string selectedLanguage: langPlugin.languageCodes[langSelector.selectedIndex].split(".")[0] // chop off the codeset (.UTF-8)
tests/qmltests/Wizard/tst_Wizard.qml+6
@@ -24,6 +24,7 @@ import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2424import Ubuntu.SystemSettings.TimeDate 1.0
2525import Unity.Test 0.1 as UT
2626import Wizard 0.1
27+import Unity.InputInfo 0.1
2728import "../../../qml/Wizard"
2829
2930Item {
@@ -41,7 +42,12 @@ Item {
4142 id: wizard
4243 anchors.fill: parent
4344
45+ Component.onCompleted: {
46+ MockInputDeviceBackend.addMockDevice("/test", InputInfo.Keyboard);
47+ }
48+
4449 Component.onDestruction: {
50+ MockInputDeviceBackend.removeDevice("/test");
4551 wizardLoader.itemDestroyed = true;
4652 }
4753 }