Use an appropriate method to show modal dialog

PR #16809.
This commit is contained in:
Vladimir Golovnev 2022-04-06 08:39:34 +03:00 committed by GitHub
parent 78344a10fa
commit 169c4991d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -968,7 +968,6 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *co
, tr("The torrent '%1' contains torrent files, do you want to proceed with their download?").arg(torrent->name()) , tr("The torrent '%1' contains torrent files, do you want to proceed with their download?").arg(torrent->name())
, QMessageBox::NoButton, this); , QMessageBox::NoButton, this);
confirmBox->setAttribute(Qt::WA_DeleteOnClose); confirmBox->setAttribute(Qt::WA_DeleteOnClose);
confirmBox->setModal(true);
const QPushButton *yes = confirmBox->addButton(tr("Yes"), QMessageBox::YesRole); const QPushButton *yes = confirmBox->addButton(tr("Yes"), QMessageBox::YesRole);
/*QPushButton *no = */ confirmBox->addButton(tr("No"), QMessageBox::NoRole); /*QPushButton *no = */ confirmBox->addButton(tr("No"), QMessageBox::NoRole);
@ -980,7 +979,7 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::Torrent *co
if (button == never) if (button == never)
Preferences::instance()->disableRecursiveDownload(); Preferences::instance()->disableRecursiveDownload();
}); });
confirmBox->show(); confirmBox->open();
} }
void MainWindow::handleDownloadFromUrlFailure(const QString &url, const QString &reason) const void MainWindow::handleDownloadFromUrlFailure(const QString &url, const QString &reason) const

View file

@ -342,7 +342,6 @@ void TransferListWidget::setSelectedTorrentsLocation()
auto fileDialog = new QFileDialog(this, tr("Choose save path"), oldLocation); auto fileDialog = new QFileDialog(this, tr("Choose save path"), oldLocation);
fileDialog->setAttribute(Qt::WA_DeleteOnClose); fileDialog->setAttribute(Qt::WA_DeleteOnClose);
fileDialog->setFileMode(QFileDialog::Directory); fileDialog->setFileMode(QFileDialog::Directory);
fileDialog->setModal(true);
fileDialog->setOptions(QFileDialog::DontConfirmOverwrite | QFileDialog::ShowDirsOnly | QFileDialog::HideNameFilterDetails); fileDialog->setOptions(QFileDialog::DontConfirmOverwrite | QFileDialog::ShowDirsOnly | QFileDialog::HideNameFilterDetails);
connect(fileDialog, &QDialog::accepted, this, [this, fileDialog]() connect(fileDialog, &QDialog::accepted, this, [this, fileDialog]()
{ {
@ -362,7 +361,7 @@ void TransferListWidget::setSelectedTorrentsLocation()
} }
}); });
fileDialog->show(); fileDialog->open();
} }
void TransferListWidget::pauseAllTorrents() void TransferListWidget::pauseAllTorrents()