Commit bd170099 authored by Karel Slaný's avatar Karel Slaný

Removed loadPinSettings() sendPinData().

parent 1394a0de
......@@ -30,14 +30,24 @@ Component {
Item {
id: mainItem
Component.onCompleted: {
currentPIN = settings.pinValue()
actionName = "unspecified" /* Causes onChanged() to fire. */
settings.loadPinSettings()
}
property string currentPIN: ""
property string actionName: "" /* Initial value left blank. */
onActionNameChanged : { /* Handles actionName changes. */
console.log("AAA " + actionName)
if (actionName == "unspecified") {
if (currentPIN == "") {
topLineText.text = qsTr("Currently there is no PIN code set.")
setPinButton.visible = true
changePinButton.visible = false
disablePinButton.visible = false
} else {
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
}
} else if (actionName == "new") {
acceptElement.visible = true
topLineText.text = qsTr("Enter a new PIN code into both text fields:")
......@@ -265,23 +275,6 @@ Component {
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
}
Connections {
target: settings
onSendPinData: {
currentPIN = currentPinVal
if (currentPIN == "") {
topLineText.text = qsTr("Currently there is no PIN code set.")
setPinButton.visible = true
changePinButton.visible = false
disablePinButton.visible = false
} else {
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
}
}
}
}
}
}
......
......@@ -113,19 +113,11 @@ void GlobalSettingsQmlWrapper::loadSettings(const QString &section)
}
}
/* ========================================================================= */
/*
* Slot: Load current Pin settings from global structure.
*/
void GlobalSettingsQmlWrapper::loadPinSettings(void)
/* ========================================================================= */
QString GlobalSettingsQmlWrapper::pinValue(void) const
{
/* Send PIN data to QML */
emit sendPinData(globSet._pinVal);
return globSet._pinVal;
}
/* ========================================================================= */
/*
* Slot: Set and save general settings from QML to global structure.
......
......@@ -36,7 +36,6 @@ class GlobalSettingsQmlWrapper : public QObject {
Q_OBJECT
public:
/*!
* @brief Constructor.
*/
......@@ -63,10 +62,10 @@ public:
void loadSettings(const QString &section);
/*!
* @brief Load current PIN settings.
* @brief Return current PIN value.
*/
Q_INVOKABLE
void loadPinSettings(void);
QString pinValue(void) const;
/*!
* @brief Save general settings from QML.
......@@ -180,13 +179,6 @@ signals:
int fileLifeDays, QString dbPath, bool showChangeDbLocation,
bool showSetDefaulButton);
/*!
* @brief Send current PIN settings to QML.
*
* @param[in] currentPinVal - PIN data string for QML.
*/
void sendPinData(QString currentPinVal);
/*!
* @brief Send PIN verification result to QML.
*
......
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