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

Using Locker object to generate initial PIN screen.

parent f1971f52
......@@ -106,7 +106,7 @@ ApplicationWindow {
id: mainPage
anchors.fill: parent
color: "transparent"
visible: false
visible: true
StackView {
id: pageView
anchors.fill: parent
......@@ -253,25 +253,13 @@ ApplicationWindow {
versionLabel.text = qsTr("Version") + ": " + version
}
}
Connections {
target: settings
onShowPinScreen: {
if (show) {
mainPage.visible = false
pinScreen.visible = true
} else {
pinScreen.visible = false
mainPage.visible = true
}
}
}
Connections {
target: settings
onSendPinReply: {
if (success) {
Qt.inputMethod.hide()
pinScreen.visible = false
mainPage.visible = true
pinScreen.visible = false
}
wrongPin.visible = !success
pinCodeInput.text = ""
......
......@@ -83,7 +83,7 @@ protected:
bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
private:
QTimer m_inactivityTimer; /*!< Brief inactivity timer. */
QTimer m_inactivityTimer; /*!< Inactivity timer. */
bool m_ignoreImmediateSuspension; /*!<
* Set true if next suspension should
* be ignored.
......
......@@ -247,8 +247,13 @@ int main(int argc, char *argv[])
/* Load counters. */
Accounts::loadModelCounters();
/* show PIN screen if needed */
emit settings.showPinScreen(!globSet.pinCode.isEmpty());
/*
* Show PIN screen if needed. Encoded PIN is checked because it hasn't
* been decoded yet.
*/
if (!globSet.pinCode.isEmpty()) {
emit locker.lockApp();
}
/* Run app main event loop */
int ret = app.exec();
......
......@@ -194,13 +194,6 @@ signals:
*/
void sendPinReply(bool success);
/*!
* @brief Show PIN screen to QML.
*
* @param[in] show - Show PIN page in the QML.
*/
void showPinScreen(bool show);
/*!
* @brief Set new statusbar text and active busy indicator 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