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

Show lock screen on inactivity time-out or when application suspended.

parent 7dd5c43c
......@@ -277,6 +277,13 @@ ApplicationWindow {
pinCodeInput.text = ""
}
}
Connections {
target: locker
onLockApp: {
mainPage.visible = false
pinScreen.visible = true
}
}
}
Item {
id: backButton
......
......@@ -263,6 +263,7 @@ Component {
MouseArea {
anchors.fill: parent
onClicked: {
locker.ignoreNextSuspension()
files.openAttachment(gUserName, gMsgId, rFileId)
}
}
......
......@@ -135,6 +135,13 @@ int main(int argc, char *argv[])
QObject::connect(&accounts, SIGNAL(removeIsdsCtx(QString)),
&isds, SLOT(removeIsdsCtx(QString)));
/* Register application state changes. */
class Locker locker;
QObject::connect(&app,
SIGNAL(applicationStateChanged(Qt::ApplicationState)),
&locker, SLOT(processNewState(Qt::ApplicationState)));
app.installEventFilter(&locker);
/* Create and init account model. */
globAccountsModelPtr = new (std::nothrow) AccountListModel;
if (0 == globAccountsModelPtr) {
......@@ -163,6 +170,7 @@ int main(int argc, char *argv[])
ctx->setContextProperty("accounts", &accounts);
ctx->setContextProperty("files", &files);
ctx->setContextProperty("settings", &settings);
ctx->setContextProperty("locker", &locker);
/* register and set models in QML */
ctx->setContextProperty(globAccountsModelPtr->objectName(),
......@@ -242,12 +250,6 @@ int main(int argc, char *argv[])
/* show PIN screen if needed */
emit settings.showPinScreen(!globSet.pinCode.isEmpty());
/* Register application state changes. */
class Locker locker;
QObject::connect(&app,
SIGNAL(applicationStateChanged(Qt::ApplicationState)),
&locker, SLOT(processNewState(Qt::ApplicationState)));
/* Run app main event loop */
int ret = app.exec();
......
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