]> Nutra Git (v2) - gamesguru/feather.git/commitdiff
Inactivity lock: hide all interface elements
authortobtoht <thotbot@protonmail.com>
Sun, 3 Jul 2022 17:41:08 +0000 (19:41 +0200)
committertobtoht <thotbot@protonmail.com>
Sun, 3 Jul 2022 17:41:08 +0000 (19:41 +0200)
src/MainWindow.cpp
src/MainWindow.h

index 7de899a52048557f219a1aa2c2ba2a05989afa16..b7790ee902771a32cbb1ac5df9b9a678c70e6794 100644 (file)
@@ -1611,10 +1611,10 @@ void MainWindow::updateRecentlyOpenedMenu() {
     ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
 }
 
-bool MainWindow::verifyPassword() {
+bool MainWindow::verifyPassword(bool sensitive) {
     bool incorrectPassword = false;
     while (true) {
-        PasswordDialog passwordDialog{this->walletName(), incorrectPassword, true, this};
+        PasswordDialog passwordDialog{this->walletName(), incorrectPassword, sensitive, this};
         int ret = passwordDialog.exec();
         if (ret == QDialog::Rejected) {
             return false;
@@ -1652,7 +1652,10 @@ void MainWindow::checkUserActivity() {
     if ((m_userLastActive + (config()->get(Config::inactivityLockTimeout).toInt()*60)) < QDateTime::currentSecsSinceEpoch()) {
         m_checkUserActivity.stop();
         qInfo() << "Locking wallet for inactivity";
-        if (!this->verifyPassword()) {
+        ui->tabWidget->hide();
+        this->statusBar()->hide();
+        this->menuBar()->hide();
+        if (!this->verifyPassword(false)) {
             this->setEnabled(false);
             this->close();
             // This doesn't close the wallet immediately.
@@ -1667,6 +1670,9 @@ void MainWindow::checkUserActivity() {
             } while (QApplication::hasPendingEvents());
 #endif
         } else {
+            ui->tabWidget->show();
+            this->statusBar()->show();
+            this->menuBar()->show();
             m_checkUserActivity.start();
         }
     }
index fd25106dfde9dc1d1d245d481bf287def9773d12..6e5b9c3da04cb861a0cb8b1a411010ac33e35c6d 100644 (file)
@@ -215,7 +215,7 @@ private:
     void addToRecentlyOpened(const QString &filename);
     void updateRecentlyOpenedMenu();
     void updateWidgetIcons();
-    bool verifyPassword();
+    bool verifyPassword(bool senstive = true);
     void patchStylesheetMac();
     void fillSendTab(const QString &address, const QString &description);
     void userActivity();