mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 01:57:07 -07:00
Improve the message of the deletion dialog. Closes #1073.
This commit is contained in:
parent
475aa6aad8
commit
b1e682ef41
3 changed files with 13 additions and 7 deletions
|
@ -305,9 +305,10 @@ void TransferListWidget::deleteSelectedTorrents() {
|
|||
if (main_window->getCurrentTabWidget() != this) return;
|
||||
const QStringList& hashes = getSelectedTorrentsHashes();
|
||||
if (hashes.empty()) return;
|
||||
QTorrentHandle torrent = BTSession->getTorrentHandle(hashes[0]);
|
||||
bool delete_local_files = false;
|
||||
if (Preferences().confirmTorrentDeletion() &&
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files))
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(delete_local_files, hashes.size(), torrent.name()))
|
||||
return;
|
||||
foreach (const QString &hash, hashes) {
|
||||
BTSession->deleteTorrent(hash, delete_local_files);
|
||||
|
@ -316,9 +317,10 @@ void TransferListWidget::deleteSelectedTorrents() {
|
|||
|
||||
void TransferListWidget::deleteVisibleTorrents() {
|
||||
if (nameFilterModel->rowCount() <= 0) return;
|
||||
QTorrentHandle torrent = BTSession->getTorrentHandle(getHashFromRow(0));
|
||||
bool delete_local_files = false;
|
||||
if (Preferences().confirmTorrentDeletion() &&
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(&delete_local_files))
|
||||
!DeletionConfirmationDlg::askForDeletionConfirmation(delete_local_files, nameFilterModel->rowCount(), torrent.name()))
|
||||
return;
|
||||
QStringList hashes;
|
||||
for (int i=0; i<nameFilterModel->rowCount(); ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue