Add confirmation for enabling Auto TMM from context menu

Closes #16046
This commit is contained in:
thalieht
2022-01-23 20:37:38 +02:00
parent 1729b9f29c
commit 03c774eae7
2 changed files with 10 additions and 2 deletions

View File

@@ -690,8 +690,16 @@ void TransferListWidget::setSelectedFirstLastPiecePrio(const bool enabled) const
torrent->setFirstLastPiecePriority(enabled);
}
void TransferListWidget::setSelectedAutoTMMEnabled(const bool enabled) const
void TransferListWidget::setSelectedAutoTMMEnabled(const bool enabled)
{
if (enabled)
{
const QMessageBox::StandardButton btn = QMessageBox::question(this, tr("Enable automatic torrent management")
, tr("Are you sure you want to enable Automatic Torrent Management for the selected torrent(s)? They may be relocated.")
, (QMessageBox::Yes | QMessageBox::No), QMessageBox::Yes);
if (btn != QMessageBox::Yes) return;
}
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
torrent->setAutoTMMEnabled(enabled);
}