Commit 1394a0de authored by Karel Slaný's avatar Karel Slaný

Using onActionNameChanged signal handler in PIN settings page.

parent 168e6498
......@@ -30,10 +30,43 @@ Component {
Item {
id: mainItem
Component.onCompleted: {
actionName = "unspecified" /* Causes onChanged() to fire. */
settings.loadPinSettings()
}
property string currentPIN: ""
property string actionName: "blank"
property string actionName: "" /* Initial value left blank. */
onActionNameChanged : { /* Handles actionName changes. */
console.log("AAA " + actionName)
if (actionName == "unspecified") {
} else if (actionName == "new") {
acceptElement.visible = true
topLineText.text = qsTr("Enter a new PIN code into both text fields:")
setPinButton.visible = false
pinValueField.visible = false
pinConfirmField1.visible = true
pinConfirmField1.focus = true
pinConfirmField2.visible = true
} else if (actionName == "change") {
acceptElement.visible = true
topLineText.text = qsTr("In order to change the PIN code you must enter the current and a new PIN code:")
changePinButton.visible = false
disablePinButton.visible = false
pinValueField.visible = true
pinValueField.focus = true
pinConfirmField1.visible = true
pinConfirmField2.visible = true
} else if (actionName == "disable") {
acceptElement.visible = true
topLineText.text = qsTr("In order to change the PIN code you must enter the current and a new PIN code:")
changePinButton.visible = false
disablePinButton.visible = false
pinValueField.visible = true
pinValueField.focus = true
pinConfirmField1.visible = false
pinConfirmField2.visible = false
} else {
}
}
property int myWidht: mainItem.width - 2 * defaultMargin
Rectangle {
id: header
......@@ -170,13 +203,6 @@ Component {
text: qsTr("Set PIN")
onClicked: {
actionName = "new"
acceptElement.visible = true
topLineText.text = qsTr("Enter a new PIN code into both text fields:")
setPinButton.visible = false
pinValueField.visible = false
pinConfirmField1.visible = true
pinConfirmField1.focus = true
pinConfirmField2.visible = true
}
}
Button {
......@@ -185,14 +211,6 @@ Component {
text: qsTr("Change PIN")
onClicked: {
actionName = "change"
acceptElement.visible = true
topLineText.text = qsTr("In order to change the PIN code you must enter the current and a new PIN code:")
changePinButton.visible = false
disablePinButton.visible = false
pinValueField.visible = true
pinValueField.focus = true
pinConfirmField1.visible = true
pinConfirmField2.visible = true
}
}
Button {
......@@ -201,14 +219,6 @@ Component {
text: qsTr("Disable PIN")
onClicked: {
actionName = "disable"
acceptElement.visible = true
topLineText.text = qsTr("In order to change the PIN code you must enter the current and a new PIN code:")
changePinButton.visible = false
disablePinButton.visible = false
pinValueField.visible = true
pinValueField.focus = true
pinConfirmField1.visible = false
pinConfirmField2.visible = false
}
}
TextField {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment