mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-03 09:29:37 +00:00
Inactivity lock: hide all interface elements
This commit is contained in:
parent
e2d456c13e
commit
fc9caef79a
2 changed files with 10 additions and 4 deletions
|
@ -1611,10 +1611,10 @@ void MainWindow::updateRecentlyOpenedMenu() {
|
||||||
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
ui->menuRecently_open->addAction(m_clearRecentlyOpenAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::verifyPassword() {
|
bool MainWindow::verifyPassword(bool sensitive) {
|
||||||
bool incorrectPassword = false;
|
bool incorrectPassword = false;
|
||||||
while (true) {
|
while (true) {
|
||||||
PasswordDialog passwordDialog{this->walletName(), incorrectPassword, true, this};
|
PasswordDialog passwordDialog{this->walletName(), incorrectPassword, sensitive, this};
|
||||||
int ret = passwordDialog.exec();
|
int ret = passwordDialog.exec();
|
||||||
if (ret == QDialog::Rejected) {
|
if (ret == QDialog::Rejected) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1652,7 +1652,10 @@ void MainWindow::checkUserActivity() {
|
||||||
if ((m_userLastActive + (config()->get(Config::inactivityLockTimeout).toInt()*60)) < QDateTime::currentSecsSinceEpoch()) {
|
if ((m_userLastActive + (config()->get(Config::inactivityLockTimeout).toInt()*60)) < QDateTime::currentSecsSinceEpoch()) {
|
||||||
m_checkUserActivity.stop();
|
m_checkUserActivity.stop();
|
||||||
qInfo() << "Locking wallet for inactivity";
|
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->setEnabled(false);
|
||||||
this->close();
|
this->close();
|
||||||
// This doesn't close the wallet immediately.
|
// This doesn't close the wallet immediately.
|
||||||
|
@ -1667,6 +1670,9 @@ void MainWindow::checkUserActivity() {
|
||||||
} while (QApplication::hasPendingEvents());
|
} while (QApplication::hasPendingEvents());
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
ui->tabWidget->show();
|
||||||
|
this->statusBar()->show();
|
||||||
|
this->menuBar()->show();
|
||||||
m_checkUserActivity.start();
|
m_checkUserActivity.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@ private:
|
||||||
void addToRecentlyOpened(const QString &filename);
|
void addToRecentlyOpened(const QString &filename);
|
||||||
void updateRecentlyOpenedMenu();
|
void updateRecentlyOpenedMenu();
|
||||||
void updateWidgetIcons();
|
void updateWidgetIcons();
|
||||||
bool verifyPassword();
|
bool verifyPassword(bool senstive = true);
|
||||||
void patchStylesheetMac();
|
void patchStylesheetMac();
|
||||||
void fillSendTab(const QString &address, const QString &description);
|
void fillSendTab(const QString &address, const QString &description);
|
||||||
void userActivity();
|
void userActivity();
|
||||||
|
|
Loading…
Reference in a new issue