[usersq] Hook up QML fields and the Config object
For properties, we can bind directly to the Config properties for loginName, fullName, and also to checkbox-style (bool) properties and passwords.
This commit is contained in:
parent
e60f8bcd06
commit
b96ad4b166
@ -56,10 +56,9 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
id: _userNameField
|
id: _userNameField
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
text: config.fullName
|
||||||
placeholderText: qsTr("Your Full Name")
|
placeholderText: qsTr("Your Full Name")
|
||||||
onTextChanged: config.fullNameChanged(text)
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
color: "#FBFBFB" // Kirigami.Theme.backgroundColor
|
||||||
radius: 2
|
radius: 2
|
||||||
opacity: 0.9
|
opacity: 0.9
|
||||||
@ -85,8 +84,7 @@ Kirigami.ScrollablePage {
|
|||||||
id: _userLoginField
|
id: _userLoginField
|
||||||
width: parent.width
|
width: parent.width
|
||||||
placeholderText: qsTr("Login Name")
|
placeholderText: qsTr("Login Name")
|
||||||
//text: config.userName
|
text: config.loginName
|
||||||
onTextEdited: config.loginNameStatusChanged(text)
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
@ -167,7 +165,7 @@ Kirigami.ScrollablePage {
|
|||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.userPasswordStatusChanged(text, _verificationPasswordField.text)
|
text: config.userPassword
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
@ -186,7 +184,7 @@ Kirigami.ScrollablePage {
|
|||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.userPasswordSecondaryChanged(_passwordField.text, text)
|
text: config.userPasswordSecondary
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
@ -211,17 +209,13 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
visible: config.allowWeakPasswords
|
visible: config.permitWeakPasswords
|
||||||
//visible: false
|
|
||||||
text: qsTr("Validate passwords quality")
|
text: qsTr("Validate passwords quality")
|
||||||
checked: config.allowWeakPasswordsDefault
|
checked: config.requireStrongPasswords
|
||||||
onToggled: config.allowWeakPasswordsDefault = !config.allowWeakPasswordsDefault
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
visible: config.permitWeakPasswords
|
||||||
visible: config.allowWeakPasswords
|
|
||||||
//visible: false
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: qsTr("When this box is checked, password-strength checking is done and you will not be able to use a weak password.")
|
text: qsTr("When this box is checked, password-strength checking is done and you will not be able to use a weak password.")
|
||||||
font.weight: Font.Thin
|
font.weight: Font.Thin
|
||||||
@ -230,24 +224,18 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
text: qsTr("Log in automatically without asking for the password")
|
text: qsTr("Log in automatically without asking for the password")
|
||||||
checked: config.doAutologin
|
checked: config.doAutoLogin
|
||||||
onToggled: config.doAutologin = !config.doAutologin
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
|
||||||
id: root
|
id: root
|
||||||
visible: config.doReusePassword
|
visible: config.writeRootPassword
|
||||||
text: qsTr("Reuse user password as root password")
|
text: qsTr("Reuse user password as root password")
|
||||||
checked: config.reuseUserPasswordForRoot
|
checked: config.reuseUserPasswordForRoot
|
||||||
//checked: false
|
|
||||||
onToggled: config.reuseUserPasswordForRoot = !config.reuseUserPasswordForRoot
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
|
||||||
visible: root.checked
|
visible: root.checked
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: qsTr("Use the same password for the administrator account.")
|
text: qsTr("Use the same password for the administrator account.")
|
||||||
@ -280,7 +268,7 @@ Kirigami.ScrollablePage {
|
|||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.rootPasswordChanged(text, _verificationRootPasswordField.text)
|
text: config.rootPassword
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
@ -299,7 +287,7 @@ Kirigami.ScrollablePage {
|
|||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
passwordMaskDelay: 300
|
passwordMaskDelay: 300
|
||||||
inputMethodHints: Qt.ImhNoAutoUppercase
|
inputMethodHints: Qt.ImhNoAutoUppercase
|
||||||
onTextChanged: config.rootPasswordSecondaryChanged(_rootPasswordField.text, text)
|
text: config.rootPasswordSecondary
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user