mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Don't show multiple unlock UI dialogs. Closes #2040.
This commit is contained in:
@@ -101,7 +101,7 @@ using namespace libtorrent;
|
|||||||
*****************************************************/
|
*****************************************************/
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMainWindow(parent), m_posInitialized(false), force_exit(false)
|
MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMainWindow(parent), m_posInitialized(false), force_exit(false), unlockDlgShowing(false)
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
, has_python(false)
|
, has_python(false)
|
||||||
#endif
|
#endif
|
||||||
@@ -697,8 +697,14 @@ void MainWindow::setTabText(int index, QString text) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool MainWindow::unlockUI() {
|
bool MainWindow::unlockUI() {
|
||||||
|
if (unlockDlgShowing)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
unlockDlgShowing = true;
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
QString clear_password = AutoExpandableDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
|
QString clear_password = AutoExpandableDialog::getText(this, tr("UI lock password"), tr("Please type the UI lock password:"), QLineEdit::Password, "", &ok);
|
||||||
|
unlockDlgShowing = false;
|
||||||
if (!ok) return false;
|
if (!ok) return false;
|
||||||
Preferences pref;
|
Preferences pref;
|
||||||
QString real_pass_md5 = pref.getUILockPasswordMD5();
|
QString real_pass_md5 = pref.getUILockPasswordMD5();
|
||||||
|
|||||||
@@ -183,6 +183,7 @@ private:
|
|||||||
bool displaySpeedInTitle;
|
bool displaySpeedInTitle;
|
||||||
bool force_exit;
|
bool force_exit;
|
||||||
bool ui_locked;
|
bool ui_locked;
|
||||||
|
bool unlockDlgShowing;
|
||||||
LineEdit *search_filter;
|
LineEdit *search_filter;
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
QShortcut *switchSearchShortcut;
|
QShortcut *switchSearchShortcut;
|
||||||
|
|||||||
Reference in New Issue
Block a user