Browse Source

Add confirmation for enabling Auto TMM from context menu

Closes #16046
adaptive-webui-19844
thalieht 3 years ago
parent
commit
03c774eae7
  1. 10
      src/gui/transferlistwidget.cpp
  2. 2
      src/gui/transferlistwidget.h

10
src/gui/transferlistwidget.cpp

@ -690,8 +690,16 @@ void TransferListWidget::setSelectedFirstLastPiecePrio(const bool enabled) const @@ -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);
}

2
src/gui/transferlistwidget.h

@ -111,7 +111,7 @@ private slots: @@ -111,7 +111,7 @@ private slots:
void setSelectedTorrentsSuperSeeding(bool enabled) const;
void setSelectedTorrentsSequentialDownload(bool enabled) const;
void setSelectedFirstLastPiecePrio(bool enabled) const;
void setSelectedAutoTMMEnabled(bool enabled) const;
void setSelectedAutoTMMEnabled(bool enabled);
void askNewCategoryForSelection();
void saveSettings();

Loading…
Cancel
Save