Alexandra Betouni 480985ca4e
[Settings]: Added change password view (#13284)
* [Settings]: Added change password view

Closes #10037

Adding configuration options to PasswordView

* feat(ChangePassword): Integrate ConfirmChangePasswordModal

1. Integrate with backend
2. Clean unused components

* feat: Add support to restart application

1. Adding restart app support in DOtherSide
2. Integrating nimqml
3. Expose in qml in Utils

* chore: Move changeDatabasePassword call to threadpool

* chore(squish): Fix failing tests due to settings index changes

---------

Co-authored-by: Alex Jbanca <alexjb@status.im>
2024-02-09 13:31:37 +02:00

56 lines
1.5 KiB
QML

import QtQuick 2.14
import QtQuick.Layouts 1.14
import shared.stores 1.0
import shared.views 1.0
import utils 1.0
Item {
id: root
property var sharedKeycardModule
signal passwordValid(bool valid)
ColumnLayout {
anchors.fill: parent
anchors.topMargin: Style.current.xlPadding
anchors.bottomMargin: Style.current.halfPadding
anchors.leftMargin: 2*(Style.current.xlPadding + Style.current.bigPadding)
anchors.rightMargin: 2*(Style.current.xlPadding + Style.current.bigPadding)
spacing: Style.current.padding
PasswordView {
Layout.minimumWidth: 460
Layout.fillWidth: true
Layout.fillHeight: true
passwordStrengthScoreFunction: RootStore.getPasswordStrengthScore
highSizeIntro: true
newPswText: root.sharedKeycardModule.getNewPassword()
confirmationPswText: root.sharedKeycardModule.getNewPassword()
Component.onCompleted: {
forceNewPswInputFocus()
checkPasswordMatches()
root.passwordValid(ready)
}
onReadyChanged: {
root.passwordValid(ready)
if (!ready) {
return
}
root.sharedKeycardModule.setNewPassword(newPswText)
}
onReturnPressed: {
if(!ready) {
return
}
root.sharedKeycardModule.currentState.doPrimaryAction()
}
}
}
}