2022-03-01 15:59:38 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
2023-08-31 12:22:43 +00:00
|
|
|
|
|
|
|
import shared.views 1.0
|
|
|
|
import utils 1.0
|
2022-03-01 15:59:38 +00:00
|
|
|
|
|
|
|
import "../stores"
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
Item {
|
2022-03-01 15:59:38 +00:00
|
|
|
id: root
|
|
|
|
|
2022-07-20 12:34:44 +00:00
|
|
|
property StartupStore startupStore
|
|
|
|
|
|
|
|
Component.onCompleted: {
|
2023-08-31 12:22:43 +00:00
|
|
|
passwordView.forceInputFocus()
|
2022-07-20 12:34:44 +00:00
|
|
|
}
|
|
|
|
|
2022-05-06 12:47:46 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
property bool submitEnabled: !submitBtn.loading && passwordView.passwordMatch
|
2022-05-06 12:47:46 +00:00
|
|
|
|
|
|
|
function submit() {
|
2023-08-31 12:22:43 +00:00
|
|
|
if (!d.submitEnabled) {
|
2022-05-06 12:47:46 +00:00
|
|
|
return
|
|
|
|
}
|
2022-07-20 12:34:44 +00:00
|
|
|
root.startupStore.doPrimaryAction()
|
2022-05-06 12:47:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-11 13:58:34 +00:00
|
|
|
ColumnLayout {
|
2022-03-01 15:59:38 +00:00
|
|
|
id: view
|
2022-10-11 13:58:34 +00:00
|
|
|
spacing: Style.current.bigPadding
|
|
|
|
height: 460
|
2022-03-01 15:59:38 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
PasswordConfirmationView {
|
|
|
|
id: passwordView
|
2022-03-01 15:59:38 +00:00
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
spacing: Style.current.bigPadding
|
2022-10-11 13:58:34 +00:00
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
expectedPassword: root.startupStore.getPassword()
|
2022-10-11 13:58:34 +00:00
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
onSubmit: {
|
|
|
|
d.submit()
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|
2022-05-09 14:14:30 +00:00
|
|
|
}
|
2022-03-01 15:59:38 +00:00
|
|
|
|
|
|
|
StatusButton {
|
|
|
|
id: submitBtn
|
2022-07-20 12:14:50 +00:00
|
|
|
objectName: "confirmPswSubmitBtn"
|
2022-10-11 13:58:34 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-05-05 09:57:39 +00:00
|
|
|
text: qsTr("Finalise Status Password Creation")
|
2023-08-31 12:22:43 +00:00
|
|
|
enabled: d.submitEnabled
|
2022-03-07 22:59:38 +00:00
|
|
|
|
2023-08-31 12:22:43 +00:00
|
|
|
onClicked: {
|
|
|
|
d.submit()
|
2022-03-07 22:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|