mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Allow to clear the UI lock password. Closes #973.
This commit is contained in:
parent
12082a14b7
commit
660e0650ce
3 changed files with 13 additions and 0 deletions
|
@ -148,6 +148,8 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa
|
||||||
QMenu *lockMenu = new QMenu(this);
|
QMenu *lockMenu = new QMenu(this);
|
||||||
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
QAction *defineUiLockPasswdAct = lockMenu->addAction(tr("Set the password..."));
|
||||||
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
connect(defineUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(defineUILockPassword()));
|
||||||
|
QAction *clearUiLockPasswdAct = lockMenu->addAction(tr("Clear the password"));
|
||||||
|
connect(clearUiLockPasswdAct, SIGNAL(triggered()), this, SLOT(clearUILockPassword()));
|
||||||
actionLock_qBittorrent->setMenu(lockMenu);
|
actionLock_qBittorrent->setMenu(lockMenu);
|
||||||
// Creating Bittorrent session
|
// Creating Bittorrent session
|
||||||
connect(QBtSession::instance(), SIGNAL(fullDiskError(QTorrentHandle, QString)), this, SLOT(fullDiskError(QTorrentHandle, QString)));
|
connect(QBtSession::instance(), SIGNAL(fullDiskError(QTorrentHandle, QString)), this, SLOT(fullDiskError(QTorrentHandle, QString)));
|
||||||
|
@ -412,6 +414,12 @@ void MainWindow::defineUILockPassword() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::clearUILockPassword() {
|
||||||
|
QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Clear the password"), tr("Are you sure you want to clear the password?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
|
||||||
|
if (answer == QMessageBox::Yes)
|
||||||
|
Preferences().clearUILockPassword();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionLock_qBittorrent_triggered() {
|
void MainWindow::on_actionLock_qBittorrent_triggered() {
|
||||||
Preferences pref;
|
Preferences pref;
|
||||||
// Check if there is a password
|
// Check if there is a password
|
||||||
|
|
|
@ -107,6 +107,7 @@ protected slots:
|
||||||
void tab_changed(int);
|
void tab_changed(int);
|
||||||
void on_actionLock_qBittorrent_triggered();
|
void on_actionLock_qBittorrent_triggered();
|
||||||
void defineUILockPassword();
|
void defineUILockPassword();
|
||||||
|
void clearUILockPassword();
|
||||||
bool unlockUI();
|
bool unlockUI();
|
||||||
void notifyOfUpdate(QString);
|
void notifyOfUpdate(QString);
|
||||||
void showConnectionSettings();
|
void showConnectionSettings();
|
||||||
|
|
|
@ -923,6 +923,10 @@ public:
|
||||||
setValue("Locking/password", md5_password);
|
setValue("Locking/password", md5_password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearUILockPassword() {
|
||||||
|
remove("Locking/password");
|
||||||
|
}
|
||||||
|
|
||||||
QString getUILockPasswordMD5() const {
|
QString getUILockPasswordMD5() const {
|
||||||
return value("Locking/password", QString()).toString();
|
return value("Locking/password", QString()).toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue