on xenial help sign in
Have the tablet greeter set appropriate OSK hints if the user has a passcode instead of a passphrase. Fixes: #1544173

Approved by: Josh Arenson

commit55061aeea380a3dbdc2e3b14483a84c047b30629 authorMichael Terry <michael.terry@canonical.com> dateFri 12 Feb 2016, 00:12 (11 years ago) parentdf5b541d4d1ccc
3 files changed+15−1
qml/Greeter/LoginList.qml+3 qml/Greeter/WideView.qml+1−1 tests/qmltests/Greeter/tst_WideView.qml+11
qml/Greeter/LoginList.qml+3
@@ -22,6 +22,7 @@ Item {
2222 id: root
2323
2424 property alias model: userList.model
25+ property bool alphanumeric: true
2526 property int currentIndex
2627 property bool locked
2728
@@ -231,6 +232,8 @@ Item {
231232 width: parent.width - anchors.margins * 2
232233 opacity: userList.movingInternally ? 0 : 1
233234
235+ inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
236+
234237 property string promptText
235238 placeholderText: root.wasPrompted ? promptText
236239 : (root.locked ? i18n.tr("Retry")
qml/Greeter/WideView.qml+1−1
@@ -27,7 +27,7 @@ FocusScope {
2727 property alias backgroundTopMargin: coverPage.backgroundTopMargin
2828 property alias background: coverPage.background
2929 property bool locked
30− property bool alphanumeric // unused
30+ property alias alphanumeric: loginList.alphanumeric
3131 property alias userModel: loginList.model
3232 property alias infographicModel: coverPage.infographicModel
3333 readonly property bool fullyShown: coverPage.showProgress === 1
tests/qmltests/Greeter/tst_WideView.qml+11
@@ -522,5 +522,16 @@ Item {
522522
523523 tryCompare(loginList, "height", view.height);
524524 }
525+
526+ function test_alphanumeric() {
527+ var passwordInput = findChild(view, "passwordInput");
528+
529+ verify(view.alphanumeric);
530+ compare(passwordInput.inputMethodHints, Qt.ImhNone);
531+ view.alphanumeric = false;
532+ compare(passwordInput.inputMethodHints, Qt.ImhDigitsOnly);
533+ view.alphanumeric = true;
534+ compare(passwordInput.inputMethodHints, Qt.ImhNone);
535+ }
525536 }
526537}