2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2023-09-01 13:32:21 +00:00
|
|
|
|
|
|
|
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
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.xlPadding
|
|
|
|
anchors.bottomMargin: Theme.halfPadding
|
|
|
|
anchors.leftMargin: Theme.xlPadding
|
|
|
|
anchors.rightMargin: Theme.xlPadding
|
|
|
|
spacing: Theme.padding
|
2023-09-01 13:32:21 +00:00
|
|
|
|
|
|
|
PasswordView {
|
2024-02-09 11:31:37 +00:00
|
|
|
Layout.minimumWidth: 460
|
2024-03-29 13:21:21 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2023-09-01 13:32:21 +00:00
|
|
|
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()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|