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
55061aeMichael Terry
qml/Greeter/LoginList.qml+3
@@ -22,6 +22,7 @@ Item {
22 id: root
22 id: root
23
23
24 property alias model: userList.model
24 property alias model: userList.model
25+ property bool alphanumeric: true
25 property int currentIndex
26 property int currentIndex
26 property bool locked
27 property bool locked
27
28
@@ -231,6 +232,8 @@ Item {
231 width: parent.width - anchors.margins * 2
232 width: parent.width - anchors.margins * 2
232 opacity: userList.movingInternally ? 0 : 1
233 opacity: userList.movingInternally ? 0 : 1
233
234
235+ inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
236+
234 property string promptText
237 property string promptText
235 placeholderText: root.wasPrompted ? promptText
238 placeholderText: root.wasPrompted ? promptText
236 : (root.locked ? i18n.tr("Retry")
239 : (root.locked ? i18n.tr("Retry")
qml/Greeter/WideView.qml+1−1
@@ -27,7 +27,7 @@ FocusScope {
27 property alias backgroundTopMargin: coverPage.backgroundTopMargin
27 property alias backgroundTopMargin: coverPage.backgroundTopMargin
28 property alias background: coverPage.background
28 property alias background: coverPage.background
29 property bool locked
29 property bool locked
30− property bool alphanumeric // unused
30+ property alias alphanumeric: loginList.alphanumeric
31 property alias userModel: loginList.model
31 property alias userModel: loginList.model
32 property alias infographicModel: coverPage.infographicModel
32 property alias infographicModel: coverPage.infographicModel
33 readonly property bool fullyShown: coverPage.showProgress === 1
33 readonly property bool fullyShown: coverPage.showProgress === 1
tests/qmltests/Greeter/tst_WideView.qml+11
@@ -522,5 +522,16 @@ Item {
522
522
523 tryCompare(loginList, "height", view.height);
523 tryCompare(loginList, "height", view.height);
524 }
524 }
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+ }
525 }
536 }
526}
537}