2015-12-05 01:05:39 +00:00
|
|
|
Index: plasma-workspace-5.5.0/lookandfeel/contents/components/UserSelect.qml
|
2015-11-11 18:30:47 +00:00
|
|
|
===================================================================
|
2015-12-05 01:05:39 +00:00
|
|
|
--- plasma-workspace-5.5.0.orig/lookandfeel/contents/components/UserSelect.qml
|
|
|
|
+++ plasma-workspace-5.5.0/lookandfeel/contents/components/UserSelect.qml
|
|
|
|
@@ -27,11 +27,15 @@ FocusScope {
|
2015-11-11 18:30:47 +00:00
|
|
|
id: root
|
|
|
|
property alias model: usersList.model
|
|
|
|
property alias selectedUser: usersList.selectedUser
|
|
|
|
+ property var username: usersList.visible ? usersList.selectedUser : userPasswordPrompt.username
|
|
|
|
+ property alias password: userPasswordPrompt.password
|
|
|
|
property alias selectedIndex: usersList.currentIndex
|
2015-11-28 16:20:53 +00:00
|
|
|
property alias selectedItem: usersList.currentItem
|
2015-11-11 18:30:47 +00:00
|
|
|
property alias delegate: usersList.delegate
|
|
|
|
property alias notification: notificationLabel.text
|
2015-12-05 01:05:39 +00:00
|
|
|
property alias infoPaneVisible: infoPaneLoader.active
|
2015-11-20 15:17:36 +00:00
|
|
|
+ property bool showUserList: (usersList.model.count && usersList.model.disableAvatarsThreshold) ? usersList.model.count <= usersList.model.disableAvatarsThreshold : true
|
2015-11-11 18:30:47 +00:00
|
|
|
+ property alias pwFieldEnabled: userPasswordPrompt.pwFieldEnabled
|
|
|
|
|
|
|
|
activeFocusOnTab: true
|
|
|
|
|
2015-12-05 01:05:39 +00:00
|
|
|
@@ -43,6 +47,10 @@ FocusScope {
|
2015-11-11 18:30:47 +00:00
|
|
|
usersList.decrementCurrentIndex()
|
|
|
|
}
|
|
|
|
|
|
|
|
+ function reenablePasswordInput() {
|
|
|
|
+ userPasswordPrompt.reenablePasswordInput();
|
|
|
|
+ }
|
|
|
|
+
|
2015-12-05 01:05:39 +00:00
|
|
|
Loader {
|
|
|
|
id: infoPaneLoader
|
2015-11-11 18:30:47 +00:00
|
|
|
anchors {
|
2015-12-05 01:05:39 +00:00
|
|
|
@@ -57,6 +65,7 @@ FocusScope {
|
2015-11-11 18:30:47 +00:00
|
|
|
id: usersList
|
|
|
|
|
|
|
|
focus: true
|
|
|
|
+ visible: root.showUserList
|
|
|
|
|
2015-12-05 01:05:39 +00:00
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
@@ -96,6 +105,21 @@ FocusScope {
|
|
|
|
]
|
2015-11-11 18:30:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+ UserPasswordPrompt {
|
|
|
|
+ id: userPasswordPrompt
|
|
|
|
+
|
|
|
|
+ focus: true
|
|
|
|
+ visible: !root.showUserList
|
|
|
|
+
|
|
|
|
+ anchors {
|
|
|
|
+ left: parent.horizontalCenter
|
|
|
|
+ top: parent.top
|
|
|
|
+ right: parent.right
|
|
|
|
+
|
|
|
|
+ topMargin: parent.height*0.2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
BreezeLabel {
|
|
|
|
id: notificationLabel
|
|
|
|
anchors {
|
|
|
|
Index: plasma-workspace-5.4.3/lookandfeel/contents/components/UserPasswordPrompt.qml
|
|
|
|
===================================================================
|
|
|
|
--- plasma-workspace-5.4.3.orig/lookandfeel/contents/components/UserPasswordPrompt.qml 2015-11-11 16:14:28.277434982 +0100
|
|
|
|
+++ plasma-workspace-5.4.3/lookandfeel/contents/components/UserPasswordPrompt.qml 2015-11-11 15:25:12.528242834 +0100
|
|
|
|
@@ -0,0 +1,54 @@
|
|
|
|
+import QtQuick 2.2
|
|
|
|
+import SddmComponents 2.0
|
|
|
|
+import QtQuick.Layouts 1.1
|
|
|
|
+import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
|
|
+
|
|
|
|
+Rectangle {
|
|
|
|
+ readonly property string username: usernameInput.text
|
|
|
|
+ readonly property string password: passwordInput.text
|
|
|
|
+ property alias pwFieldEnabled: passwordInput.enabled
|
|
|
|
+ color: "transparent"
|
|
|
|
+
|
|
|
|
+ function reenablePasswordInput() {
|
|
|
|
+ passwordInput.enabled = true
|
|
|
|
+ passwordInput.selectAll()
|
|
|
|
+ passwordInput.forceActiveFocus()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ColumnLayout {
|
|
|
|
+ anchors.fill: parent
|
|
|
|
+ PlasmaComponents.TextField {
|
|
|
|
+ id: usernameInput
|
|
|
|
+ placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Username")
|
|
|
|
+ onAccepted: nextItemInFocusChain().forceActiveFocus();
|
|
|
|
+ focus: true
|
|
|
|
+ text: userModel.lastUser
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ PlasmaComponents.TextField {
|
|
|
|
+ id: passwordInput
|
|
|
|
+ placeholderText: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Password")
|
|
|
|
+ echoMode: TextInput.Password
|
|
|
|
+ onAccepted: loginPrompt.startLogin()
|
|
|
|
+ focus: true
|
|
|
|
+
|
|
|
|
+ //focus works in qmlscene
|
|
|
|
+ //but this seems to be needed when loaded from SDDM
|
|
|
|
+ //I don't understand why, but we have seen this before in the old lock screen
|
|
|
|
+ Timer {
|
|
|
|
+ interval: 200
|
|
|
|
+ running: parent.visible
|
|
|
|
+ onTriggered: passwordInput.forceActiveFocus()
|
|
|
|
+ }
|
|
|
|
+ //end hack
|
|
|
|
+
|
|
|
|
+ Keys.onEscapePressed: {
|
|
|
|
+ //nextItemInFocusChain(false) is previous Item
|
|
|
|
+ nextItemInFocusChain(false).forceActiveFocus();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } // ColumnLayout
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
Index: plasma-workspace-5.4.3/lookandfeel/contents/loginmanager/Main.qml
|
|
|
|
===================================================================
|
|
|
|
--- plasma-workspace-5.4.3.orig/lookandfeel/contents/loginmanager/Main.qml 2015-11-05 13:49:30.000000000 +0100
|
|
|
|
+++ plasma-workspace-5.4.3/lookandfeel/contents/loginmanager/Main.qml 2015-11-11 15:25:12.832242854 +0100
|
2015-11-28 16:20:53 +00:00
|
|
|
@@ -74,6 +74,9 @@ Image {
|
2015-11-11 18:30:47 +00:00
|
|
|
|
|
|
|
initialItem: BreezeBlock {
|
|
|
|
id: loginPrompt
|
|
|
|
+ property var showUserList: mainItem.showUserList
|
|
|
|
+ property var username: mainItem.username
|
|
|
|
+ property var password: mainItem.showUserList ? controlsItem.password : mainItem.password
|
|
|
|
|
|
|
|
//Enable clipping whilst animating, otherwise the items would be shifted to other screens in multiscreen setups
|
|
|
|
//As there are only 2 items (loginPrompt and logoutScreenComponent), it's sufficient to do it only in this component
|
2015-11-28 16:20:53 +00:00
|
|
|
@@ -129,13 +132,14 @@ Image {
|
2015-11-11 18:30:47 +00:00
|
|
|
echoMode: TextInput.Password
|
|
|
|
onAccepted: loginPrompt.startLogin()
|
|
|
|
focus: true
|
|
|
|
+ visible: loginPrompt.mainItem.showUserList
|
|
|
|
|
|
|
|
//focus works in qmlscene
|
|
|
|
//but this seems to be needed when loaded from SDDM
|
|
|
|
//I don't understand why, but we have seen this before in the old lock screen
|
|
|
|
Timer {
|
|
|
|
interval: 200
|
|
|
|
- running: true
|
|
|
|
+ running: passwordInput.visible
|
|
|
|
onTriggered: passwordInput.forceActiveFocus()
|
|
|
|
}
|
|
|
|
//end hack
|
2015-11-28 16:20:53 +00:00
|
|
|
@@ -221,9 +225,13 @@ Image {
|
2015-11-11 18:30:47 +00:00
|
|
|
target: sddm
|
|
|
|
onLoginFailed: {
|
|
|
|
//Re-enable button and textfield
|
|
|
|
- passwordInput.enabled = true
|
|
|
|
- passwordInput.selectAll()
|
|
|
|
- passwordInput.forceActiveFocus()
|
|
|
|
+ if (loginPrompt.showUserList) {
|
|
|
|
+ passwordInput.enabled = true
|
|
|
|
+ passwordInput.selectAll()
|
|
|
|
+ passwordInput.forceActiveFocus()
|
|
|
|
+ } else {
|
|
|
|
+ loginPrompt.mainItem.reenablePasswordInput(true);
|
|
|
|
+ }
|
|
|
|
loginButton.enabled = true;
|
|
|
|
}
|
|
|
|
}
|
2015-11-28 16:20:53 +00:00
|
|
|
@@ -232,11 +240,12 @@ Image {
|
2015-11-11 18:30:47 +00:00
|
|
|
|
|
|
|
function startLogin () {
|
|
|
|
//Disable button and textfield while password check is running
|
|
|
|
+ loginPrompt.mainItem.pwFieldEnabled = false
|
|
|
|
controlsItem.pwFieldEnabled = false;
|
|
|
|
controlsItem.buttonEnabled = false;
|
|
|
|
//Clear notification in case the notificationResetTimer hasn't expired yet
|
|
|
|
mainItem.notification = ""
|
|
|
|
- sddm.login(mainItem.selectedUser, controlsItem.password, controlsItem.sessionIndex)
|
|
|
|
+ sddm.login(loginPrompt.username, loginPrompt.password, controlsItem.sessionIndex)
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|