mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Ask for user confirmation because proceeding with recursive torrent download (security risk)
Fix "add file" dialog in torrent creation tool
This commit is contained in:
@@ -117,6 +117,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
||||
connect(BTSession, SIGNAL(newDownloadedTorrent(QString, QString)), this, SLOT(processDownloadedFiles(QString, QString)));
|
||||
connect(BTSession, SIGNAL(downloadFromUrlFailure(QString, QString)), this, SLOT(handleDownloadFromUrlFailure(QString, QString)));
|
||||
connect(BTSession, SIGNAL(alternativeSpeedsModeChanged(bool)), this, SLOT(updateAltSpeedsBtn(bool)));
|
||||
connect(BTSession, SIGNAL(recursiveTorrentDownloadPossible(QTorrentHandle&)), this, SLOT(askRecursiveTorrentDownloadConfirmation(QTorrentHandle&)));
|
||||
|
||||
qDebug("create tabWidget");
|
||||
tabs = new QTabWidget();
|
||||
@@ -413,6 +414,12 @@ void GUI::readParamsOnSocket() {
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::askRecursiveTorrentDownloadConfirmation(QTorrentHandle &h) {
|
||||
if(QMessageBox::question(this, tr("Recursive download confirmation"), tr("The torrent %1 contains torrent files, do you want to proceed with their download?").arg(h.name()), QMessageBox::Yes|QMessageBox::No) == QMessageBox::Yes) {
|
||||
BTSession->recursiveTorrentDownload(h);
|
||||
}
|
||||
}
|
||||
|
||||
void GUI::handleDownloadFromUrlFailure(QString url, QString reason) const{
|
||||
// Display a message box
|
||||
QMessageBox::critical(0, tr("Url download error"), tr("Couldn't download file at url: %1, reason: %2.").arg(url).arg(reason));
|
||||
|
||||
Reference in New Issue
Block a user