2022-03-01 15:59:38 +00:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
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
|
|
|
|
|
|
|
import "../../Profile/views"
|
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
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
spacing: 4 * Style.current.padding
|
|
|
|
anchors.centerIn: parent
|
|
|
|
z: view.zFront
|
|
|
|
PasswordView {
|
|
|
|
id: view
|
2022-07-20 12:34:44 +00:00
|
|
|
passwordStrengthScoreFunction: root.startupStore.getPasswordStrengthScore
|
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
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|