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-03-01 15:59:38 +00:00
|
|
|
|
2022-03-07 22:59:38 +00:00
|
|
|
OnboardingBasePage {
|
2022-03-01 15:59:38 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property string newPassword
|
|
|
|
property string confirmationPassword
|
2022-03-07 22:59:38 +00:00
|
|
|
function forceNewPswInputFocus() { view.forceNewPswInputFocus() }
|
2022-03-22 09:29:59 +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() {
|
|
|
|
root.newPassword = view.newPswText
|
|
|
|
root.confirmationPassword = view.confirmationPswText
|
|
|
|
root.exit()
|
|
|
|
}
|
2022-03-01 15:59:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
spacing: 4 * Style.current.padding
|
|
|
|
anchors.centerIn: parent
|
|
|
|
z: view.zFront
|
|
|
|
PasswordView {
|
|
|
|
id: view
|
2022-03-07 22:59:38 +00:00
|
|
|
onboarding: true
|
2022-03-01 15:59:38 +00:00
|
|
|
newPswText: root.newPassword
|
|
|
|
confirmationPswText: root.confirmationPassword
|
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
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Back button:
|
|
|
|
StatusRoundButton {
|
|
|
|
z: d.zFront // Focusable / clickable component
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: Style.current.padding
|
|
|
|
icon.name: "arrow-left"
|
|
|
|
onClicked: { root.backClicked() }
|
|
|
|
}
|
|
|
|
// By clicking anywhere outside password entries fields or focusable element in the view, it is needed to check if passwords entered matches
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
z: d.zBehind // Behind focusable components
|
|
|
|
onClicked: { view.checkPasswordMatches() }
|
|
|
|
}
|
|
|
|
}
|