|
|
|
|
@ -193,11 +193,87 @@ RoundedItem {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Change password
|
|
|
|
|
HorizontalDivider {
|
|
|
|
|
visible: changePasswdLabel.visible
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
id: changePasswdLabel
|
|
|
|
|
visible: false
|
|
|
|
|
text: qsTr("Change password")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GridLayout {
|
|
|
|
|
id: changePasswdLayout
|
|
|
|
|
visible: false
|
|
|
|
|
columns: 2
|
|
|
|
|
columnSpacing: FishUI.Units.largeSpacing * 2
|
|
|
|
|
rowSpacing: FishUI.Units.smallSpacing * 2
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: qsTr("Password")
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
|
id: passwordField
|
|
|
|
|
placeholderText: qsTr("Password")
|
|
|
|
|
echoMode: TextField.Password
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
selectByMouse: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Label {
|
|
|
|
|
text: qsTr("Verify password")
|
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TextField {
|
|
|
|
|
id: verifyPasswordField
|
|
|
|
|
placeholderText: qsTr("Verify password")
|
|
|
|
|
echoMode: TextField.Password
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
selectByMouse: true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: changePasswdFooterLayout
|
|
|
|
|
spacing: FishUI.Units.largeSpacing
|
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
text: qsTr("Cancel")
|
|
|
|
|
onClicked: hideChangePasswordItem()
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Button {
|
|
|
|
|
text: qsTr("Change password")
|
|
|
|
|
enabled: passwordField.text != "" &&
|
|
|
|
|
passwordField.text == verifyPasswordField.text
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
flat: true
|
|
|
|
|
onClicked: {
|
|
|
|
|
currentUser.setPassword(Password.cryptPassword(passwordField.text));
|
|
|
|
|
hideChangePasswordItem()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HorizontalDivider {
|
|
|
|
|
visible: changePasswdLabel.visible
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Change password end.
|
|
|
|
|
|
|
|
|
|
StandardButton {
|
|
|
|
|
text: qsTr("Change password")
|
|
|
|
|
// onClicked: accountsManager.deleteUser(userId, true)
|
|
|
|
|
onClicked: showChangePasswordItem()
|
|
|
|
|
backgroundColor: FishUI.Theme.darkMode ? "#363636" : FishUI.Theme.backgroundColor
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
visible: !changePasswdLabel.visible
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StandardButton {
|
|
|
|
|
@ -209,4 +285,21 @@ RoundedItem {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showChangePasswordItem() {
|
|
|
|
|
changePasswdLabel.visible = true
|
|
|
|
|
changePasswdLayout.visible = true
|
|
|
|
|
changePasswdFooterLayout.visible = true
|
|
|
|
|
|
|
|
|
|
passwordField.forceActiveFocus()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function hideChangePasswordItem() {
|
|
|
|
|
passwordField.clear()
|
|
|
|
|
verifyPasswordField.clear()
|
|
|
|
|
|
|
|
|
|
changePasswdLabel.visible = false
|
|
|
|
|
changePasswdLayout.visible = false
|
|
|
|
|
changePasswdFooterLayout.visible = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|