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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
70 changed files with 413 additions and 391 deletions

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