2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
2022-03-01 15:59:38 +00:00
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2022-08-25 11:26:04 +00:00
|
|
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
2024-10-15 19:26:12 +00:00
|
|
|
|
2022-03-01 15:59:38 +00:00
|
|
|
import utils 1.0
|
2022-03-07 22:59:38 +00:00
|
|
|
import shared.views 1.0
|
2022-03-01 15:59:38 +00:00
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
import "../controls"
|
2022-07-20 12:34:44 +00:00
|
|
|
import "../stores"
|
2022-03-01 15:59:38 +00:00
|
|
|
|
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: {
|
|
|
|
view.newPswText = root.startupStore.getPassword()
|
|
|
|
view.confirmationPswText = root.startupStore.getPassword()
|
2022-07-28 14:04:37 +00:00
|
|
|
d.forcePasswordInputFocus()
|
2022-07-20 12:34:44 +00:00
|
|
|
}
|
|
|
|
|
2022-03-01 15:59:38 +00:00
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
readonly property int zBehind: 1
|
|
|
|
readonly property int zFront: 100
|
2022-05-06 12:47:46 +00:00
|
|
|
|
|
|
|
function submit() {
|
2022-07-20 12:34:44 +00:00
|
|
|
root.startupStore.setPassword(view.newPswText)
|
|
|
|
root.startupStore.doPrimaryAction()
|
2022-05-06 12:47:46 +00:00
|
|
|
}
|
2022-07-28 14:04:37 +00:00
|
|
|
|
|
|
|
function forcePasswordInputFocus() { view.forceNewPswInputFocus() }
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|
|
|
|
|
2022-10-11 13:58:34 +00:00
|
|
|
ColumnLayout {
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.bigPadding
|
2022-03-01 15:59:38 +00:00
|
|
|
anchors.centerIn: parent
|
2022-10-11 13:58:34 +00:00
|
|
|
height: 460
|
2022-03-01 15:59:38 +00:00
|
|
|
z: view.zFront
|
|
|
|
PasswordView {
|
|
|
|
id: view
|
2024-10-15 19:26:12 +00:00
|
|
|
Layout.preferredWidth: root.width - 2 * Theme.bigPadding
|
2024-02-09 11:31:37 +00:00
|
|
|
Layout.maximumWidth: 460
|
2022-10-11 13:58:34 +00:00
|
|
|
Layout.fillHeight: true
|
2022-07-20 12:34:44 +00:00
|
|
|
passwordStrengthScoreFunction: root.startupStore.getPasswordStrengthScore
|
2022-10-11 13:58:34 +00:00
|
|
|
highSizeIntro: true
|
2022-05-06 12:47:46 +00:00
|
|
|
onReturnPressed: { if(view.ready) d.submit() }
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|
|
|
|
StatusButton {
|
|
|
|
id: submitBtn
|
2022-07-29 22:51:34 +00:00
|
|
|
objectName: "onboardingCreatePasswordButton"
|
2022-03-01 15:59:38 +00:00
|
|
|
z: d.zFront
|
2022-10-11 13:58:34 +00:00
|
|
|
Layout.alignment: Qt.AlignHCenter
|
2022-03-01 15:59:38 +00:00
|
|
|
text: qsTr("Create password")
|
|
|
|
enabled: view.ready
|
2022-05-06 12:47:46 +00:00
|
|
|
onClicked: { d.submit() }
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|