From db638319c7e7ac0b5764dc5145de9f605f4f5adc Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 12 Jan 2013 19:18:39 +0200 Subject: [PATCH] Require password to exit qBittorrent from tray icon when locked (closes #311) --- src/mainwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d5da3f68b..9f1089824 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -659,6 +659,13 @@ void MainWindow::on_actionSet_global_download_limit_triggered() { // Necessary if we want to close the window // in one time if "close to systray" is enabled void MainWindow::on_actionExit_triggered() { + // UI locking enforcement. + if (isHidden() && ui_locked) { + // Ask for UI lock password + if (!unlockUI()) + return; + } + force_exit = true; close(); }