mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03:00
Don't show multiple unlock UI dialogs. Closes #2040.
This commit is contained in:
parent
2203d0a043
commit
c2f2d0a363
2 changed files with 8 additions and 1 deletions
|
@ -101,7 +101,7 @@ using namespace libtorrent;
|
|||
*****************************************************/
|
||||
|
||||
// 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
|
||||
, has_python(false)
|
||||
#endif
|
||||
|
@ -686,8 +686,14 @@ void MainWindow::setTabText(int index, QString text) const {
|
|||
}
|
||||
|
||||
bool MainWindow::unlockUI() {
|
||||
if (unlockDlgShowing)
|
||||
return false;
|
||||
else
|
||||
unlockDlgShowing = true;
|
||||
|
||||
bool ok = false;
|
||||
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;
|
||||
Preferences* const pref = Preferences::instance();
|
||||
QString real_pass_md5 = pref->getUILockPasswordMD5();
|
||||
|
|
|
@ -183,6 +183,7 @@ private:
|
|||
bool displaySpeedInTitle;
|
||||
bool force_exit;
|
||||
bool ui_locked;
|
||||
bool unlockDlgShowing;
|
||||
LineEdit *search_filter;
|
||||
// Keyboard shortcuts
|
||||
QShortcut *switchSearchShortcut;
|
||||
|
|
Loading…
Reference in a new issue