Commit 62c359b2 authored by Karel Slaný's avatar Karel Slaný

Exposing change PIN page content to accessibility interface.

parent 510bb6f5
......@@ -132,25 +132,46 @@ Item {
spacing: defaultMargin
anchors.right: parent.right
anchors.rightMargin: defaultMargin
Image {
AccessibleImageButton {
id: acceptElement
anchors.verticalCenter: parent.verticalCenter
sourceSize.height: imgHeightHeader
source: "qrc:/ui/checkbox-marked-circle.svg"
MouseArea {
anchors.fill: parent
onClicked: {
if (actionName == "unspecified") {
if (currentPIN == "") {
settings.setInactivityInterval(0)
locker.setInactivityInterval(0)
} else {
settings.setInactivityInterval(lockIntervalSpinBox.val())
locker.setInactivityInterval(lockIntervalSpinBox.val())
accessibleName: qsTr("Accept changes")
onClicked: {
if (actionName == "unspecified") {
if (currentPIN == "") {
settings.setInactivityInterval(0)
locker.setInactivityInterval(0)
} else {
settings.setInactivityInterval(lockIntervalSpinBox.val())
locker.setInactivityInterval(lockIntervalSpinBox.val())
}
pageView.pop(StackView.Immediate)
/* set new pin code */
} else if (actionName == "new") {
if (pinConfirmField1.text == "" || pinConfirmField2.text == "") {
errLineText.text = qsTr("Error: Both new PIN code fields must be filled in!")
errLineText.visible = true
if (pinConfirmField1.text == "") {
pinConfirmField1.focus = true
} else if (pinConfirmField2.text == "") {
pinConfirmField2.focus = true
}
} else if (pinConfirmField2.text != pinConfirmField1.text) {
pinConfirmField2.focus = true
errLineText.text = qsTr("Error: Newly entered PIN codes are different!")
errLineText.visible = true
} else {
errLineText.visible = false
settings.updatePinSettings(pinConfirmField1.text.toString())
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
/* set new pin code */
} else if (actionName == "new") {
}
/* change current pin code */
} else if (actionName == "change") {
if (pinValueField.text == currentPIN) {
errLineText.visible = false
if (pinConfirmField1.text == "" || pinConfirmField2.text == "") {
errLineText.text = qsTr("Error: Both new PIN code fields must be filled in!")
errLineText.visible = true
......@@ -169,49 +190,26 @@ Item {
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
/* change current pin code */
} else if (actionName == "change") {
if (pinValueField.text == currentPIN) {
errLineText.visible = false
if (pinConfirmField1.text == "" || pinConfirmField2.text == "") {
errLineText.text = qsTr("Error: Both new PIN code fields must be filled in!")
errLineText.visible = true
if (pinConfirmField1.text == "") {
pinConfirmField1.focus = true
} else if (pinConfirmField2.text == "") {
pinConfirmField2.focus = true
}
} else if (pinConfirmField2.text != pinConfirmField1.text) {
pinConfirmField2.focus = true
errLineText.text = qsTr("Error: Newly entered PIN codes are different!")
errLineText.visible = true
} else {
errLineText.visible = false
settings.updatePinSettings(pinConfirmField1.text.toString())
settings.saveAllSettings(accountModel)
pageView.pop(StackView.Immediate)
}
} else {
pinValueField.text = ""
pinValueField.focus = true
errLineText.text = qsTr("Error: Current PIN code is wrong!")
errLineText.visible = true
}
/* remove/disable current pin code */
} else if (actionName == "disable") {
if (pinValueField.text == currentPIN) {
errLineText.visible = false
settings.updatePinSettings("")
settings.saveAllSettings(accountModel)
settings.setInactivityInterval(0)
locker.setInactivityInterval(0)
pageView.pop(StackView.Immediate)
} else {
pinValueField.text = ""
pinValueField.focus = true
errLineText.text = qsTr("Error: Current PIN code is wrong!")
errLineText.visible = true
}
} else {
pinValueField.text = ""
pinValueField.focus = true
errLineText.text = qsTr("Error: Current PIN code is wrong!")
errLineText.visible = true
}
/* remove/disable current pin code */
} else if (actionName == "disable") {
if (pinValueField.text == currentPIN) {
errLineText.visible = false
settings.updatePinSettings("")
settings.saveAllSettings(accountModel)
settings.setInactivityInterval(0)
locker.setInactivityInterval(0)
pageView.pop(StackView.Immediate)
} else {
pinValueField.text = ""
pinValueField.focus = true
errLineText.text = qsTr("Error: Current PIN code is wrong!")
errLineText.visible = true
}
}
}
......@@ -233,7 +231,7 @@ Item {
anchors.right: parent.right
anchors.left: parent.left
spacing: formItemVerticalSpacing
Text {
AccessibleText {
id: topLineText
anchors.horizontalCenter: parent.horizontalCenter
color: datovkaPalette.mid
......@@ -308,7 +306,7 @@ Item {
horizontalAlignment: TextInput.AlignHCenter
text: ""
}
Text {
AccessibleText {
id: errLineText
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true
......@@ -318,7 +316,7 @@ Item {
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
}
Text {
AccessibleText {
id: lockIntervalLabel
color: datovkaPalette.text
anchors.horizontalCenter: parent.horizontalCenter
......
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