2025-01-21 14:57:29 +01:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
|
|
|
import AppLayouts.Onboarding2.pages 1.0
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
readonly property string existingPuk: "111111111111"
|
|
|
|
|
|
|
|
KeycardEnterPukPage {
|
|
|
|
id: page
|
|
|
|
anchors.fill: parent
|
2025-01-21 22:13:05 +01:00
|
|
|
remainingAttempts: 3
|
2025-01-21 14:57:29 +01:00
|
|
|
tryToSetPukFunction: (puk) => {
|
|
|
|
console.warn("!!! ATTEMPTED PUK:", puk)
|
2025-01-21 22:13:05 +01:00
|
|
|
const valid = puk === root.existingPuk
|
|
|
|
if (!valid)
|
|
|
|
remainingAttempts--
|
|
|
|
return valid
|
2025-01-21 14:57:29 +01:00
|
|
|
}
|
|
|
|
onKeycardPukEntered: (puk) => {
|
|
|
|
console.warn("!!! CORRECT PUK:", puk)
|
|
|
|
console.warn("!!! RESETTING FLOW")
|
|
|
|
state = "entering"
|
|
|
|
}
|
2025-01-21 22:13:05 +01:00
|
|
|
onKeycardFactoryResetRequested: {
|
|
|
|
console.warn("onKeycardFactoryResetRequested")
|
|
|
|
console.warn("!!! RESETTING FLOW")
|
|
|
|
state = "entering"
|
|
|
|
remainingAttempts = 3
|
|
|
|
}
|
2025-01-21 14:57:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
text: "Hint: %1".arg(root.existingPuk)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// category: Onboarding
|
|
|
|
// status: good
|