Commit 168e6498 authored by Karel Slaný's avatar Karel Slaný
Browse files

Renamed some elements on PIN settings page.

parent cd344631
......@@ -75,7 +75,7 @@ Component {
anchors.right: parent.right
anchors.rightMargin: defaultMargin
Image {
id: actionButton
id: acceptElement
visible: false
anchors.verticalCenter: parent.verticalCenter
sourceSize.height: imgHeight
......@@ -85,61 +85,61 @@ Component {
onClicked: {
/* set new pin code */
if (actionName == "new") {
if (setPinCodeString.text == "" || setPinCodeString2.text == "") {
errorLabel.text = qsTr("Error: Both new PIN code fields must be filled in!")
errorLabel.visible = true
if (setPinCodeString.text == "") {
setPinCodeString.focus = true
} else if (setPinCodeString2.text == "") {
setPinCodeString2.focus = true
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 (setPinCodeString2.text != setPinCodeString.text) {
errorLabel.text = qsTr("Error: Newly entered PIN codes are different!")
errorLabel.visible = true
setPinCodeString2.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 {
errorLabel.visible = false
settings.updatePinSettings(setPinCodeString.text.toString())
errLineText.visible = false
settings.updatePinSettings(pinConfirmField1.text.toString())
pageView.pop(StackView.Immediate)
}
/* change current pin code */
} else if (actionName == "change") {
if (getPinCodeString.text == currentPIN) {
errorLabel.visible = false
if (setPinCodeString.text == "" || setPinCodeString2.text == "") {
errorLabel.text = qsTr("Error: Both new PIN code fields must be filled in!")
errorLabel.visible = true
if (setPinCodeString.text == "") {
setPinCodeString.focus = true
} else if (setPinCodeString2.text == "") {
setPinCodeString2.focus = true
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 (setPinCodeString2.text != setPinCodeString.text) {
errorLabel.text = qsTr("Error: Newly entered PIN codes are different!")
errorLabel.visible = true
setPinCodeString2.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 {
errorLabel.visible = false
settings.updatePinSettings(setPinCodeString.text.toString())
errLineText.visible = false
settings.updatePinSettings(pinConfirmField1.text.toString())
pageView.pop(StackView.Immediate)
}
} else {
errorLabel.text = qsTr("Error: Current PIN code is wrong!")
getPinCodeString.text = ""
getPinCodeString.focus = true
errorLabel.visible = true
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 (getPinCodeString.text == currentPIN) {
errorLabel.visible = false
if (pinValueField.text == currentPIN) {
errLineText.visible = false
settings.updatePinSettings("")
pageView.pop(StackView.Immediate)
} else {
errorLabel.text = qsTr("Error: Current PIN code is wrong!")
getPinCodeString.text = ""
getPinCodeString.focus = true
errorLabel.visible = true
pinValueField.text = ""
pinValueField.focus = true
errLineText.text = qsTr("Error: Current PIN code is wrong!")
errLineText.visible = true
}
}
}
......@@ -156,7 +156,7 @@ Component {
Column {
spacing: formItemVerticalSpacing
Text {
id: pinLabel
id: topLineText
anchors.horizontalCenter: parent.horizontalCenter
color: datovkaPalette.mid
width: myWidht
......@@ -165,54 +165,54 @@ Component {
wrapMode: Text.Wrap
}
Button {
id: setPinCodeButton
id: setPinButton
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Set PIN")
onClicked: {
actionName = "new"
actionButton.visible = true
setPinCodeButton.visible = false
pinLabel.text = qsTr("Enter a new PIN code into both text fields:")
setPinCodeString.visible = true
setPinCodeString2.visible = true
setPinCodeString.focus = true
getPinCodeString.visible = false
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 {
id: changePinCodeButton
id: changePinButton
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Change PIN")
onClicked: {
actionName = "change"
actionButton.visible = true
changePinCodeButton.visible = false
disablePinCodeButton.visible = false
pinLabel.text = qsTr("In order to change the PIN code you must enter the current and a new PIN code:")
getPinCodeString.visible = true
getPinCodeString.focus = true
setPinCodeString.visible = true
setPinCodeString2.visible = true
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 {
id: disablePinCodeButton
id: disablePinButton
anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Disable PIN")
onClicked: {
actionName = "disable"
actionButton.visible = true
disablePinCodeButton.visible = false
changePinCodeButton.visible = false
pinLabel.text = qsTr("In order to deactivate the PIN code you must enter the current PIN code:")
setPinCodeString.visible = false
setPinCodeString2.visible = false
getPinCodeString.visible = true
getPinCodeString.focus = true
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 {
id: getPinCodeString
id: pinValueField
anchors.horizontalCenter: parent.horizontalCenter
visible: false
width: myWidht * 0.5
......@@ -223,7 +223,7 @@ Component {
text: ""
}
TextField {
id: setPinCodeString
id: pinConfirmField1
anchors.horizontalCenter: parent.horizontalCenter
visible: false
width: myWidht * 0.5
......@@ -234,7 +234,7 @@ Component {
text: ""
}
TextField {
id: setPinCodeString2
id: pinConfirmField2
anchors.horizontalCenter: parent.horizontalCenter
visible: false
width: myWidht * 0.5
......@@ -245,7 +245,7 @@ Component {
text: ""
}
Text {
id: errorLabel
id: errLineText
visible: false
anchors.horizontalCenter: parent.horizontalCenter
font.bold: true
......@@ -260,15 +260,15 @@ Component {
onSendPinData: {
currentPIN = currentPinVal
if (currentPIN == "") {
pinLabel.text = qsTr("Currently there is no PIN code set.")
setPinCodeButton.visible = true
changePinCodeButton.visible = false
disablePinCodeButton.visible = false
topLineText.text = qsTr("Currently there is no PIN code set.")
setPinButton.visible = true
changePinButton.visible = false
disablePinButton.visible = false
} else {
pinLabel.text = qsTr("You will be asked to enter a PIN code on application start-up.")
setPinCodeButton.visible = false
changePinCodeButton.visible = true
disablePinCodeButton.visible = true
topLineText.text = qsTr("You will be asked to enter a PIN code on application start-up.")
setPinButton.visible = false
changePinButton.visible = true
disablePinButton.visible = true
}
}
}
......
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