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

Removed loadPinSettings() sendPinData().

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