Use Start/Stop instead of Resume/Pause

PR #20532.

---------

Co-authored-by: Vladimir Golovnev (Glassez) <glassez@yandex.ru>
This commit is contained in:
thalieht
2024-03-25 18:11:04 +02:00
committed by GitHub
parent f2d6129db3
commit 5d1c249606
70 changed files with 413 additions and 391 deletions

View File

@@ -325,7 +325,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::TorrentDescriptor &to
}
else
{
m_ui->startTorrentCheckBox->setChecked(!m_torrentParams.addPaused.value_or(session->isAddTorrentPaused()));
m_ui->startTorrentCheckBox->setChecked(!m_torrentParams.addStopped.value_or(session->isAddTorrentStopped()));
m_ui->stopConditionComboBox->setCurrentIndex(m_ui->stopConditionComboBox->findData(QVariant::fromValue(stopCondition)));
}
m_ui->stopConditionLabel->setEnabled(m_ui->startTorrentCheckBox->isChecked());
@@ -693,7 +693,7 @@ void AddNewTorrentDialog::accept()
m_storeRememberLastSavePath = m_ui->checkBoxRememberLastSavePath->isChecked();
m_torrentParams.addToQueueTop = m_ui->addToQueueTopCheckBox->isChecked();
m_torrentParams.addPaused = !m_ui->startTorrentCheckBox->isChecked();
m_torrentParams.addStopped = !m_ui->startTorrentCheckBox->isChecked();
m_torrentParams.stopCondition = m_ui->stopConditionComboBox->currentData().value<BitTorrent::Torrent::StopCondition>();
m_torrentParams.contentLayout = static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex());

View File

@@ -240,15 +240,15 @@ void AddTorrentParamsWidget::populate()
m_ui->tagsLineEdit->setText(Utils::String::joinIntoString(m_addTorrentParams.tags, u", "_s));
m_ui->startTorrentComboBox->disconnect(this);
m_ui->startTorrentComboBox->setCurrentIndex(m_addTorrentParams.addPaused
? m_ui->startTorrentComboBox->findData(!*m_addTorrentParams.addPaused) : 0);
m_ui->startTorrentComboBox->setCurrentIndex(m_addTorrentParams.addStopped
? m_ui->startTorrentComboBox->findData(!*m_addTorrentParams.addStopped) : 0);
connect(m_ui->startTorrentComboBox, &QComboBox::currentIndexChanged, this, [this]
{
const QVariant data = m_ui->startTorrentComboBox->currentData();
if (!data.isValid())
m_addTorrentParams.addPaused = std::nullopt;
m_addTorrentParams.addStopped = std::nullopt;
else
m_addTorrentParams.addPaused = !data.toBool();
m_addTorrentParams.addStopped = !data.toBool();
});
m_ui->skipCheckingCheckBox->disconnect(this);

View File

@@ -167,8 +167,8 @@ MainWindow::MainWindow(IGUIApplication *app, const WindowState initialState, con
m_ui->actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_s));
m_ui->actionLock->setIcon(UIThemeManager::instance()->getIcon(u"object-locked"_s));
m_ui->actionOptions->setIcon(UIThemeManager::instance()->getIcon(u"configure"_s, u"preferences-system"_s));
m_ui->actionPause->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
m_ui->actionPauseAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
m_ui->actionStop->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
m_ui->actionStopAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s));
m_ui->actionStart->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
m_ui->actionStartAll->setIcon(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
m_ui->menuAutoShutdownOnDownloadsCompletion->setIcon(UIThemeManager::instance()->getIcon(u"task-complete"_s, u"application-exit"_s));
@@ -285,9 +285,9 @@ MainWindow::MainWindow(IGUIApplication *app, const WindowState initialState, con
// Transfer list slots
connect(m_ui->actionStart, &QAction::triggered, m_transferListWidget, &TransferListWidget::startSelectedTorrents);
connect(m_ui->actionStartAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::resumeAllTorrents);
connect(m_ui->actionPause, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseSelectedTorrents);
connect(m_ui->actionPauseAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::pauseAllTorrents);
connect(m_ui->actionStartAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::startAllTorrents);
connect(m_ui->actionStop, &QAction::triggered, m_transferListWidget, &TransferListWidget::stopSelectedTorrents);
connect(m_ui->actionStopAll, &QAction::triggered, m_transferListWidget, &TransferListWidget::stopAllTorrents);
connect(m_ui->actionDelete, &QAction::triggered, m_transferListWidget, &TransferListWidget::softDeleteSelectedTorrents);
connect(m_ui->actionTopQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::topQueuePosSelectedTorrents);
connect(m_ui->actionIncreaseQueuePos, &QAction::triggered, m_transferListWidget, &TransferListWidget::increaseQueuePosSelectedTorrents);
@@ -882,8 +882,8 @@ void MainWindow::createKeyboardShortcuts()
m_ui->actionStatistics->setShortcut(Qt::CTRL | Qt::Key_I);
m_ui->actionStart->setShortcut(Qt::CTRL | Qt::Key_S);
m_ui->actionStartAll->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_S);
m_ui->actionPause->setShortcut(Qt::CTRL | Qt::Key_P);
m_ui->actionPauseAll->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);
m_ui->actionStop->setShortcut(Qt::CTRL | Qt::Key_P);
m_ui->actionStopAll->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_P);
m_ui->actionBottomQueuePos->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_Minus);
m_ui->actionDecreaseQueuePos->setShortcut(Qt::CTRL | Qt::Key_Minus);
m_ui->actionIncreaseQueuePos->setShortcut(Qt::CTRL | Qt::Key_Plus);
@@ -1568,7 +1568,7 @@ QMenu *MainWindow::createDesktopIntegrationMenu()
menu->addSeparator();
menu->addAction(m_ui->actionStartAll);
menu->addAction(m_ui->actionPauseAll);
menu->addAction(m_ui->actionStopAll);
#ifndef Q_OS_MACOS
menu->addSeparator();
@@ -1887,10 +1887,10 @@ void MainWindow::updatePowerManagementState() const
const QVector<BitTorrent::Torrent *> allTorrents = BitTorrent::Session::instance()->torrents();
const bool inhibitSuspend = std::any_of(allTorrents.cbegin(), allTorrents.cend(), [&](const BitTorrent::Torrent *torrent)
{
if (preventFromSuspendWhenDownloading && (!torrent->isFinished() && !torrent->isPaused() && !torrent->isErrored() && torrent->hasMetadata()))
if (preventFromSuspendWhenDownloading && (!torrent->isFinished() && !torrent->isStopped() && !torrent->isErrored() && torrent->hasMetadata()))
return true;
if (preventFromSuspendWhenSeeding && (torrent->isFinished() && !torrent->isPaused()))
if (preventFromSuspendWhenSeeding && (torrent->isFinished() && !torrent->isStopped()))
return true;
return torrent->isMoving();

View File

@@ -170,7 +170,7 @@ private slots:
void on_actionDownloadFromURL_triggered();
void on_actionExit_triggered();
void on_actionLock_triggered();
// Check for unpaused downloading or seeding torrents and prevent system suspend/sleep according to preferences
// Check for non-stopped downloading or seeding torrents and prevent system suspend/sleep according to preferences
void updatePowerManagementState() const;
void toolbarMenuRequested();

View File

@@ -43,9 +43,9 @@
<string>&amp;Edit</string>
</property>
<addaction name="actionStart"/>
<addaction name="actionPause"/>
<addaction name="actionStop"/>
<addaction name="actionStartAll"/>
<addaction name="actionPauseAll"/>
<addaction name="actionStopAll"/>
<addaction name="separator"/>
<addaction name="actionDelete"/>
<addaction name="actionTopQueuePos"/>
@@ -153,7 +153,7 @@
<addaction name="actionDelete"/>
<addaction name="separator"/>
<addaction name="actionStart"/>
<addaction name="actionPause"/>
<addaction name="actionStop"/>
<addaction name="actionTopQueuePos"/>
<addaction name="actionIncreaseQueuePos"/>
<addaction name="actionDecreaseQueuePos"/>
@@ -188,22 +188,22 @@
</action>
<action name="actionStart">
<property name="text">
<string>&amp;Resume</string>
<string>Sta&amp;rt</string>
</property>
</action>
<action name="actionPause">
<action name="actionStop">
<property name="text">
<string>&amp;Pause</string>
<string>Sto&amp;p</string>
</property>
</action>
<action name="actionStartAll">
<property name="text">
<string>R&amp;esume All</string>
<string>Star&amp;t All</string>
</property>
</action>
<action name="actionPauseAll">
<action name="actionStopAll">
<property name="text">
<string>P&amp;ause All</string>
<string>&amp;Stop All</string>
</property>
</action>
<action name="actionDelete">

View File

@@ -253,17 +253,17 @@ void OptionsDialog::loadBehaviorTabOptions()
m_ui->comboHideZero->setCurrentIndex(pref->getHideZeroComboValues());
m_ui->comboHideZero->setEnabled(m_ui->checkHideZero->isChecked());
m_ui->actionTorrentDlOnDblClBox->setItemData(0, TOGGLE_PAUSE);
m_ui->actionTorrentDlOnDblClBox->setItemData(0, TOGGLE_STOP);
m_ui->actionTorrentDlOnDblClBox->setItemData(1, OPEN_DEST);
m_ui->actionTorrentDlOnDblClBox->setItemData(2, PREVIEW_FILE);
m_ui->actionTorrentDlOnDblClBox->setItemData(3, SHOW_OPTIONS);
m_ui->actionTorrentDlOnDblClBox->setItemData(4, NO_ACTION);
int actionDownloading = pref->getActionOnDblClOnTorrentDl();
if ((actionDownloading < 0) || (actionDownloading >= m_ui->actionTorrentDlOnDblClBox->count()))
actionDownloading = TOGGLE_PAUSE;
actionDownloading = TOGGLE_STOP;
m_ui->actionTorrentDlOnDblClBox->setCurrentIndex(m_ui->actionTorrentDlOnDblClBox->findData(actionDownloading));
m_ui->actionTorrentFnOnDblClBox->setItemData(0, TOGGLE_PAUSE);
m_ui->actionTorrentFnOnDblClBox->setItemData(0, TOGGLE_STOP);
m_ui->actionTorrentFnOnDblClBox->setItemData(1, OPEN_DEST);
m_ui->actionTorrentFnOnDblClBox->setItemData(2, PREVIEW_FILE);
m_ui->actionTorrentFnOnDblClBox->setItemData(3, SHOW_OPTIONS);
@@ -281,7 +281,7 @@ void OptionsDialog::loadBehaviorTabOptions()
m_ui->checkShowSplash->setChecked(!pref->isSplashScreenDisabled());
m_ui->checkProgramExitConfirm->setChecked(pref->confirmOnExit());
m_ui->checkProgramAutoExitConfirm->setChecked(!pref->dontConfirmAutoExit());
m_ui->checkConfirmPauseAndResumeAll->setChecked(pref->confirmPauseAndResumeAll());
m_ui->checkConfirmStopAndStartAll->setChecked(pref->confirmPauseAndResumeAll());
m_ui->windowStateComboBox->addItem(tr("Normal"), QVariant::fromValue(WindowState::Normal));
m_ui->windowStateComboBox->addItem(tr("Minimized"), QVariant::fromValue(WindowState::Minimized));
@@ -381,7 +381,7 @@ void OptionsDialog::loadBehaviorTabOptions()
connect(m_ui->checkShowSplash, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProgramExitConfirm, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProgramAutoExitConfirm, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkConfirmPauseAndResumeAll, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkConfirmStopAndStartAll, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkShowSystray, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkMinimizeToSysTray, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkCloseToSystray, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@@ -464,7 +464,7 @@ void OptionsDialog::saveBehaviorTabOptions() const
pref->setSplashScreenDisabled(isSplashScreenDisabled());
pref->setConfirmOnExit(m_ui->checkProgramExitConfirm->isChecked());
pref->setDontConfirmAutoExit(!m_ui->checkProgramAutoExitConfirm->isChecked());
pref->setConfirmPauseAndResumeAll(m_ui->checkConfirmPauseAndResumeAll->isChecked());
pref->setConfirmPauseAndResumeAll(m_ui->checkConfirmStopAndStartAll->isChecked());
#ifdef Q_OS_WIN
pref->setWinStartup(WinStartup());
@@ -522,7 +522,7 @@ void OptionsDialog::loadDownloadsTabOptions()
m_ui->contentLayoutComboBox->setCurrentIndex(static_cast<int>(session->torrentContentLayout()));
m_ui->checkAddToQueueTop->setChecked(session->isAddTorrentToQueueTop());
m_ui->checkStartPaused->setChecked(session->isAddTorrentPaused());
m_ui->checkAddStopped->setChecked(session->isAddTorrentStopped());
m_ui->stopConditionComboBox->setToolTip(
u"<html><body><p><b>" + tr("None") + u"</b> - " + tr("No stop condition is set.") + u"</p><p><b>" +
@@ -534,8 +534,8 @@ void OptionsDialog::loadDownloadsTabOptions()
m_ui->stopConditionComboBox->setItemData(1, QVariant::fromValue(BitTorrent::Torrent::StopCondition::MetadataReceived));
m_ui->stopConditionComboBox->setItemData(2, QVariant::fromValue(BitTorrent::Torrent::StopCondition::FilesChecked));
m_ui->stopConditionComboBox->setCurrentIndex(m_ui->stopConditionComboBox->findData(QVariant::fromValue(session->torrentStopCondition())));
m_ui->stopConditionLabel->setEnabled(!m_ui->checkStartPaused->isChecked());
m_ui->stopConditionComboBox->setEnabled(!m_ui->checkStartPaused->isChecked());
m_ui->stopConditionLabel->setEnabled(!m_ui->checkAddStopped->isChecked());
m_ui->stopConditionComboBox->setEnabled(!m_ui->checkAddStopped->isChecked());
m_ui->checkMergeTrackers->setChecked(session->isMergeTrackersEnabled());
m_ui->checkConfirmMergeTrackers->setEnabled(m_ui->checkAdditionDialog->isChecked());
@@ -655,8 +655,8 @@ void OptionsDialog::loadDownloadsTabOptions()
connect(m_ui->contentLayoutComboBox, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkAddToQueueTop, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkStartPaused, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkStartPaused, &QAbstractButton::toggled, this, [this](const bool checked)
connect(m_ui->checkAddStopped, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkAddStopped, &QAbstractButton::toggled, this, [this](const bool checked)
{
m_ui->stopConditionLabel->setEnabled(!checked);
m_ui->stopConditionComboBox->setEnabled(!checked);
@@ -732,7 +732,7 @@ void OptionsDialog::saveDownloadsTabOptions() const
session->setTorrentContentLayout(static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex()));
session->setAddTorrentToQueueTop(m_ui->checkAddToQueueTop->isChecked());
session->setAddTorrentPaused(addTorrentsInPause());
session->setAddTorrentStopped(addTorrentsStopped());
session->setTorrentStopCondition(m_ui->stopConditionComboBox->currentData().value<BitTorrent::Torrent::StopCondition>());
TorrentFileGuard::setAutoDeleteMode(!m_ui->deleteTorrentBox->isChecked() ? TorrentFileGuard::Never
: !m_ui->deleteCancelledTorrentBox->isChecked() ? TorrentFileGuard::IfAdded
@@ -1687,9 +1687,9 @@ bool OptionsDialog::preAllocateAllFiles() const
return m_ui->checkPreallocateAll->isChecked();
}
bool OptionsDialog::addTorrentsInPause() const
bool OptionsDialog::addTorrentsStopped() const
{
return m_ui->checkStartPaused->isChecked();
return m_ui->checkAddStopped->isChecked();
}
// Proxy settings

View File

@@ -42,7 +42,7 @@ class AdvancedSettings;
// actions on double-click on torrents
enum DoubleClickAction
{
TOGGLE_PAUSE = 0,
TOGGLE_STOP = 0,
OPEN_DEST = 1,
PREVIEW_FILE = 2,
NO_ACTION = 3,
@@ -151,7 +151,7 @@ private:
// Downloads
bool preAllocateAllFiles() const;
bool useAdditionDialog() const;
bool addTorrentsInPause() const;
bool addTorrentsStopped() const;
Path getTorrentExportDir() const;
Path getFinishedTorrentExportDir() const;
// Connection options

View File

@@ -227,12 +227,12 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkConfirmPauseAndResumeAll">
<widget class="QCheckBox" name="checkConfirmStopAndStartAll">
<property name="toolTip">
<string>Shows a confirmation dialog upon pausing/resuming all the torrents</string>
<string>Shows a confirmation dialog upon pausing/starting all the torrents</string>
</property>
<property name="text">
<string>Confirm &quot;Pause/Resume all&quot; actions</string>
<string>Confirm &quot;Stop/Start all&quot; actions</string>
</property>
<property name="checked">
<bool>true</bool>
@@ -267,7 +267,7 @@
</item>
<item>
<property name="text">
<string>Paused torrents only</string>
<string>Stopped torrents only</string>
</property>
</item>
</widget>
@@ -925,12 +925,12 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkStartPaused">
<widget class="QCheckBox" name="checkAddStopped">
<property name="toolTip">
<string>The torrent will be added to download list in a paused state</string>
<string>The torrent will be added to download list in a stopped state</string>
</property>
<property name="text">
<string extracomment="The torrent will be added to download list in a paused state">Do not start the download automatically</string>
<string extracomment="The torrent will be added to download list in a stopped state">Do not start the download automatically</string>
</property>
</widget>
</item>
@@ -3043,7 +3043,7 @@ Disable encryption: Only connect to peers without protocol encryption</string>
</property>
<item>
<property name="text">
<string>Pause torrent</string>
<string>Stop torrent</string>
</property>
</item>
<item>
@@ -3897,7 +3897,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.</string>
<tabstop>comboI18n</tabstop>
<tabstop>checkUseCustomTheme</tabstop>
<tabstop>customThemeFilePath</tabstop>
<tabstop>checkStartPaused</tabstop>
<tabstop>checkAddStopped</tabstop>
<tabstop>stopConditionComboBox</tabstop>
<tabstop>spinPort</tabstop>
<tabstop>checkUPnP</tabstop>

View File

@@ -437,7 +437,7 @@ void PropertiesWidget::loadDynamicData()
m_ui->labelTotalPiecesVal->setText(tr("%1 x %2 (have %3)", "(torrent pieces) eg 152 x 4MB (have 25)").arg(m_torrent->piecesCount()).arg(Utils::Misc::friendlyUnit(m_torrent->pieceLength())).arg(m_torrent->piecesHave()));
if (!m_torrent->isFinished() && !m_torrent->isPaused() && !m_torrent->isQueued() && !m_torrent->isChecking())
if (!m_torrent->isFinished() && !m_torrent->isStopped() && !m_torrent->isQueued() && !m_torrent->isChecking())
{
// Pieces availability
showPiecesAvailability(true);

View File

@@ -546,7 +546,7 @@
</sizepolicy>
</property>
<property name="text">
<string extracomment="Time (duration) the torrent is active (not paused)">Time Active:</string>
<string extracomment="Time (duration) the torrent is active (not stopped)">Time Active:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

View File

@@ -169,9 +169,9 @@ void PluginSelectDialog::togglePluginState(QTreeWidgetItem *item, int)
void PluginSelectDialog::displayContextMenu()
{
// Enable/disable pause/start action given the DL state
const QList<QTreeWidgetItem *> items = m_ui->pluginsTree->selectedItems();
if (items.isEmpty()) return;
if (items.isEmpty())
return;
QMenu *myContextMenu = new QMenu(this);
myContextMenu->setAttribute(Qt::WA_DeleteOnClose);

View File

@@ -346,14 +346,14 @@ void TrackerListWidget::showTrackerListMenu()
, this, &TrackerListWidget::deleteSelectedTrackers);
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-copy"_s), tr("Copy tracker URL")
, this, &TrackerListWidget::copyTrackerUrl);
if (!torrent()->isPaused())
if (!torrent()->isStopped())
{
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_s, u"view-refresh"_s), tr("Force reannounce to selected trackers")
, this, &TrackerListWidget::reannounceSelected);
}
}
if (!torrent()->isPaused())
if (!torrent()->isStopped())
{
menu->addSeparator();
menu->addAction(UIThemeManager::instance()->getIcon(u"reannounce"_s, u"view-refresh"_s), tr("Force reannounce to all trackers")

View File

@@ -74,7 +74,7 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
switch (state)
{
case TorrentState::Error:
case TorrentState::PausedDownloading:
case TorrentState::StoppedDownloading:
case TorrentState::Unknown:
return false;
default:

View File

@@ -128,10 +128,10 @@ void CategoryFilterWidget::showMenu()
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Remove unused categories")
, this, &CategoryFilterWidget::removeUnusedCategories);
menu->addSeparator();
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Resume torrents")
, this, &CategoryFilterWidget::actionResumeTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Pause torrents")
, this, &CategoryFilterWidget::actionPauseTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Start torrents")
, this, &CategoryFilterWidget::actionStartTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Stop torrents")
, this, &CategoryFilterWidget::actionStopTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_s), tr("Remove torrents")
, this, &CategoryFilterWidget::actionDeleteTorrentsTriggered);

View File

@@ -42,8 +42,8 @@ public:
signals:
void categoryChanged(const QString &categoryName);
void actionResumeTorrentsTriggered();
void actionPauseTorrentsTriggered();
void actionStartTorrentsTriggered();
void actionStopTorrentsTriggered();
void actionDeleteTorrentsTriggered();
private slots:

View File

@@ -55,12 +55,12 @@ StatusFilterWidget::StatusFilterWidget(QWidget *parent, TransferListWidget *tran
auto *completed = new QListWidgetItem(this);
completed->setData(Qt::DisplayRole, tr("Completed (0)"));
completed->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"checked-completed"_s, u"completed"_s));
auto *resumed = new QListWidgetItem(this);
resumed->setData(Qt::DisplayRole, tr("Resumed (0)"));
resumed->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
auto *paused = new QListWidgetItem(this);
paused->setData(Qt::DisplayRole, tr("Paused (0)"));
paused->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"stopped"_s, u"media-playback-pause"_s));
auto *running = new QListWidgetItem(this);
running->setData(Qt::DisplayRole, tr("Running (0)"));
running->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s));
auto *stopped = new QListWidgetItem(this);
stopped->setData(Qt::DisplayRole, tr("Stopped (0)"));
stopped->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"stopped"_s, u"media-playback-pause"_s));
auto *active = new QListWidgetItem(this);
active->setData(Qt::DisplayRole, tr("Active (0)"));
active->setData(Qt::DecorationRole, UIThemeManager::instance()->getIcon(u"filter-active"_s, u"filteractive"_s));
@@ -147,8 +147,8 @@ void StatusFilterWidget::updateTorrentStatus(const BitTorrent::Torrent *torrent)
update(TorrentFilter::Downloading, m_nbDownloading);
update(TorrentFilter::Seeding, m_nbSeeding);
update(TorrentFilter::Completed, m_nbCompleted);
update(TorrentFilter::Resumed, m_nbResumed);
update(TorrentFilter::Paused, m_nbPaused);
update(TorrentFilter::Running, m_nbRunning);
update(TorrentFilter::Stopped, m_nbStopped);
update(TorrentFilter::Active, m_nbActive);
update(TorrentFilter::Inactive, m_nbInactive);
update(TorrentFilter::StalledUploading, m_nbStalledUploading);
@@ -167,8 +167,8 @@ void StatusFilterWidget::updateTexts()
item(TorrentFilter::Downloading)->setData(Qt::DisplayRole, tr("Downloading (%1)").arg(m_nbDownloading));
item(TorrentFilter::Seeding)->setData(Qt::DisplayRole, tr("Seeding (%1)").arg(m_nbSeeding));
item(TorrentFilter::Completed)->setData(Qt::DisplayRole, tr("Completed (%1)").arg(m_nbCompleted));
item(TorrentFilter::Resumed)->setData(Qt::DisplayRole, tr("Resumed (%1)").arg(m_nbResumed));
item(TorrentFilter::Paused)->setData(Qt::DisplayRole, tr("Paused (%1)").arg(m_nbPaused));
item(TorrentFilter::Running)->setData(Qt::DisplayRole, tr("Running (%1)").arg(m_nbRunning));
item(TorrentFilter::Stopped)->setData(Qt::DisplayRole, tr("Stopped (%1)").arg(m_nbStopped));
item(TorrentFilter::Active)->setData(Qt::DisplayRole, tr("Active (%1)").arg(m_nbActive));
item(TorrentFilter::Inactive)->setData(Qt::DisplayRole, tr("Inactive (%1)").arg(m_nbInactive));
item(TorrentFilter::Stalled)->setData(Qt::DisplayRole, tr("Stalled (%1)").arg(m_nbStalled));
@@ -184,8 +184,8 @@ void StatusFilterWidget::hideZeroItems()
item(TorrentFilter::Downloading)->setHidden(m_nbDownloading == 0);
item(TorrentFilter::Seeding)->setHidden(m_nbSeeding == 0);
item(TorrentFilter::Completed)->setHidden(m_nbCompleted == 0);
item(TorrentFilter::Resumed)->setHidden(m_nbResumed == 0);
item(TorrentFilter::Paused)->setHidden(m_nbPaused == 0);
item(TorrentFilter::Running)->setHidden(m_nbRunning == 0);
item(TorrentFilter::Stopped)->setHidden(m_nbStopped == 0);
item(TorrentFilter::Active)->setHidden(m_nbActive == 0);
item(TorrentFilter::Inactive)->setHidden(m_nbInactive == 0);
item(TorrentFilter::Stalled)->setHidden(m_nbStalled == 0);
@@ -218,10 +218,10 @@ void StatusFilterWidget::showMenu()
QMenu *menu = new QMenu(this);
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Resume torrents")
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Start torrents")
, transferList(), &TransferListWidget::startVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Pause torrents")
, transferList(), &TransferListWidget::pauseVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Stop torrents")
, transferList(), &TransferListWidget::stopVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_s), tr("Remove torrents")
, transferList(), &TransferListWidget::deleteVisibleTorrents);
@@ -251,10 +251,10 @@ void StatusFilterWidget::torrentAboutToBeDeleted(BitTorrent::Torrent *const torr
--m_nbSeeding;
if (status[TorrentFilter::Completed])
--m_nbCompleted;
if (status[TorrentFilter::Resumed])
--m_nbResumed;
if (status[TorrentFilter::Paused])
--m_nbPaused;
if (status[TorrentFilter::Running])
--m_nbRunning;
if (status[TorrentFilter::Stopped])
--m_nbStopped;
if (status[TorrentFilter::Active])
--m_nbActive;
if (status[TorrentFilter::Inactive])

View File

@@ -68,8 +68,8 @@ private:
int m_nbDownloading = 0;
int m_nbSeeding = 0;
int m_nbCompleted = 0;
int m_nbResumed = 0;
int m_nbPaused = 0;
int m_nbRunning = 0;
int m_nbStopped = 0;
int m_nbActive = 0;
int m_nbInactive = 0;
int m_nbStalled = 0;

View File

@@ -117,10 +117,10 @@ void TagFilterWidget::showMenu()
menu->addAction(UIThemeManager::instance()->getIcon(u"edit-clear"_s, u"list-remove"_s), tr("Remove unused tags")
, this, &TagFilterWidget::removeUnusedTags);
menu->addSeparator();
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Resume torrents")
, this, &TagFilterWidget::actionResumeTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Pause torrents")
, this, &TagFilterWidget::actionPauseTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Start torrents")
, this, &TagFilterWidget::actionStartTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Stop torrents")
, this, &TagFilterWidget::actionStopTorrentsTriggered);
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_s), tr("Remove torrents")
, this, &TagFilterWidget::actionDeleteTorrentsTriggered);

View File

@@ -45,8 +45,8 @@ public:
signals:
void tagChanged(const std::optional<Tag> &tag);
void actionResumeTorrentsTriggered();
void actionPauseTorrentsTriggered();
void actionStartTorrentsTriggered();
void actionStopTorrentsTriggered();
void actionDeleteTorrentsTriggered();
private slots:

View File

@@ -568,10 +568,10 @@ void TrackersFilterWidget::showMenu()
menu->addSeparator();
}
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Resume torrents")
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("Start torrents")
, transferList(), &TransferListWidget::startVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Pause torrents")
, transferList(), &TransferListWidget::pauseVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Stop torrents")
, transferList(), &TransferListWidget::stopVisibleTorrents);
menu->addAction(UIThemeManager::instance()->getIcon(u"list-remove"_s), tr("Remove torrents")
, transferList(), &TransferListWidget::deleteVisibleTorrents);

View File

@@ -123,9 +123,9 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
m_categoryFilterWidget = new CategoryFilterWidget(this);
connect(m_categoryFilterWidget, &CategoryFilterWidget::actionDeleteTorrentsTriggered
, transferList, &TransferListWidget::deleteVisibleTorrents);
connect(m_categoryFilterWidget, &CategoryFilterWidget::actionPauseTorrentsTriggered
, transferList, &TransferListWidget::pauseVisibleTorrents);
connect(m_categoryFilterWidget, &CategoryFilterWidget::actionResumeTorrentsTriggered
connect(m_categoryFilterWidget, &CategoryFilterWidget::actionStopTorrentsTriggered
, transferList, &TransferListWidget::stopVisibleTorrents);
connect(m_categoryFilterWidget, &CategoryFilterWidget::actionStartTorrentsTriggered
, transferList, &TransferListWidget::startVisibleTorrents);
connect(m_categoryFilterWidget, &CategoryFilterWidget::categoryChanged
, transferList, &TransferListWidget::applyCategoryFilter);
@@ -141,9 +141,9 @@ TransferListFiltersWidget::TransferListFiltersWidget(QWidget *parent, TransferLi
m_tagFilterWidget = new TagFilterWidget(this);
connect(m_tagFilterWidget, &TagFilterWidget::actionDeleteTorrentsTriggered
, transferList, &TransferListWidget::deleteVisibleTorrents);
connect(m_tagFilterWidget, &TagFilterWidget::actionPauseTorrentsTriggered
, transferList, &TransferListWidget::pauseVisibleTorrents);
connect(m_tagFilterWidget, &TagFilterWidget::actionResumeTorrentsTriggered
connect(m_tagFilterWidget, &TagFilterWidget::actionStopTorrentsTriggered
, transferList, &TransferListWidget::stopVisibleTorrents);
connect(m_tagFilterWidget, &TagFilterWidget::actionStartTorrentsTriggered
, transferList, &TransferListWidget::startVisibleTorrents);
connect(m_tagFilterWidget, &TagFilterWidget::tagChanged
, transferList, &TransferListWidget::applyTagFilter);

View File

@@ -70,8 +70,8 @@ namespace
{BitTorrent::TorrentState::CheckingDownloading, u"TransferList.CheckingDownloading"_s},
{BitTorrent::TorrentState::CheckingUploading, u"TransferList.CheckingUploading"_s},
{BitTorrent::TorrentState::CheckingResumeData, u"TransferList.CheckingResumeData"_s},
{BitTorrent::TorrentState::PausedDownloading, u"TransferList.PausedDownloading"_s},
{BitTorrent::TorrentState::PausedUploading, u"TransferList.PausedUploading"_s},
{BitTorrent::TorrentState::StoppedDownloading, u"TransferList.StoppedDownloading"_s},
{BitTorrent::TorrentState::StoppedUploading, u"TransferList.StoppedUploading"_s},
{BitTorrent::TorrentState::Moving, u"TransferList.Moving"_s},
{BitTorrent::TorrentState::MissingFiles, u"TransferList.MissingFiles"_s},
{BitTorrent::TorrentState::Error, u"TransferList.Error"_s}
@@ -106,8 +106,8 @@ TransferListModel::TransferListModel(QObject *parent)
{BitTorrent::TorrentState::CheckingDownloading, tr("Checking", "Torrent local data is being checked")},
{BitTorrent::TorrentState::CheckingUploading, tr("Checking", "Torrent local data is being checked")},
{BitTorrent::TorrentState::CheckingResumeData, tr("Checking resume data", "Used when loading the torrents from disk after qbt is launched. It checks the correctness of the .fastresume file. Normally it is completed in a fraction of a second, unless loading many many torrents.")},
{BitTorrent::TorrentState::PausedDownloading, tr("Paused")},
{BitTorrent::TorrentState::PausedUploading, tr("Completed")},
{BitTorrent::TorrentState::StoppedDownloading, tr("Stopped")},
{BitTorrent::TorrentState::StoppedUploading, tr("Completed")},
{BitTorrent::TorrentState::Moving, tr("Moving", "Torrent local data are being moved/relocated")},
{BitTorrent::TorrentState::MissingFiles, tr("Missing Files")},
{BitTorrent::TorrentState::Error, tr("Errored", "Torrent status, the torrent has an error")}
@@ -134,8 +134,8 @@ TransferListModel::TransferListModel(QObject *parent)
connect(Session::instance(), &Session::torrentFinished, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentMetadataReceived, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentResumed, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentPaused, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentStarted, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentStopped, this, &TransferListModel::handleTorrentStatusUpdated);
connect(Session::instance(), &Session::torrentFinishedChecking, this, &TransferListModel::handleTorrentStatusUpdated);
}
@@ -161,7 +161,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation
case TR_NAME: return tr("Name", "i.e: torrent name");
case TR_SIZE: return tr("Size", "i.e: torrent size");
case TR_PROGRESS: return tr("Progress", "% Done");
case TR_STATUS: return tr("Status", "Torrent status (e.g. downloading, seeding, paused)");
case TR_STATUS: return tr("Status", "Torrent status (e.g. downloading, seeding, stopped)");
case TR_SEEDS: return tr("Seeds", "i.e. full sources (often untranslated)");
case TR_PEERS: return tr("Peers", "i.e. partial sources (often untranslated)");
case TR_DLSPEED: return tr("Down Speed", "i.e: Download speed");
@@ -180,7 +180,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation
case TR_AMOUNT_DOWNLOADED_SESSION: return tr("Session Download", "Amount of data downloaded since program open (e.g. in MB)");
case TR_AMOUNT_UPLOADED_SESSION: return tr("Session Upload", "Amount of data uploaded since program open (e.g. in MB)");
case TR_AMOUNT_LEFT: return tr("Remaining", "Amount of data left to download (e.g. in MB)");
case TR_TIME_ELAPSED: return tr("Time Active", "Time (duration) the torrent is active (not paused)");
case TR_TIME_ELAPSED: return tr("Time Active", "Time (duration) the torrent is active (not stopped)");
case TR_SAVE_PATH: return tr("Save Path", "Torrent save path");
case TR_DOWNLOAD_PATH: return tr("Incomplete Save Path", "Torrent incomplete save path");
case TR_COMPLETED: return tr("Completed", "Amount of data completed (e.g. in MB)");
@@ -235,8 +235,8 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons
bool hideValues = false;
if (m_hideZeroValuesMode == HideZeroValuesMode::Always)
hideValues = true;
else if (m_hideZeroValuesMode == HideZeroValuesMode::Paused)
hideValues = (torrent->state() == BitTorrent::TorrentState::PausedDownloading);
else if (m_hideZeroValuesMode == HideZeroValuesMode::Stopped)
hideValues = (torrent->state() == BitTorrent::TorrentState::StoppedDownloading);
const auto availabilityString = [hideValues](const qreal value) -> QString
{
@@ -683,7 +683,7 @@ void TransferListModel::configure()
if (pref->getHideZeroValues())
{
if (pref->getHideZeroComboValues() == 1)
hideZeroValuesMode = HideZeroValuesMode::Paused;
hideZeroValuesMode = HideZeroValuesMode::Stopped;
else
hideZeroValuesMode = HideZeroValuesMode::Always;
}
@@ -705,7 +705,7 @@ void TransferListModel::loadUIThemeResources()
m_downloadingIcon = themeManager->getIcon(u"downloading"_s);
m_errorIcon = themeManager->getIcon(u"error"_s);
m_movingIcon = themeManager->getIcon(u"set-location"_s);
m_pausedIcon = themeManager->getIcon(u"stopped"_s, u"media-playback-pause"_s);
m_stoppedIcon = themeManager->getIcon(u"stopped"_s, u"media-playback-pause"_s);
m_queuedIcon = themeManager->getIcon(u"queued"_s);
m_stalledDLIcon = themeManager->getIcon(u"stalledDL"_s);
m_stalledUPIcon = themeManager->getIcon(u"stalledUP"_s);
@@ -728,9 +728,9 @@ QIcon TransferListModel::getIconByState(const BitTorrent::TorrentState state) co
case BitTorrent::TorrentState::Uploading:
case BitTorrent::TorrentState::ForcedUploading:
return m_uploadingIcon;
case BitTorrent::TorrentState::PausedDownloading:
return m_pausedIcon;
case BitTorrent::TorrentState::PausedUploading:
case BitTorrent::TorrentState::StoppedDownloading:
return m_stoppedIcon;
case BitTorrent::TorrentState::StoppedUploading:
return m_completedIcon;
case BitTorrent::TorrentState::QueuedDownloading:
case BitTorrent::TorrentState::QueuedUploading:

View File

@@ -128,7 +128,7 @@ private:
enum class HideZeroValuesMode
{
Never,
Paused,
Stopped,
Always
};
@@ -140,7 +140,7 @@ private:
QIcon m_downloadingIcon;
QIcon m_errorIcon;
QIcon m_movingIcon;
QIcon m_pausedIcon;
QIcon m_stoppedIcon;
QIcon m_queuedIcon;
QIcon m_stalledDLIcon;
QIcon m_stalledUPIcon;

View File

@@ -293,11 +293,11 @@ void TransferListWidget::torrentDoubleClicked()
switch (action)
{
case TOGGLE_PAUSE:
if (torrent->isPaused())
torrent->resume();
case TOGGLE_STOP:
if (torrent->isStopped())
torrent->start();
else
torrent->pause();
torrent->stop();
break;
case PREVIEW_FILE:
if (torrentContainsPreviewableFiles(torrent))
@@ -376,66 +376,66 @@ void TransferListWidget::setSelectedTorrentsLocation()
fileDialog->open();
}
void TransferListWidget::pauseAllTorrents()
void TransferListWidget::stopAllTorrents()
{
if (Preferences::instance()->confirmPauseAndResumeAll())
{
// Show confirmation if user would really like to Pause All
const QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm pause")
, tr("Would you like to pause all torrents?"), (QMessageBox::Yes | QMessageBox::No));
// Show confirmation if user would really like to Stop All
const QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm stop all torrents")
, tr("Would you like to stop all torrents?"), (QMessageBox::Yes | QMessageBox::No));
if (ret != QMessageBox::Yes)
return;
}
for (BitTorrent::Torrent *const torrent : asConst(BitTorrent::Session::instance()->torrents()))
torrent->pause();
torrent->stop();
}
void TransferListWidget::resumeAllTorrents()
void TransferListWidget::startAllTorrents()
{
if (Preferences::instance()->confirmPauseAndResumeAll())
{
// Show confirmation if user would really like to Resume All
const QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm resume")
, tr("Would you like to resume all torrents?"), (QMessageBox::Yes | QMessageBox::No));
// Show confirmation if user would really like to Start All
const QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Confirm start all torrents")
, tr("Would you like to start all torrents?"), (QMessageBox::Yes | QMessageBox::No));
if (ret != QMessageBox::Yes)
return;
}
for (BitTorrent::Torrent *const torrent : asConst(BitTorrent::Session::instance()->torrents()))
torrent->resume();
torrent->start();
}
void TransferListWidget::startSelectedTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
torrent->resume();
torrent->start();
}
void TransferListWidget::forceStartSelectedTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
torrent->resume(BitTorrent::TorrentOperatingMode::Forced);
torrent->start(BitTorrent::TorrentOperatingMode::Forced);
}
void TransferListWidget::startVisibleTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getVisibleTorrents()))
torrent->resume();
torrent->start();
}
void TransferListWidget::pauseSelectedTorrents()
void TransferListWidget::stopSelectedTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
torrent->pause();
torrent->stop();
}
void TransferListWidget::pauseVisibleTorrents()
void TransferListWidget::stopVisibleTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getVisibleTorrents()))
torrent->pause();
torrent->stop();
}
void TransferListWidget::softDeleteSelectedTorrents()
@@ -972,11 +972,11 @@ void TransferListWidget::displayListMenu()
// Create actions
auto *actionStart = new QAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("&Resume", "Resume/start the torrent"), listMenu);
auto *actionStart = new QAction(UIThemeManager::instance()->getIcon(u"torrent-start"_s, u"media-playback-start"_s), tr("&Start", "Resume/start the torrent"), listMenu);
connect(actionStart, &QAction::triggered, this, &TransferListWidget::startSelectedTorrents);
auto *actionPause = new QAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("&Pause", "Pause the torrent"), listMenu);
connect(actionPause, &QAction::triggered, this, &TransferListWidget::pauseSelectedTorrents);
auto *actionForceStart = new QAction(UIThemeManager::instance()->getIcon(u"torrent-start-forced"_s, u"media-playback-start"_s), tr("Force Resu&me", "Force Resume/start the torrent"), listMenu);
auto *actionStop = new QAction(UIThemeManager::instance()->getIcon(u"torrent-stop"_s, u"media-playback-pause"_s), tr("Sto&p", "Stop the torrent"), listMenu);
connect(actionStop, &QAction::triggered, this, &TransferListWidget::stopSelectedTorrents);
auto *actionForceStart = new QAction(UIThemeManager::instance()->getIcon(u"torrent-start-forced"_s, u"media-playback-start"_s), tr("Force Star&t", "Force Resume/start the torrent"), listMenu);
connect(actionForceStart, &QAction::triggered, this, &TransferListWidget::forceStartSelectedTorrents);
auto *actionDelete = new QAction(UIThemeManager::instance()->getIcon(u"list-remove"_s), tr("&Remove", "Remove the torrent"), listMenu);
connect(actionDelete, &QAction::triggered, this, &TransferListWidget::softDeleteSelectedTorrents);
@@ -1029,8 +1029,8 @@ void TransferListWidget::displayListMenu()
connect(actionExportTorrent, &QAction::triggered, this, &TransferListWidget::exportTorrent);
// End of actions
// Enable/disable pause/start action given the DL state
bool needsPause = false, needsStart = false, needsForce = false, needsPreview = false;
// Enable/disable stop/start action given the DL state
bool needsStop = false, needsStart = false, needsForce = false, needsPreview = false;
bool allSameSuperSeeding = true;
bool superSeedingMode = false;
bool allSameSequentialDownloadMode = true, allSamePrioFirstlast = true;
@@ -1048,10 +1048,9 @@ void TransferListWidget::displayListMenu()
for (const QModelIndex &index : selectedIndexes)
{
// Get the file name
// Get handle and pause the torrent
const BitTorrent::Torrent *torrent = m_listModel->torrentHandle(mapToSource(index));
if (!torrent) continue;
if (!torrent)
continue;
if (firstCategory.isEmpty() && first)
firstCategory = torrent->category();
@@ -1108,11 +1107,11 @@ void TransferListWidget::displayListMenu()
else
needsStart = true;
const bool isPaused = torrent->isPaused();
if (isPaused)
const bool isStopped = torrent->isStopped();
if (isStopped)
needsStart = true;
else
needsPause = true;
needsStop = true;
if (torrent->isErrored() || torrent->hasMissingFiles())
{
@@ -1136,17 +1135,17 @@ void TransferListWidget::displayListMenu()
if (rechecking)
{
needsStart = true;
needsPause = true;
needsStop = true;
}
const bool queued = (BitTorrent::Session::instance()->isQueueingSystemEnabled() && torrent->isQueued());
if (!isPaused && !rechecking && !queued)
if (!isStopped && !rechecking && !queued)
oneCanForceReannounce = true;
if (oneHasMetadata && oneNotFinished && !allSameSequentialDownloadMode
&& !allSamePrioFirstlast && !allSameSuperSeeding && !allSameCategory
&& needsStart && needsForce && needsPause && needsPreview && !allSameAutoTMM
&& needsStart && needsForce && needsStop && needsPreview && !allSameAutoTMM
&& hasInfohashV1 && hasInfohashV2 && oneCanForceReannounce)
{
break;
@@ -1155,8 +1154,8 @@ void TransferListWidget::displayListMenu()
if (needsStart)
listMenu->addAction(actionStart);
if (needsPause)
listMenu->addAction(actionPause);
if (needsStop)
listMenu->addAction(actionStop);
if (needsForce)
listMenu->addAction(actionForceStart);
listMenu->addSeparator();
@@ -1268,12 +1267,12 @@ void TransferListWidget::displayListMenu()
listMenu->addSeparator();
if (oneHasMetadata)
listMenu->addAction(actionForceRecheck);
// We can not force reannounce torrents that are paused/errored/checking/missing files/queued.
// We can not force reannounce torrents that are stopped/errored/checking/missing files/queued.
// We may already have the tracker list from magnet url. So we can force reannounce torrents without metadata anyway.
listMenu->addAction(actionForceReannounce);
actionForceReannounce->setEnabled(oneCanForceReannounce);
if (!oneCanForceReannounce)
actionForceReannounce->setToolTip(tr("Can not force reannounce if torrent is Paused/Queued/Errored/Checking"));
actionForceReannounce->setToolTip(tr("Can not force reannounce if torrent is Stopped/Queued/Errored/Checking"));
listMenu->addSeparator();
listMenu->addAction(actionOpenDestinationFolder);
if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && oneNotFinished)

View File

@@ -68,13 +68,13 @@ public slots:
void removeSelectionTag(const Tag &tag);
void clearSelectionTags();
void setSelectedTorrentsLocation();
void pauseAllTorrents();
void resumeAllTorrents();
void stopAllTorrents();
void startAllTorrents();
void startSelectedTorrents();
void forceStartSelectedTorrents();
void startVisibleTorrents();
void pauseSelectedTorrents();
void pauseVisibleTorrents();
void stopSelectedTorrents();
void stopVisibleTorrents();
void softDeleteSelectedTorrents();
void permDeleteSelectedTorrents();
void deleteSelectedTorrents(bool deleteLocalFiles);

View File

@@ -76,8 +76,8 @@ inline QHash<QString, UIThemeColor> defaultUIThemeColors()
{u"TransferList.CheckingDownloading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
{u"TransferList.CheckingUploading"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
{u"TransferList.CheckingResumeData"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
{u"TransferList.PausedDownloading"_s, {Color::Primer::Light::fgMuted, Color::Primer::Dark::fgMuted}},
{u"TransferList.PausedUploading"_s, {Color::Primer::Light::doneFg, Color::Primer::Dark::doneFg}},
{u"TransferList.StoppedDownloading"_s, {Color::Primer::Light::fgMuted, Color::Primer::Dark::fgMuted}},
{u"TransferList.StoppedUploading"_s, {Color::Primer::Light::doneFg, Color::Primer::Dark::doneFg}},
{u"TransferList.Moving"_s, {Color::Primer::Light::successFg, Color::Primer::Dark::successFg}},
{u"TransferList.MissingFiles"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}},
{u"TransferList.Error"_s, {Color::Primer::Light::dangerFg, Color::Primer::Dark::dangerFg}}
@@ -132,6 +132,8 @@ inline QSet<QString> defaultUIThemeIcons()
u"network-connect"_s,
u"network-server"_s,
u"object-locked"_s,
u"pause-session"_s,
u"paused"_s,
u"peers"_s,
u"peers-add"_s,
u"peers-remove"_s,