diff --git a/src/app/application.cpp b/src/app/application.cpp index bfb925915..4fb84e734 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -140,8 +140,8 @@ namespace if (!addTorrentParams.savePath.isEmpty()) result.append(u"@savePath=" + addTorrentParams.savePath.data()); - if (addTorrentParams.addPaused.has_value()) - result.append(*addTorrentParams.addPaused ? u"@addPaused=1"_s : u"@addPaused=0"_s); + if (addTorrentParams.addStopped.has_value()) + result.append(*addTorrentParams.addStopped ? u"@addStopped=1"_s : u"@addStopped=0"_s); if (addTorrentParams.skipChecking) result.append(u"@skipChecking"_s); @@ -180,9 +180,9 @@ namespace continue; } - if (param.startsWith(u"@addPaused=")) + if (param.startsWith(u"@addStopped=")) { - addTorrentParams.addPaused = (QStringView(param).mid(11).toInt() != 0); + addTorrentParams.addStopped = (QStringView(param).mid(11).toInt() != 0); continue; } diff --git a/src/app/cmdoptions.cpp b/src/app/cmdoptions.cpp index 582426044..12492359d 100644 --- a/src/app/cmdoptions.cpp +++ b/src/app/cmdoptions.cpp @@ -263,8 +263,8 @@ namespace } throw CommandLineParameterError(QCoreApplication::translate("CMD Options", "Parameter '%1' must follow syntax '%1=%2'", - "e.g. Parameter '--add-paused' must follow syntax " - "'--add-paused='") + "e.g. Parameter '--add-stopped' must follow syntax " + "'--add-stopped='") .arg(fullParameter(), u""_s)); } @@ -318,7 +318,7 @@ namespace constexpr const StringOption CONFIGURATION_OPTION {"configuration"}; constexpr const BoolOption RELATIVE_FASTRESUME {"relative-fastresume"}; constexpr const StringOption SAVE_PATH_OPTION {"save-path"}; - constexpr const TriStateBoolOption PAUSED_OPTION {"add-paused", true}; + constexpr const TriStateBoolOption STOPPED_OPTION {"add-stopped", true}; constexpr const BoolOption SKIP_HASH_CHECK_OPTION {"skip-hash-check"}; constexpr const StringOption CATEGORY_OPTION {"category"}; constexpr const BoolOption SEQUENTIAL_OPTION {"sequential"}; @@ -345,7 +345,7 @@ QBtCommandLineParameters::QBtCommandLineParameters(const QProcessEnvironment &en addTorrentParams.skipChecking = SKIP_HASH_CHECK_OPTION.value(env); addTorrentParams.sequential = SEQUENTIAL_OPTION.value(env); addTorrentParams.firstLastPiecePriority = FIRST_AND_LAST_OPTION.value(env); - addTorrentParams.addPaused = PAUSED_OPTION.value(env); + addTorrentParams.addStopped = STOPPED_OPTION.value(env); } QBtCommandLineParameters parseCommandLine(const QStringList &args) @@ -417,9 +417,9 @@ QBtCommandLineParameters parseCommandLine(const QStringList &args) { result.addTorrentParams.savePath = Path(SAVE_PATH_OPTION.value(arg)); } - else if (arg == PAUSED_OPTION) + else if (arg == STOPPED_OPTION) { - result.addTorrentParams.addPaused = PAUSED_OPTION.value(arg); + result.addTorrentParams.addStopped = STOPPED_OPTION.value(arg); } else if (arg == SKIP_HASH_CHECK_OPTION) { @@ -523,7 +523,7 @@ QString makeUsage(const QString &prgName) + wrapText(QCoreApplication::translate("CMD Options", "Options when adding new torrents:"), 0) + u'\n' + SAVE_PATH_OPTION.usage(QCoreApplication::translate("CMD Options", "path")) + wrapText(QCoreApplication::translate("CMD Options", "Torrent save path")) + u'\n' - + PAUSED_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Add torrents as started or paused")) + u'\n' + + STOPPED_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Add torrents as running or stopped")) + u'\n' + SKIP_HASH_CHECK_OPTION.usage() + wrapText(QCoreApplication::translate("CMD Options", "Skip hash check")) + u'\n' + CATEGORY_OPTION.usage(QCoreApplication::translate("CMD Options", "name")) + wrapText(QCoreApplication::translate("CMD Options", "Assign torrents to category. If the category doesn't exist, it will be " diff --git a/src/app/upgrade.cpp b/src/app/upgrade.cpp index 45d129dcf..5a9d9b896 100644 --- a/src/app/upgrade.cpp +++ b/src/app/upgrade.cpp @@ -46,7 +46,7 @@ namespace { - const int MIGRATION_VERSION = 7; + const int MIGRATION_VERSION = 8; const QString MIGRATION_VERSION_KEY = u"Meta/MigrationVersion"_s; void exportWebUIHttpsFiles() @@ -468,6 +468,16 @@ namespace settingsStorage->removeValue(oldKey); } + + void migrateAddPausedSetting() + { + auto *settingsStorage = SettingsStorage::instance(); + const auto oldKey = u"BitTorrent/Session/AddTorrentPaused"_s; + const auto newKey = u"BitTorrent/Session/AddTorrentStopped"_s; + + settingsStorage->storeValue(newKey, settingsStorage->loadValue(oldKey)); + settingsStorage->removeValue(oldKey); + } } bool upgrade() @@ -509,6 +519,9 @@ bool upgrade() if (version < 7) migrateShareLimitActionSettings(); + if (version < 8) + migrateAddPausedSetting(); + version = MIGRATION_VERSION; } diff --git a/src/base/bittorrent/addtorrentparams.cpp b/src/base/bittorrent/addtorrentparams.cpp index 8784c047e..d284b36d3 100644 --- a/src/base/bittorrent/addtorrentparams.cpp +++ b/src/base/bittorrent/addtorrentparams.cpp @@ -116,7 +116,7 @@ BitTorrent::AddTorrentParams BitTorrent::parseAddTorrentParams(const QJsonObject .downloadPath = Path(jsonObj.value(PARAM_DOWNLOADPATH).toString()), .addForced = (getEnum(jsonObj, PARAM_OPERATINGMODE) == TorrentOperatingMode::Forced), .addToQueueTop = getOptionalBool(jsonObj, PARAM_QUEUETOP), - .addPaused = getOptionalBool(jsonObj, PARAM_STOPPED), + .addStopped = getOptionalBool(jsonObj, PARAM_STOPPED), .stopCondition = getOptionalEnum(jsonObj, PARAM_STOPCONDITION), .filePaths = {}, .filePriorities = {}, @@ -163,8 +163,8 @@ QJsonObject BitTorrent::serializeAddTorrentParams(const AddTorrentParams ¶ms if (params.addToQueueTop) jsonObj[PARAM_QUEUETOP] = *params.addToQueueTop; - if (params.addPaused) - jsonObj[PARAM_STOPPED] = *params.addPaused; + if (params.addStopped) + jsonObj[PARAM_STOPPED] = *params.addStopped; if (params.stopCondition) jsonObj[PARAM_STOPCONDITION] = Utils::String::fromEnum(*params.stopCondition); if (params.contentLayout) diff --git a/src/base/bittorrent/addtorrentparams.h b/src/base/bittorrent/addtorrentparams.h index 60107d122..b1b5fcb2b 100644 --- a/src/base/bittorrent/addtorrentparams.h +++ b/src/base/bittorrent/addtorrentparams.h @@ -59,7 +59,7 @@ namespace BitTorrent bool firstLastPiecePriority = false; bool addForced = false; std::optional addToQueueTop; - std::optional addPaused; + std::optional addStopped; std::optional stopCondition; PathList filePaths; // used if TorrentInfo is set QVector filePriorities; // used if TorrentInfo is set diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 3cb6b36d8..300fd4eb8 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -213,8 +213,8 @@ namespace BitTorrent virtual void setPeXEnabled(bool enabled) = 0; virtual bool isAddTorrentToQueueTop() const = 0; virtual void setAddTorrentToQueueTop(bool value) = 0; - virtual bool isAddTorrentPaused() const = 0; - virtual void setAddTorrentPaused(bool value) = 0; + virtual bool isAddTorrentStopped() const = 0; + virtual void setAddTorrentStopped(bool value) = 0; virtual Torrent::StopCondition torrentStopCondition() const = 0; virtual void setTorrentStopCondition(Torrent::StopCondition stopCondition) = 0; virtual TorrentContentLayout torrentContentLayout() const = 0; @@ -476,8 +476,8 @@ namespace BitTorrent void torrentFinished(Torrent *torrent); void torrentFinishedChecking(Torrent *torrent); void torrentMetadataReceived(Torrent *torrent); - void torrentPaused(Torrent *torrent); - void torrentResumed(Torrent *torrent); + void torrentStopped(Torrent *torrent); + void torrentStarted(Torrent *torrent); void torrentSavePathChanged(Torrent *torrent); void torrentSavingModeChanged(Torrent *torrent); void torrentsLoaded(const QVector &torrents); diff --git a/src/base/bittorrent/sessionimpl.cpp b/src/base/bittorrent/sessionimpl.cpp index 8f156f733..7550c996a 100644 --- a/src/base/bittorrent/sessionimpl.cpp +++ b/src/base/bittorrent/sessionimpl.cpp @@ -461,7 +461,7 @@ SessionImpl::SessionImpl(QObject *parent) , m_globalMaxSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxSeedingMinutes"_s), -1, lowerLimited(-1)) , m_globalMaxInactiveSeedingMinutes(BITTORRENT_SESSION_KEY(u"GlobalMaxInactiveSeedingMinutes"_s), -1, lowerLimited(-1)) , m_isAddTorrentToQueueTop(BITTORRENT_SESSION_KEY(u"AddTorrentToTopOfQueue"_s), false) - , m_isAddTorrentPaused(BITTORRENT_SESSION_KEY(u"AddTorrentPaused"_s), false) + , m_isAddTorrentStopped(BITTORRENT_SESSION_KEY(u"AddTorrentStopped"_s), false) , m_torrentStopCondition(BITTORRENT_SESSION_KEY(u"TorrentStopCondition"_s), Torrent::StopCondition::None) , m_torrentContentLayout(BITTORRENT_SESSION_KEY(u"TorrentContentLayout"_s), TorrentContentLayout::Original) , m_isAppendExtensionEnabled(BITTORRENT_SESSION_KEY(u"AddExtensionToIncompleteFiles"_s), false) @@ -1114,14 +1114,14 @@ void SessionImpl::setAddTorrentToQueueTop(bool value) m_isAddTorrentToQueueTop = value; } -bool SessionImpl::isAddTorrentPaused() const +bool SessionImpl::isAddTorrentStopped() const { - return m_isAddTorrentPaused; + return m_isAddTorrentStopped; } -void SessionImpl::setAddTorrentPaused(const bool value) +void SessionImpl::setAddTorrentStopped(const bool value) { - m_isAddTorrentPaused = value; + m_isAddTorrentStopped = value; } Torrent::StopCondition SessionImpl::torrentStopCondition() const @@ -2274,12 +2274,12 @@ void SessionImpl::processShareLimits() LogMsg(u"%1 %2 %3"_s.arg(description, tr("Removing torrent and deleting its content."), torrentName)); deleteTorrent(torrentID, DeleteTorrentAndFiles); } - else if ((shareLimitAction == ShareLimitAction::Stop) && !torrent->isPaused()) + else if ((shareLimitAction == ShareLimitAction::Stop) && !torrent->isStopped()) { - torrent->pause(); - LogMsg(u"%1 %2 %3"_s.arg(description, tr("Torrent paused."), torrentName)); + torrent->stop(); + LogMsg(u"%1 %2 %3"_s.arg(description, tr("Torrent stopped."), torrentName)); } - else if ((shareLimitAction == ShareLimitAction::EnableSuperSeeding) && !torrent->isPaused() && !torrent->superSeeding()) + else if ((shareLimitAction == ShareLimitAction::EnableSuperSeeding) && !torrent->isStopped() && !torrent->superSeeding()) { torrent->setSuperSeeding(true); LogMsg(u"%1 %2 %3"_s.arg(description, tr("Super seeding enabled."), torrentName)); @@ -2596,7 +2596,7 @@ LoadTorrentParams SessionImpl::initLoadTorrentParams(const AddTorrentParams &add loadTorrentParams.hasFinishedStatus = addTorrentParams.skipChecking; // do not react on 'torrent_finished_alert' when skipping loadTorrentParams.contentLayout = addTorrentParams.contentLayout.value_or(torrentContentLayout()); loadTorrentParams.operatingMode = (addTorrentParams.addForced ? TorrentOperatingMode::Forced : TorrentOperatingMode::AutoManaged); - loadTorrentParams.stopped = addTorrentParams.addPaused.value_or(isAddTorrentPaused()); + loadTorrentParams.stopped = addTorrentParams.addStopped.value_or(isAddTorrentStopped()); loadTorrentParams.stopCondition = addTorrentParams.stopCondition.value_or(torrentStopCondition()); loadTorrentParams.addToQueueTop = addTorrentParams.addToQueueTop.value_or(isAddTorrentToQueueTop()); loadTorrentParams.ratioLimit = addTorrentParams.ratioLimit; @@ -4896,7 +4896,7 @@ void SessionImpl::handleTorrentMetadataReceived(TorrentImpl *const torrent) emit torrentMetadataReceived(torrent); } -void SessionImpl::handleTorrentPaused(TorrentImpl *const torrent) +void SessionImpl::handleTorrentStopped(TorrentImpl *const torrent) { torrent->resetTrackerEntries(); @@ -4907,14 +4907,14 @@ void SessionImpl::handleTorrentPaused(TorrentImpl *const torrent) updatedTrackerEntries.emplace(trackerEntry.url, trackerEntry); emit trackerEntriesUpdated(torrent, updatedTrackerEntries); - LogMsg(tr("Torrent paused. Torrent: \"%1\"").arg(torrent->name())); - emit torrentPaused(torrent); + LogMsg(tr("Torrent stopped. Torrent: \"%1\"").arg(torrent->name())); + emit torrentStopped(torrent); } -void SessionImpl::handleTorrentResumed(TorrentImpl *const torrent) +void SessionImpl::handleTorrentStarted(TorrentImpl *const torrent) { LogMsg(tr("Torrent resumed. Torrent: \"%1\"").arg(torrent->name())); - emit torrentResumed(torrent); + emit torrentStarted(torrent); } void SessionImpl::handleTorrentChecked(TorrentImpl *const torrent) @@ -4932,7 +4932,7 @@ void SessionImpl::handleTorrentFinished(TorrentImpl *const torrent) const bool hasUnfinishedTorrents = std::any_of(m_torrents.cbegin(), m_torrents.cend(), [](const TorrentImpl *torrent) { - return !(torrent->isFinished() || torrent->isPaused() || torrent->isErrored()); + return !(torrent->isFinished() || torrent->isStopped() || torrent->isErrored()); }); if (!hasUnfinishedTorrents) emit allTorrentsFinished(); @@ -6151,7 +6151,7 @@ void SessionImpl::updateTrackerEntries(lt::torrent_handle torrentHandle, QHashisPaused()) + if (!torrent || torrent->isStopped()) return; QHash updatedTrackerEntries; diff --git a/src/base/bittorrent/sessionimpl.h b/src/base/bittorrent/sessionimpl.h index bed9f8b33..9b503ed4d 100644 --- a/src/base/bittorrent/sessionimpl.h +++ b/src/base/bittorrent/sessionimpl.h @@ -189,8 +189,8 @@ namespace BitTorrent void setPeXEnabled(bool enabled) override; bool isAddTorrentToQueueTop() const override; void setAddTorrentToQueueTop(bool value) override; - bool isAddTorrentPaused() const override; - void setAddTorrentPaused(bool value) override; + bool isAddTorrentStopped() const override; + void setAddTorrentStopped(bool value) override; Torrent::StopCondition torrentStopCondition() const override; void setTorrentStopCondition(Torrent::StopCondition stopCondition) override; TorrentContentLayout torrentContentLayout() const override; @@ -439,8 +439,8 @@ namespace BitTorrent void handleTorrentTagRemoved(TorrentImpl *torrent, const Tag &tag); void handleTorrentSavingModeChanged(TorrentImpl *torrent); void handleTorrentMetadataReceived(TorrentImpl *torrent); - void handleTorrentPaused(TorrentImpl *torrent); - void handleTorrentResumed(TorrentImpl *torrent); + void handleTorrentStopped(TorrentImpl *torrent); + void handleTorrentStarted(TorrentImpl *torrent); void handleTorrentChecked(TorrentImpl *torrent); void handleTorrentFinished(TorrentImpl *torrent); void handleTorrentTrackersAdded(TorrentImpl *torrent, const QVector &newTrackers); @@ -663,7 +663,7 @@ namespace BitTorrent CachedSettingValue m_globalMaxSeedingMinutes; CachedSettingValue m_globalMaxInactiveSeedingMinutes; CachedSettingValue m_isAddTorrentToQueueTop; - CachedSettingValue m_isAddTorrentPaused; + CachedSettingValue m_isAddTorrentStopped; CachedSettingValue m_torrentStopCondition; CachedSettingValue m_torrentContentLayout; CachedSettingValue m_isAppendExtensionEnabled; diff --git a/src/base/bittorrent/torrent.cpp b/src/base/bittorrent/torrent.cpp index c9ed27bfb..c92fb9aea 100644 --- a/src/base/bittorrent/torrent.cpp +++ b/src/base/bittorrent/torrent.cpp @@ -60,9 +60,9 @@ namespace BitTorrent return infoHash().toTorrentID(); } - bool Torrent::isResumed() const + bool Torrent::isRunning() const { - return !isPaused(); + return !isStopped(); } qlonglong Torrent::remainingSize() const diff --git a/src/base/bittorrent/torrent.h b/src/base/bittorrent/torrent.h index 8ac33b7bb..14d2ab7bf 100644 --- a/src/base/bittorrent/torrent.h +++ b/src/base/bittorrent/torrent.h @@ -94,8 +94,8 @@ namespace BitTorrent CheckingUploading, CheckingDownloading, - PausedDownloading, - PausedUploading, + StoppedDownloading, + StoppedUploading, Moving, @@ -228,7 +228,7 @@ namespace BitTorrent virtual TorrentInfo info() const = 0; virtual bool isFinished() const = 0; - virtual bool isPaused() const = 0; + virtual bool isStopped() const = 0; virtual bool isQueued() const = 0; virtual bool isForced() const = 0; virtual bool isChecking() const = 0; @@ -290,8 +290,8 @@ namespace BitTorrent virtual void setName(const QString &name) = 0; virtual void setSequentialDownload(bool enable) = 0; virtual void setFirstLastPiecePriority(bool enabled) = 0; - virtual void pause() = 0; - virtual void resume(TorrentOperatingMode mode = TorrentOperatingMode::AutoManaged) = 0; + virtual void stop() = 0; + virtual void start(TorrentOperatingMode mode = TorrentOperatingMode::AutoManaged) = 0; virtual void forceReannounce(int index = -1) = 0; virtual void forceDHTAnnounce() = 0; virtual void forceRecheck() = 0; @@ -325,7 +325,7 @@ namespace BitTorrent virtual void fetchDownloadingPieces(std::function resultHandler) const = 0; TorrentID id() const; - bool isResumed() const; + bool isRunning() const; qlonglong remainingSize() const; void toggleSequentialDownload(); diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 1ef806e09..2a688f9a5 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -981,15 +981,15 @@ TorrentInfo TorrentImpl::info() const return m_torrentInfo; } -bool TorrentImpl::isPaused() const +bool TorrentImpl::isStopped() const { return m_isStopped; } bool TorrentImpl::isQueued() const { - // Torrent is Queued if it isn't in Paused state but paused internally - return (!isPaused() + // Torrent is Queued if it isn't in Stopped state but paused internally + return (!isStopped() && (m_nativeStatus.flags & lt::torrent_flags::auto_managed) && (m_nativeStatus.flags & lt::torrent_flags::paused)); } @@ -1009,7 +1009,7 @@ bool TorrentImpl::isDownloading() const case TorrentState::ForcedDownloadingMetadata: case TorrentState::StalledDownloading: case TorrentState::CheckingDownloading: - case TorrentState::PausedDownloading: + case TorrentState::StoppedDownloading: case TorrentState::QueuedDownloading: case TorrentState::ForcedDownloading: return true; @@ -1049,7 +1049,7 @@ bool TorrentImpl::isCompleted() const case TorrentState::Uploading: case TorrentState::StalledUploading: case TorrentState::CheckingUploading: - case TorrentState::PausedUploading: + case TorrentState::StoppedUploading: case TorrentState::QueuedUploading: case TorrentState::ForcedUploading: return true; @@ -1102,7 +1102,7 @@ bool TorrentImpl::isFinished() const bool TorrentImpl::isForced() const { - return (!isPaused() && (m_operatingMode == TorrentOperatingMode::Forced)); + return (!isStopped() && (m_operatingMode == TorrentOperatingMode::Forced)); } bool TorrentImpl::isSequentialDownload() const @@ -1140,22 +1140,22 @@ void TorrentImpl::updateState() } else if (!hasMetadata()) { - if (isPaused()) - m_state = TorrentState::PausedDownloading; + if (isStopped()) + m_state = TorrentState::StoppedDownloading; else if (m_session->isQueueingSystemEnabled() && isQueued()) m_state = TorrentState::QueuedDownloading; else m_state = isForced() ? TorrentState::ForcedDownloadingMetadata : TorrentState::DownloadingMetadata; } - else if ((m_nativeStatus.state == lt::torrent_status::checking_files) && !isPaused()) + else if ((m_nativeStatus.state == lt::torrent_status::checking_files) && !isStopped()) { // If the torrent is not just in the "checking" state, but is being actually checked m_state = m_hasFinishedStatus ? TorrentState::CheckingUploading : TorrentState::CheckingDownloading; } else if (isFinished()) { - if (isPaused()) - m_state = TorrentState::PausedUploading; + if (isStopped()) + m_state = TorrentState::StoppedUploading; else if (m_session->isQueueingSystemEnabled() && isQueued()) m_state = TorrentState::QueuedUploading; else if (isForced()) @@ -1167,8 +1167,8 @@ void TorrentImpl::updateState() } else { - if (isPaused()) - m_state = TorrentState::PausedDownloading; + if (isStopped()) + m_state = TorrentState::StoppedDownloading; else if (m_session->isQueueingSystemEnabled() && isQueued()) m_state = TorrentState::QueuedDownloading; else if (isForced()) @@ -1236,7 +1236,7 @@ qlonglong TorrentImpl::finishedTime() const qlonglong TorrentImpl::eta() const { - if (isPaused()) return MAX_ETA; + if (isStopped()) return MAX_ETA; const SpeedSampleAvg speedAverage = m_payloadRateMonitor.average(); @@ -1499,14 +1499,14 @@ qreal TorrentImpl::realRatio() const int TorrentImpl::uploadPayloadRate() const { - // workaround: suppress the speed for paused state - return isPaused() ? 0 : m_nativeStatus.upload_payload_rate; + // workaround: suppress the speed for Stopped state + return isStopped() ? 0 : m_nativeStatus.upload_payload_rate; } int TorrentImpl::downloadPayloadRate() const { - // workaround: suppress the speed for paused state - return isPaused() ? 0 : m_nativeStatus.download_payload_rate; + // workaround: suppress the speed for Stopped state + return isStopped() ? 0 : m_nativeStatus.download_payload_rate; } qlonglong TorrentImpl::totalPayloadUpload() const @@ -1597,10 +1597,10 @@ void TorrentImpl::forceRecheck() m_nativeStatus.pieces.clear_all(); m_nativeStatus.num_pieces = 0; - if (isPaused()) + if (isStopped()) { - // When "force recheck" is applied on paused torrent, we temporarily resume it - resume(); + // When "force recheck" is applied on Stopped torrent, we start them to perform checking + start(); m_stopCondition = StopCondition::FilesChecked; } } @@ -1768,7 +1768,7 @@ void TorrentImpl::endReceivedMetadataHandling(const Path &savePath, const PathLi p.flags |= lt::torrent_flags::paused; p.flags &= ~lt::torrent_flags::auto_managed; - m_session->handleTorrentPaused(this); + m_session->handleTorrentStopped(this); } reload(); @@ -1836,14 +1836,14 @@ void TorrentImpl::reload() } } -void TorrentImpl::pause() +void TorrentImpl::stop() { if (!m_isStopped) { m_stopCondition = StopCondition::None; m_isStopped = true; deferredRequestResumeData(); - m_session->handleTorrentPaused(this); + m_session->handleTorrentStopped(this); } if (m_maintenanceJob == MaintenanceJob::None) @@ -1855,7 +1855,7 @@ void TorrentImpl::pause() } } -void TorrentImpl::resume(const TorrentOperatingMode mode) +void TorrentImpl::start(const TorrentOperatingMode mode) { if (hasError()) { @@ -1878,7 +1878,7 @@ void TorrentImpl::resume(const TorrentOperatingMode mode) { m_isStopped = false; deferredRequestResumeData(); - m_session->handleTorrentResumed(this); + m_session->handleTorrentStarted(this); } if (m_maintenanceJob == MaintenanceJob::None) @@ -1967,7 +1967,7 @@ void TorrentImpl::handleTorrentCheckedAlert([[maybe_unused]] const lt::torrent_c } if (stopCondition() == StopCondition::FilesChecked) - pause(); + stop(); m_statusUpdatedTriggers.enqueue([this]() { @@ -1983,7 +1983,7 @@ void TorrentImpl::handleTorrentCheckedAlert([[maybe_unused]] const lt::torrent_c adjustStorageLocation(); manageActualFilePaths(); - if (!isPaused()) + if (!isStopped()) { // torrent is internally paused using NativeTorrentExtension after files checked // so we need to resume it if there is no corresponding "stop condition" set @@ -2468,7 +2468,7 @@ void TorrentImpl::setStopCondition(const StopCondition stopCondition) if (stopCondition == m_stopCondition) return; - if (isPaused()) + if (isStopped()) return; if ((stopCondition == StopCondition::MetadataReceived) && hasMetadata()) diff --git a/src/base/bittorrent/torrentimpl.h b/src/base/bittorrent/torrentimpl.h index 636bf7f25..8b0d4450d 100644 --- a/src/base/bittorrent/torrentimpl.h +++ b/src/base/bittorrent/torrentimpl.h @@ -157,7 +157,7 @@ namespace BitTorrent TorrentInfo info() const override; bool isFinished() const override; - bool isPaused() const override; + bool isStopped() const override; bool isQueued() const override; bool isForced() const override; bool isChecking() const override; @@ -222,8 +222,8 @@ namespace BitTorrent void setName(const QString &name) override; void setSequentialDownload(bool enable) override; void setFirstLastPiecePriority(bool enabled) override; - void pause() override; - void resume(TorrentOperatingMode mode = TorrentOperatingMode::AutoManaged) override; + void stop() override; + void start(TorrentOperatingMode mode = TorrentOperatingMode::AutoManaged) override; void forceReannounce(int index = -1) override; void forceDHTAnnounce() override; void forceRecheck() override; diff --git a/src/base/rss/rss_autodownloadrule.cpp b/src/base/rss/rss_autodownloadrule.cpp index b4637cf43..3a8265c23 100644 --- a/src/base/rss/rss_autodownloadrule.cpp +++ b/src/base/rss/rss_autodownloadrule.cpp @@ -468,7 +468,7 @@ QJsonObject AutoDownloadRule::toJsonObject() const // TODO: The following code is deprecated. Replace with the commented one after several releases in 4.6.x. // === BEGIN DEPRECATED CODE === // - , {S_ADD_PAUSED, toJsonValue(addTorrentParams.addPaused)} + , {S_ADD_PAUSED, toJsonValue(addTorrentParams.addStopped)} , {S_CONTENT_LAYOUT, contentLayoutToJsonValue(addTorrentParams.contentLayout)} , {S_SAVE_PATH, addTorrentParams.savePath.toString()} , {S_ASSIGNED_CATEGORY, addTorrentParams.category} @@ -525,7 +525,7 @@ AutoDownloadRule AutoDownloadRule::fromJsonObject(const QJsonObject &jsonObj, co { addTorrentParams.savePath = Path(jsonObj.value(S_SAVE_PATH).toString()); addTorrentParams.category = jsonObj.value(S_ASSIGNED_CATEGORY).toString(); - addTorrentParams.addPaused = toOptionalBool(jsonObj.value(S_ADD_PAUSED)); + addTorrentParams.addStopped = toOptionalBool(jsonObj.value(S_ADD_PAUSED)); if (!addTorrentParams.savePath.isEmpty()) addTorrentParams.useAutoTMM = false; @@ -568,7 +568,7 @@ QVariantHash AutoDownloadRule::toLegacyDict() const {u"enabled"_s, isEnabled()}, {u"category_assigned"_s, addTorrentParams.category}, {u"use_regex"_s, useRegex()}, - {u"add_paused"_s, toAddPausedLegacy(addTorrentParams.addPaused)}, + {u"add_paused"_s, toAddPausedLegacy(addTorrentParams.addStopped)}, {u"episode_filter"_s, episodeFilter()}, {u"last_match"_s, lastMatch()}, {u"ignore_days"_s, ignoreDays()}}; @@ -579,7 +579,7 @@ AutoDownloadRule AutoDownloadRule::fromLegacyDict(const QVariantHash &dict) BitTorrent::AddTorrentParams addTorrentParams; addTorrentParams.savePath = Path(dict.value(u"save_path"_s).toString()); addTorrentParams.category = dict.value(u"category_assigned"_s).toString(); - addTorrentParams.addPaused = addPausedLegacyToOptionalBool(dict.value(u"add_paused"_s).toInt()); + addTorrentParams.addStopped = addPausedLegacyToOptionalBool(dict.value(u"add_paused"_s).toInt()); if (!addTorrentParams.savePath.isEmpty()) addTorrentParams.useAutoTMM = false; diff --git a/src/base/torrentfilter.cpp b/src/base/torrentfilter.cpp index bcfd03c24..8a2331eb1 100644 --- a/src/base/torrentfilter.cpp +++ b/src/base/torrentfilter.cpp @@ -38,8 +38,8 @@ const std::optional TorrentFilter::AnyTag; const TorrentFilter TorrentFilter::DownloadingTorrent(TorrentFilter::Downloading); const TorrentFilter TorrentFilter::SeedingTorrent(TorrentFilter::Seeding); const TorrentFilter TorrentFilter::CompletedTorrent(TorrentFilter::Completed); -const TorrentFilter TorrentFilter::PausedTorrent(TorrentFilter::Paused); -const TorrentFilter TorrentFilter::ResumedTorrent(TorrentFilter::Resumed); +const TorrentFilter TorrentFilter::StoppedTorrent(TorrentFilter::Stopped); +const TorrentFilter TorrentFilter::RunningTorrent(TorrentFilter::Running); const TorrentFilter TorrentFilter::ActiveTorrent(TorrentFilter::Active); const TorrentFilter TorrentFilter::InactiveTorrent(TorrentFilter::Inactive); const TorrentFilter TorrentFilter::StalledTorrent(TorrentFilter::Stalled); @@ -90,10 +90,10 @@ bool TorrentFilter::setTypeByName(const QString &filter) type = Seeding; else if (filter == u"completed") type = Completed; - else if (filter == u"paused") - type = Paused; - else if (filter == u"resumed") - type = Resumed; + else if (filter == u"stopped") + type = Stopped; + else if (filter == u"running") + type = Running; else if (filter == u"active") type = Active; else if (filter == u"inactive") @@ -167,10 +167,10 @@ bool TorrentFilter::matchState(const BitTorrent::Torrent *const torrent) const return torrent->isUploading(); case Completed: return torrent->isCompleted(); - case Paused: - return torrent->isPaused(); - case Resumed: - return torrent->isResumed(); + case Stopped: + return torrent->isStopped(); + case Running: + return torrent->isRunning(); case Active: return torrent->isActive(); case Inactive: diff --git a/src/base/torrentfilter.h b/src/base/torrentfilter.h index 004db3649..f9701e2d6 100644 --- a/src/base/torrentfilter.h +++ b/src/base/torrentfilter.h @@ -52,8 +52,8 @@ public: Downloading, Seeding, Completed, - Resumed, - Paused, + Running, + Stopped, Active, Inactive, Stalled, @@ -72,8 +72,8 @@ public: static const TorrentFilter DownloadingTorrent; static const TorrentFilter SeedingTorrent; static const TorrentFilter CompletedTorrent; - static const TorrentFilter PausedTorrent; - static const TorrentFilter ResumedTorrent; + static const TorrentFilter StoppedTorrent; + static const TorrentFilter RunningTorrent; static const TorrentFilter ActiveTorrent; static const TorrentFilter InactiveTorrent; static const TorrentFilter StalledTorrent; diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index f9c6862de..c586481fe 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -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(); m_torrentParams.contentLayout = static_cast(m_ui->contentLayoutComboBox->currentIndex()); diff --git a/src/gui/addtorrentparamswidget.cpp b/src/gui/addtorrentparamswidget.cpp index 38b4bbd23..dd5203dd2 100644 --- a/src/gui/addtorrentparamswidget.cpp +++ b/src/gui/addtorrentparamswidget.cpp @@ -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); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 74e46c1cf..8058957e4 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -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 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(); diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index c4e717899..383d9ac14 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -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(); diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index 1a44708cd..61d456159 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -43,9 +43,9 @@ &Edit - + - + @@ -153,7 +153,7 @@ - + @@ -188,22 +188,22 @@ - &Resume + Sta&rt - + - &Pause + Sto&p - R&esume All + Star&t All - + - P&ause All + &Stop All diff --git a/src/gui/optionsdialog.cpp b/src/gui/optionsdialog.cpp index c442f29e7..dd3520a56 100644 --- a/src/gui/optionsdialog.cpp +++ b/src/gui/optionsdialog.cpp @@ -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(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"

" + tr("None") + u" - " + tr("No stop condition is set.") + u"

" + @@ -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(m_ui->contentLayoutComboBox->currentIndex())); session->setAddTorrentToQueueTop(m_ui->checkAddToQueueTop->isChecked()); - session->setAddTorrentPaused(addTorrentsInPause()); + session->setAddTorrentStopped(addTorrentsStopped()); session->setTorrentStopCondition(m_ui->stopConditionComboBox->currentData().value()); 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 diff --git a/src/gui/optionsdialog.h b/src/gui/optionsdialog.h index 9fd26dafa..6cb66ea05 100644 --- a/src/gui/optionsdialog.h +++ b/src/gui/optionsdialog.h @@ -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 diff --git a/src/gui/optionsdialog.ui b/src/gui/optionsdialog.ui index 87ea70f39..4d044e113 100644 --- a/src/gui/optionsdialog.ui +++ b/src/gui/optionsdialog.ui @@ -227,12 +227,12 @@ - + - Shows a confirmation dialog upon pausing/resuming all the torrents + Shows a confirmation dialog upon pausing/starting all the torrents - Confirm "Pause/Resume all" actions + Confirm "Stop/Start all" actions true @@ -267,7 +267,7 @@ - Paused torrents only + Stopped torrents only @@ -925,12 +925,12 @@ - + - The torrent will be added to download list in a paused state + The torrent will be added to download list in a stopped state - Do not start the download automatically + Do not start the download automatically @@ -3043,7 +3043,7 @@ Disable encryption: Only connect to peers without protocol encryption - Pause torrent + Stop torrent @@ -3897,7 +3897,7 @@ Use ';' to split multiple entries. Can use wildcard '*'. comboI18n checkUseCustomTheme customThemeFilePath - checkStartPaused + checkAddStopped stopConditionComboBox spinPort checkUPnP diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 3d7a9fca4..b70df143c 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -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); diff --git a/src/gui/properties/propertieswidget.ui b/src/gui/properties/propertieswidget.ui index 2dcae04c2..c973a4ea6 100644 --- a/src/gui/properties/propertieswidget.ui +++ b/src/gui/properties/propertieswidget.ui @@ -546,7 +546,7 @@ - Time Active: + Time Active: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/src/gui/search/pluginselectdialog.cpp b/src/gui/search/pluginselectdialog.cpp index f549ec410..90ed7fced 100644 --- a/src/gui/search/pluginselectdialog.cpp +++ b/src/gui/search/pluginselectdialog.cpp @@ -169,9 +169,9 @@ void PluginSelectDialog::togglePluginState(QTreeWidgetItem *item, int) void PluginSelectDialog::displayContextMenu() { - // Enable/disable pause/start action given the DL state const QList items = m_ui->pluginsTree->selectedItems(); - if (items.isEmpty()) return; + if (items.isEmpty()) + return; QMenu *myContextMenu = new QMenu(this); myContextMenu->setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/gui/trackerlist/trackerlistwidget.cpp b/src/gui/trackerlist/trackerlistwidget.cpp index 0cc73898d..1e43bd92e 100644 --- a/src/gui/trackerlist/trackerlistwidget.cpp +++ b/src/gui/trackerlist/trackerlistwidget.cpp @@ -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") diff --git a/src/gui/transferlistdelegate.cpp b/src/gui/transferlistdelegate.cpp index dc21654d7..e08cb7ef8 100644 --- a/src/gui/transferlistdelegate.cpp +++ b/src/gui/transferlistdelegate.cpp @@ -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: diff --git a/src/gui/transferlistfilters/categoryfilterwidget.cpp b/src/gui/transferlistfilters/categoryfilterwidget.cpp index 655b5ffbd..49bab70c4 100644 --- a/src/gui/transferlistfilters/categoryfilterwidget.cpp +++ b/src/gui/transferlistfilters/categoryfilterwidget.cpp @@ -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); diff --git a/src/gui/transferlistfilters/categoryfilterwidget.h b/src/gui/transferlistfilters/categoryfilterwidget.h index 6ca759b95..d340d9337 100644 --- a/src/gui/transferlistfilters/categoryfilterwidget.h +++ b/src/gui/transferlistfilters/categoryfilterwidget.h @@ -42,8 +42,8 @@ public: signals: void categoryChanged(const QString &categoryName); - void actionResumeTorrentsTriggered(); - void actionPauseTorrentsTriggered(); + void actionStartTorrentsTriggered(); + void actionStopTorrentsTriggered(); void actionDeleteTorrentsTriggered(); private slots: diff --git a/src/gui/transferlistfilters/statusfilterwidget.cpp b/src/gui/transferlistfilters/statusfilterwidget.cpp index 99b00af76..0cbee461c 100644 --- a/src/gui/transferlistfilters/statusfilterwidget.cpp +++ b/src/gui/transferlistfilters/statusfilterwidget.cpp @@ -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]) diff --git a/src/gui/transferlistfilters/statusfilterwidget.h b/src/gui/transferlistfilters/statusfilterwidget.h index ac1bbd5a5..2c9a4bfda 100644 --- a/src/gui/transferlistfilters/statusfilterwidget.h +++ b/src/gui/transferlistfilters/statusfilterwidget.h @@ -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; diff --git a/src/gui/transferlistfilters/tagfilterwidget.cpp b/src/gui/transferlistfilters/tagfilterwidget.cpp index d5882e49c..934995b15 100644 --- a/src/gui/transferlistfilters/tagfilterwidget.cpp +++ b/src/gui/transferlistfilters/tagfilterwidget.cpp @@ -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); diff --git a/src/gui/transferlistfilters/tagfilterwidget.h b/src/gui/transferlistfilters/tagfilterwidget.h index 7a8165d36..e7ee2c0c1 100644 --- a/src/gui/transferlistfilters/tagfilterwidget.h +++ b/src/gui/transferlistfilters/tagfilterwidget.h @@ -45,8 +45,8 @@ public: signals: void tagChanged(const std::optional &tag); - void actionResumeTorrentsTriggered(); - void actionPauseTorrentsTriggered(); + void actionStartTorrentsTriggered(); + void actionStopTorrentsTriggered(); void actionDeleteTorrentsTriggered(); private slots: diff --git a/src/gui/transferlistfilters/trackersfilterwidget.cpp b/src/gui/transferlistfilters/trackersfilterwidget.cpp index 2e8586f28..289f502a4 100644 --- a/src/gui/transferlistfilters/trackersfilterwidget.cpp +++ b/src/gui/transferlistfilters/trackersfilterwidget.cpp @@ -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); diff --git a/src/gui/transferlistfilterswidget.cpp b/src/gui/transferlistfilterswidget.cpp index 53d4d60af..de9be9447 100644 --- a/src/gui/transferlistfilterswidget.cpp +++ b/src/gui/transferlistfilterswidget.cpp @@ -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); diff --git a/src/gui/transferlistmodel.cpp b/src/gui/transferlistmodel.cpp index dc1dc21f1..1870dc05d 100644 --- a/src/gui/transferlistmodel.cpp +++ b/src/gui/transferlistmodel.cpp @@ -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: diff --git a/src/gui/transferlistmodel.h b/src/gui/transferlistmodel.h index 73458ddec..2f00d1339 100644 --- a/src/gui/transferlistmodel.h +++ b/src/gui/transferlistmodel.h @@ -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; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 5c06a3c15..c97445907 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -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) diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index 6b1505a6d..fc2610f46 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -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); diff --git a/src/gui/uithemecommon.h b/src/gui/uithemecommon.h index acc3263f3..31ae5a456 100644 --- a/src/gui/uithemecommon.h +++ b/src/gui/uithemecommon.h @@ -76,8 +76,8 @@ inline QHash 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 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, diff --git a/src/icons/icons.qrc b/src/icons/icons.qrc index 16c1777d6..6200dd68f 100644 --- a/src/icons/icons.qrc +++ b/src/icons/icons.qrc @@ -314,6 +314,8 @@ network-connect.svg network-server.svg object-locked.svg + pause-session.svg + paused.svg peers-add.svg peers-remove.svg peers.svg diff --git a/src/icons/pause-session.svg b/src/icons/pause-session.svg new file mode 100644 index 000000000..6a6f574f0 --- /dev/null +++ b/src/icons/pause-session.svg @@ -0,0 +1 @@ + diff --git a/src/icons/paused.svg b/src/icons/paused.svg new file mode 100644 index 000000000..06140f883 --- /dev/null +++ b/src/icons/paused.svg @@ -0,0 +1 @@ + diff --git a/src/icons/stopped.svg b/src/icons/stopped.svg index 06140f883..c113984d1 100644 --- a/src/icons/stopped.svg +++ b/src/icons/stopped.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/icons/torrent-stop.svg b/src/icons/torrent-stop.svg index 6a6f574f0..a5ebe582b 100644 --- a/src/icons/torrent-stop.svg +++ b/src/icons/torrent-stop.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/webui/api/appcontroller.cpp b/src/webui/api/appcontroller.cpp index 06d6b54c7..21252239e 100644 --- a/src/webui/api/appcontroller.cpp +++ b/src/webui/api/appcontroller.cpp @@ -139,7 +139,7 @@ void AppController::preferencesAction() // When adding a torrent data[u"torrent_content_layout"_s] = Utils::String::fromEnum(session->torrentContentLayout()); data[u"add_to_top_of_queue"_s] = session->isAddTorrentToQueueTop(); - data[u"start_paused_enabled"_s] = session->isAddTorrentPaused(); + data[u"add_stopped_enabled"_s] = session->isAddTorrentStopped(); data[u"torrent_stop_condition"_s] = Utils::String::fromEnum(session->torrentStopCondition()); data[u"merge_trackers"_s] = session->isMergeTrackersEnabled(); data[u"auto_delete_mode"_s] = static_cast(TorrentFileGuard::autoDeleteMode()); @@ -524,8 +524,8 @@ void AppController::setPreferencesAction() session->setTorrentContentLayout(Utils::String::toEnum(it.value().toString(), BitTorrent::TorrentContentLayout::Original)); if (hasKey(u"add_to_top_of_queue"_s)) session->setAddTorrentToQueueTop(it.value().toBool()); - if (hasKey(u"start_paused_enabled"_s)) - session->setAddTorrentPaused(it.value().toBool()); + if (hasKey(u"add_stopped_enabled"_s)) + session->setAddTorrentStopped(it.value().toBool()); if (hasKey(u"torrent_stop_condition"_s)) session->setTorrentStopCondition(Utils::String::toEnum(it.value().toString(), BitTorrent::Torrent::StopCondition::None)); if (hasKey(u"merge_trackers"_s)) diff --git a/src/webui/api/serialize/serialize_torrent.cpp b/src/webui/api/serialize/serialize_torrent.cpp index 35d733e9c..cd94a022f 100644 --- a/src/webui/api/serialize/serialize_torrent.cpp +++ b/src/webui/api/serialize/serialize_torrent.cpp @@ -51,10 +51,10 @@ namespace return u"missingFiles"_s; case BitTorrent::TorrentState::Uploading: return u"uploading"_s; - case BitTorrent::TorrentState::PausedUploading: - return u"pausedUP"_s; + case BitTorrent::TorrentState::StoppedUploading: + return u"stoppedUP"_s; case BitTorrent::TorrentState::QueuedUploading: - return u"queuedUP"_s; + return u"stoppedUP"_s; case BitTorrent::TorrentState::StalledUploading: return u"stalledUP"_s; case BitTorrent::TorrentState::CheckingUploading: @@ -67,8 +67,8 @@ namespace return u"metaDL"_s; case BitTorrent::TorrentState::ForcedDownloadingMetadata: return u"forcedMetaDL"_s; - case BitTorrent::TorrentState::PausedDownloading: - return u"pausedDL"_s; + case BitTorrent::TorrentState::StoppedDownloading: + return u"stoppedDL"_s; case BitTorrent::TorrentState::QueuedDownloading: return u"queuedDL"_s; case BitTorrent::TorrentState::StalledDownloading: diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp index cb26a38fb..648cb99ea 100644 --- a/src/webui/api/synccontroller.cpp +++ b/src/webui/api/synccontroller.cpp @@ -474,8 +474,8 @@ void SyncController::maindataAction() connect(btSession, &BitTorrent::Session::torrentAboutToBeRemoved, this, &SyncController::onTorrentAboutToBeRemoved); connect(btSession, &BitTorrent::Session::torrentCategoryChanged, this, &SyncController::onTorrentCategoryChanged); connect(btSession, &BitTorrent::Session::torrentMetadataReceived, this, &SyncController::onTorrentMetadataReceived); - connect(btSession, &BitTorrent::Session::torrentPaused, this, &SyncController::onTorrentPaused); - connect(btSession, &BitTorrent::Session::torrentResumed, this, &SyncController::onTorrentResumed); + connect(btSession, &BitTorrent::Session::torrentStopped, this, &SyncController::onTorrentStopped); + connect(btSession, &BitTorrent::Session::torrentStarted, this, &SyncController::onTorrentStarted); connect(btSession, &BitTorrent::Session::torrentSavePathChanged, this, &SyncController::onTorrentSavePathChanged); connect(btSession, &BitTorrent::Session::torrentSavingModeChanged, this, &SyncController::onTorrentSavingModeChanged); connect(btSession, &BitTorrent::Session::torrentTagAdded, this, &SyncController::onTorrentTagAdded); @@ -882,12 +882,12 @@ void SyncController::onTorrentMetadataReceived(BitTorrent::Torrent *torrent) m_updatedTorrents.insert(torrent->id()); } -void SyncController::onTorrentPaused(BitTorrent::Torrent *torrent) +void SyncController::onTorrentStopped(BitTorrent::Torrent *torrent) { m_updatedTorrents.insert(torrent->id()); } -void SyncController::onTorrentResumed(BitTorrent::Torrent *torrent) +void SyncController::onTorrentStarted(BitTorrent::Torrent *torrent) { m_updatedTorrents.insert(torrent->id()); } diff --git a/src/webui/api/synccontroller.h b/src/webui/api/synccontroller.h index da0b085f3..d8f0eb4c8 100644 --- a/src/webui/api/synccontroller.h +++ b/src/webui/api/synccontroller.h @@ -71,8 +71,8 @@ private: void onTorrentAboutToBeRemoved(BitTorrent::Torrent *torrent); void onTorrentCategoryChanged(BitTorrent::Torrent *torrent, const QString &oldCategory); void onTorrentMetadataReceived(BitTorrent::Torrent *torrent); - void onTorrentPaused(BitTorrent::Torrent *torrent); - void onTorrentResumed(BitTorrent::Torrent *torrent); + void onTorrentStopped(BitTorrent::Torrent *torrent); + void onTorrentStarted(BitTorrent::Torrent *torrent); void onTorrentSavePathChanged(BitTorrent::Torrent *torrent); void onTorrentSavingModeChanged(BitTorrent::Torrent *torrent); void onTorrentTagAdded(BitTorrent::Torrent *torrent, const Tag &tag); diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index ec94daa26..fb0768d85 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -276,7 +276,7 @@ void TorrentsController::countAction() // - "force_start": Torrent force start state // - "category": Torrent category // GET params: -// - filter (string): all, downloading, seeding, completed, paused, resumed, active, inactive, stalled, stalled_uploading, stalled_downloading +// - filter (string): all, downloading, seeding, completed, stopped, running, active, inactive, stalled, stalled_uploading, stalled_downloading // - category (string): torrent category for filtering by it (empty string means "uncategorized"; no "category" param presented means "any category") // - tag (string): torrent tag for filtering by it (empty string means "untagged"; no "tag" param presented means "any tag") // - hashes (string): filter by hashes, can contain multiple hashes separated by | @@ -685,7 +685,7 @@ void TorrentsController::addAction() const bool seqDownload = parseBool(params()[u"sequentialDownload"_s]).value_or(false); const bool firstLastPiece = parseBool(params()[u"firstLastPiecePrio"_s]).value_or(false); const std::optional addToQueueTop = parseBool(params()[u"addToTopOfQueue"_s]); - const std::optional addPaused = parseBool(params()[u"paused"_s]); + const std::optional addStopped = parseBool(params()[u"stopped"_s]); const QString savepath = params()[u"savepath"_s].trimmed(); const QString downloadPath = params()[u"downloadPath"_s].trimmed(); const std::optional useDownloadPath = parseBool(params()[u"useDownloadPath"_s]); @@ -740,7 +740,7 @@ void TorrentsController::addAction() .firstLastPiecePriority = firstLastPiece, .addForced = false, .addToQueueTop = addToQueueTop, - .addPaused = addPaused, + .addStopped = addStopped, .stopCondition = stopCondition, .filePaths = {}, .filePriorities = {}, @@ -841,7 +841,7 @@ void TorrentsController::editTrackerAction() torrent->replaceTrackers(trackers); - if (!torrent->isPaused()) + if (!torrent->isStopped()) torrent->forceReannounce(); } @@ -857,7 +857,7 @@ void TorrentsController::removeTrackersAction() const QStringList urls = params()[u"urls"_s].split(u'|'); torrent->removeTrackers(urls); - if (!torrent->isPaused()) + if (!torrent->isStopped()) torrent->forceReannounce(); } @@ -899,20 +899,20 @@ void TorrentsController::addPeersAction() setResult(results); } -void TorrentsController::pauseAction() +void TorrentsController::stopAction() { requireParams({u"hashes"_s}); const QStringList hashes = params()[u"hashes"_s].split(u'|'); - applyToTorrents(hashes, [](BitTorrent::Torrent *const torrent) { torrent->pause(); }); + applyToTorrents(hashes, [](BitTorrent::Torrent *const torrent) { torrent->stop(); }); } -void TorrentsController::resumeAction() +void TorrentsController::startAction() { requireParams({u"hashes"_s}); const QStringList idStrings = params()[u"hashes"_s].split(u'|'); - applyToTorrents(idStrings, [](BitTorrent::Torrent *const torrent) { torrent->resume(); }); + applyToTorrents(idStrings, [](BitTorrent::Torrent *const torrent) { torrent->start(); }); } void TorrentsController::filePrioAction() @@ -1066,7 +1066,7 @@ void TorrentsController::setForceStartAction() const QStringList hashes {params()[u"hashes"_s].split(u'|')}; applyToTorrents(hashes, [value](BitTorrent::Torrent *const torrent) { - torrent->resume(value ? BitTorrent::TorrentOperatingMode::Forced : BitTorrent::TorrentOperatingMode::AutoManaged); + torrent->start(value ? BitTorrent::TorrentOperatingMode::Forced : BitTorrent::TorrentOperatingMode::AutoManaged); }); } diff --git a/src/webui/api/torrentscontroller.h b/src/webui/api/torrentscontroller.h index 03cc286fc..d731b0de8 100644 --- a/src/webui/api/torrentscontroller.h +++ b/src/webui/api/torrentscontroller.h @@ -47,8 +47,8 @@ private slots: void filesAction(); void pieceHashesAction(); void pieceStatesAction(); - void resumeAction(); - void pauseAction(); + void startAction(); + void stopAction(); void recheckAction(); void reannounceAction(); void renameAction(); diff --git a/src/webui/webapplication.h b/src/webui/webapplication.h index 2c01b5b2b..b14ce770f 100644 --- a/src/webui/webapplication.h +++ b/src/webui/webapplication.h @@ -54,7 +54,7 @@ #include "base/utils/version.h" #include "api/isessionmanager.h" -inline const Utils::Version<3, 2> API_VERSION {2, 10, 4}; +inline const Utils::Version<3, 2> API_VERSION {2, 11, 0}; class QTimer; @@ -177,6 +177,7 @@ private: {{u"torrents"_s, u"addPeers"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"addTags"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"addTrackers"_s}, Http::METHOD_POST}, + {{u"transfer"_s, u"banPeers"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"bottomPrio"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"createCategory"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"createTags"_s}, Http::METHOD_POST}, @@ -187,7 +188,6 @@ private: {{u"torrents"_s, u"editTracker"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"filePrio"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"increasePrio"_s}, Http::METHOD_POST}, - {{u"torrents"_s, u"pause"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"reannounce"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"recheck"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"removeCategories"_s}, Http::METHOD_POST}, @@ -196,7 +196,6 @@ private: {{u"torrents"_s, u"rename"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"renameFile"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"renameFolder"_s}, Http::METHOD_POST}, - {{u"torrents"_s, u"resume"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"setAutoManagement"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"setCategory"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"setDownloadLimit"_s}, Http::METHOD_POST}, @@ -208,14 +207,15 @@ private: {{u"torrents"_s, u"setSSLParameters"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"setSuperSeeding"_s}, Http::METHOD_POST}, {{u"torrents"_s, u"setUploadLimit"_s}, Http::METHOD_POST}, - {{u"torrents"_s, u"toggleFirstLastPiecePrio"_s}, Http::METHOD_POST}, - {{u"torrents"_s, u"toggleSequentialDownload"_s}, Http::METHOD_POST}, - {{u"torrents"_s, u"topPrio"_s}, Http::METHOD_POST}, - {{u"transfer"_s, u"banPeers"_s}, Http::METHOD_POST}, {{u"transfer"_s, u"setDownloadLimit"_s}, Http::METHOD_POST}, {{u"transfer"_s, u"setSpeedLimitsMode"_s}, Http::METHOD_POST}, {{u"transfer"_s, u"setUploadLimit"_s}, Http::METHOD_POST}, + {{u"torrents"_s, u"start"_s}, Http::METHOD_POST}, + {{u"torrents"_s, u"stop"_s}, Http::METHOD_POST}, + {{u"torrents"_s, u"toggleFirstLastPiecePrio"_s}, Http::METHOD_POST}, + {{u"torrents"_s, u"toggleSequentialDownload"_s}, Http::METHOD_POST}, {{u"transfer"_s, u"toggleSpeedLimitsMode"_s}, Http::METHOD_POST}, + {{u"torrents"_s, u"topPrio"_s}, Http::METHOD_POST}, }; bool m_isAltUIUsed = false; Path m_rootFolder; diff --git a/src/webui/www/private/download.html b/src/webui/www/private/download.html index 6d556fddb..fe5c2acef 100644 --- a/src/webui/www/private/download.html +++ b/src/webui/www/private/download.html @@ -75,7 +75,7 @@ - + diff --git a/src/webui/www/private/images/pause-session.svg b/src/webui/www/private/images/pause-session.svg new file mode 100644 index 000000000..6a6f574f0 --- /dev/null +++ b/src/webui/www/private/images/pause-session.svg @@ -0,0 +1 @@ + diff --git a/src/webui/www/private/images/paused.svg b/src/webui/www/private/images/paused.svg new file mode 100644 index 000000000..06140f883 --- /dev/null +++ b/src/webui/www/private/images/paused.svg @@ -0,0 +1 @@ + diff --git a/src/webui/www/private/images/stopped.svg b/src/webui/www/private/images/stopped.svg index 06140f883..c113984d1 100644 --- a/src/webui/www/private/images/stopped.svg +++ b/src/webui/www/private/images/stopped.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/webui/www/private/images/torrent-stop.svg b/src/webui/www/private/images/torrent-stop.svg index 6a6f574f0..a5ebe582b 100644 --- a/src/webui/www/private/images/torrent-stop.svg +++ b/src/webui/www/private/images/torrent-stop.svg @@ -1 +1 @@ - + \ No newline at end of file diff --git a/src/webui/www/private/index.html b/src/webui/www/private/index.html index 9db96fbca..388a509fd 100644 --- a/src/webui/www/private/index.html +++ b/src/webui/www/private/index.html @@ -64,10 +64,10 @@

  • QBT_TR(Edit)QBT_TR[CONTEXT=MainWindow]
      -
    • QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]QBT_TR(Resume)QBT_TR[CONTEXT=MainWindow]
    • -
    • QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]QBT_TR(Pause)QBT_TR[CONTEXT=MainWindow]
    • -
    • QBT_TR(Resume All)QBT_TR[CONTEXT=MainWindow]QBT_TR(Resume All)QBT_TR[CONTEXT=MainWindow]
    • -
    • QBT_TR(Pause All)QBT_TR[CONTEXT=MainWindow]QBT_TR(Pause All)QBT_TR[CONTEXT=MainWindow]
    • +
    • QBT_TR(Start)QBT_TR[CONTEXT=MainWindow]QBT_TR(Start)QBT_TR[CONTEXT=MainWindow]
    • +
    • QBT_TR(Stop)QBT_TR[CONTEXT=MainWindow]QBT_TR(Stop)QBT_TR[CONTEXT=MainWindow]
    • +
    • QBT_TR(Start All)QBT_TR[CONTEXT=MainWindow]QBT_TR(Start All)QBT_TR[CONTEXT=MainWindow]
    • +
    • QBT_TR(Stop All)QBT_TR[CONTEXT=MainWindow]QBT_TR(Stop All)QBT_TR[CONTEXT=MainWindow]
    • QBT_TR(Remove)QBT_TR[CONTEXT=MainWindow]QBT_TR(Remove)QBT_TR[CONTEXT=MainWindow]
    • QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow]
    • QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow]
    • @@ -110,8 +110,8 @@ QBT_TR(Add Torrent Link...)QBT_TR[CONTEXT=MainWindow] QBT_TR(Add Torrent File...)QBT_TR[CONTEXT=MainWindow] QBT_TR(Remove)QBT_TR[CONTEXT=TransferListWidget] - QBT_TR(Resume)QBT_TR[CONTEXT=TransferListWidget] - QBT_TR(Pause)QBT_TR[CONTEXT=TransferListWidget] + QBT_TR(Start)QBT_TR[CONTEXT=TransferListWidget] + QBT_TR(Stop)QBT_TR[CONTEXT=TransferListWidget] QBT_TR(Top of Queue)QBT_TR[CONTEXT=MainWindow] QBT_TR(Move Up Queue)QBT_TR[CONTEXT=MainWindow] @@ -139,9 +139,9 @@
        diff --git a/src/webui/www/private/scripts/client.js b/src/webui/www/private/scripts/client.js index 93039ab20..1c855f7b9 100644 --- a/src/webui/www/private/scripts/client.js +++ b/src/webui/www/private/scripts/client.js @@ -236,8 +236,8 @@ window.addEventListener("DOMContentLoaded", function() { $("downloading_filter").removeClass("selectedFilter"); $("seeding_filter").removeClass("selectedFilter"); $("completed_filter").removeClass("selectedFilter"); - $("paused_filter").removeClass("selectedFilter"); - $("resumed_filter").removeClass("selectedFilter"); + $("stopped_filter").removeClass("selectedFilter"); + $("running_filter").removeClass("selectedFilter"); $("active_filter").removeClass("selectedFilter"); $("inactive_filter").removeClass("selectedFilter"); $("stalled_filter").removeClass("selectedFilter"); @@ -414,8 +414,8 @@ window.addEventListener("DOMContentLoaded", function() { updateFilter('downloading', 'QBT_TR(Downloading (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); updateFilter('seeding', 'QBT_TR(Seeding (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); updateFilter('completed', 'QBT_TR(Completed (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); - updateFilter('resumed', 'QBT_TR(Resumed (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); - updateFilter('paused', 'QBT_TR(Paused (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); + updateFilter('running', 'QBT_TR(Running (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); + updateFilter('stopped', 'QBT_TR(Stopped (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); updateFilter('active', 'QBT_TR(Active (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); updateFilter('inactive', 'QBT_TR(Inactive (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); updateFilter('stalled', 'QBT_TR(Stalled (%1))QBT_TR[CONTEXT=StatusFilterWidget]'); diff --git a/src/webui/www/private/scripts/contextmenu.js b/src/webui/www/private/scripts/contextmenu.js index e716be9d9..b6ef8b3bb 100644 --- a/src/webui/www/private/scripts/contextmenu.js +++ b/src/webui/www/private/scripts/contextmenu.js @@ -306,8 +306,8 @@ window.qBittorrent.ContextMenu = (function() { let all_are_f_l_piece_prio = true; let there_are_f_l_piece_prio = false; let all_are_downloaded = true; - let all_are_paused = true; - let there_are_paused = false; + let all_are_stopped = true; + let there_are_stopped = false; let all_are_force_start = true; let there_are_force_start = false; let all_are_super_seeding = true; @@ -334,10 +334,10 @@ window.qBittorrent.ContextMenu = (function() { else if (data['super_seeding'] !== true) all_are_super_seeding = false; - if (data['state'] != 'pausedUP' && data['state'] != 'pausedDL') - all_are_paused = false; + if (data['state'] != 'stoppedUP' && data['state'] != 'stoppedDL') + all_are_stopped = false; else - there_are_paused = true; + there_are_stopped = true; if (data['force_start'] !== true) all_are_force_start = false; @@ -406,13 +406,13 @@ window.qBittorrent.ContextMenu = (function() { } this.showItem('start'); - this.showItem('pause'); + this.showItem('stop'); this.showItem('forceStart'); - if (all_are_paused) - this.hideItem('pause'); + if (all_are_stopped) + this.hideItem('stop'); else if (all_are_force_start) this.hideItem('forceStart'); - else if (!there_are_paused && !there_are_force_start) + else if (!there_are_stopped && !there_are_force_start) this.hideItem('start'); if (!all_are_auto_tmm && there_are_auto_tmm) { diff --git a/src/webui/www/private/scripts/download.js b/src/webui/www/private/scripts/download.js index 7e82e493c..b18ff23a1 100644 --- a/src/webui/www/private/scripts/download.js +++ b/src/webui/www/private/scripts/download.js @@ -63,7 +63,7 @@ window.qBittorrent.Download = (function() { defaultSavePath = pref.save_path; $('savepath').setProperty('value', defaultSavePath); - $('startTorrent').checked = !pref.start_paused_enabled; + $('startTorrent').checked = !pref.add_stopped_enabled; $('addToTopOfQueue').checked = pref.add_to_top_of_queue; if (pref.auto_tmm_enabled == 1) { diff --git a/src/webui/www/private/scripts/dynamicTable.js b/src/webui/www/private/scripts/dynamicTable.js index 7f63b8295..d1743f131 100644 --- a/src/webui/www/private/scripts/dynamicTable.js +++ b/src/webui/www/private/scripts/dynamicTable.js @@ -981,11 +981,11 @@ window.qBittorrent.DynamicTable = (function() { state = "stalledDL"; img_path = "images/stalledDL.svg"; break; - case "pausedDL": + case "stoppedDL": state = "torrent-stop"; img_path = "images/stopped.svg"; break; - case "pausedUP": + case "stoppedUP": state = "checked-completed"; img_path = "images/checked-completed.svg"; break; @@ -1075,10 +1075,10 @@ window.qBittorrent.DynamicTable = (function() { case "checkingResumeData": status = "QBT_TR(Checking resume data)QBT_TR[CONTEXT=TransferListDelegate]"; break; - case "pausedDL": - status = "QBT_TR(Paused)QBT_TR[CONTEXT=TransferListDelegate]"; + case "stoppedDL": + status = "QBT_TR(Stopped)QBT_TR[CONTEXT=TransferListDelegate]"; break; - case "pausedUP": + case "stoppedUP": status = "QBT_TR(Completed)QBT_TR[CONTEXT=TransferListDelegate]"; break; case "moving": @@ -1338,12 +1338,12 @@ window.qBittorrent.DynamicTable = (function() { if ((state != 'uploading') && (state.indexOf('UP') === -1)) return false; break; - case 'paused': - if (state.indexOf('paused') === -1) + case 'stopped': + if (state.indexOf('stopped') === -1) return false; break; - case 'resumed': - if (state.indexOf('paused') > -1) + case 'running': + if (state.indexOf('stopped') > -1) return false; break; case 'stalled': @@ -1509,10 +1509,10 @@ window.qBittorrent.DynamicTable = (function() { this._this.selectRow(this.rowId); const row = this._this.rows.get(this.rowId); const state = row['full_data'].state; - if (state.indexOf('paused') > -1) + if (state.indexOf('stopped') > -1) startFN(); else - pauseFN(); + stopFN(); return true; }); tr.addClass("torrentsTableContextMenuTarget"); diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index d46ff1664..0aea9e44a 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -55,7 +55,7 @@ let globalDownloadLimitFN = function() {}; let StatisticsLinkFN = function() {}; let downloadLimitFN = function() {}; let deleteFN = function() {}; -let pauseFN = function() {}; +let stopFN = function() {}; let startFN = function() {}; let autoTorrentManagementFN = function() {}; let recheckFN = function() {}; @@ -71,7 +71,7 @@ let editCategoryFN = function() {}; let removeCategoryFN = function() {}; let deleteUnusedCategoriesFN = function() {}; let startTorrentsByCategoryFN = function() {}; -let pauseTorrentsByCategoryFN = function() {}; +let stopTorrentsByCategoryFN = function() {}; let deleteTorrentsByCategoryFN = function() {}; let torrentAddTagsFN = function() {}; let torrentSetTagsFN = function() {}; @@ -80,10 +80,10 @@ let createTagFN = function() {}; let removeTagFN = function() {}; let deleteUnusedTagsFN = function() {}; let startTorrentsByTagFN = function() {}; -let pauseTorrentsByTagFN = function() {}; +let stopTorrentsByTagFN = function() {}; let deleteTorrentsByTagFN = function() {}; -let resumeTorrentsByTrackerFN = function() {}; -let pauseTorrentsByTrackerFN = function() {}; +let startTorrentsByTrackerFN = function() {}; +let stopTorrentsByTrackerFN = function() {}; let deleteTorrentsByTrackerFN = function() {}; let copyNameFN = function() {}; let copyInfohashFN = function(policy) {}; @@ -405,11 +405,11 @@ const initializeWindows = function() { deleteFN(); }); - pauseFN = function() { + stopFN = function() { const hashes = torrentsTable.selectedRowsIds(); if (hashes.length) { new Request({ - url: 'api/v2/torrents/pause', + url: 'api/v2/torrents/stop', method: 'post', data: { hashes: hashes.join("|") @@ -423,7 +423,7 @@ const initializeWindows = function() { const hashes = torrentsTable.selectedRowsIds(); if (hashes.length) { new Request({ - url: 'api/v2/torrents/resume', + url: 'api/v2/torrents/start', method: 'post', data: { hashes: hashes.join("|") @@ -679,7 +679,7 @@ const initializeWindows = function() { const hashes = torrentsTable.getFilteredTorrentsHashes('all', categoryHash, TAGS_ALL, TRACKERS_ALL); if (hashes.length) { new Request({ - url: 'api/v2/torrents/resume', + url: 'api/v2/torrents/start', method: 'post', data: { hashes: hashes.join("|") @@ -689,11 +689,11 @@ const initializeWindows = function() { } }; - pauseTorrentsByCategoryFN = function(categoryHash) { + stopTorrentsByCategoryFN = function(categoryHash) { const hashes = torrentsTable.getFilteredTorrentsHashes('all', categoryHash, TAGS_ALL, TRACKERS_ALL); if (hashes.length) { new Request({ - url: 'api/v2/torrents/pause', + url: 'api/v2/torrents/stop', method: 'post', data: { hashes: hashes.join("|") @@ -821,7 +821,7 @@ const initializeWindows = function() { const hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, tagHash, TRACKERS_ALL); if (hashes.length) { new Request({ - url: 'api/v2/torrents/resume', + url: 'api/v2/torrents/start', method: 'post', data: { hashes: hashes.join("|") @@ -831,11 +831,11 @@ const initializeWindows = function() { } }; - pauseTorrentsByTagFN = function(tagHash) { + stopTorrentsByTagFN = function(tagHash) { const hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, tagHash, TRACKERS_ALL); if (hashes.length) { new Request({ - url: 'api/v2/torrents/pause', + url: 'api/v2/torrents/stop', method: 'post', data: { hashes: hashes.join("|") @@ -864,7 +864,7 @@ const initializeWindows = function() { } }; - resumeTorrentsByTrackerFN = function(trackerHash) { + startTorrentsByTrackerFN = function(trackerHash) { const trackerHashInt = Number.parseInt(trackerHash, 10); let hashes = []; switch (trackerHashInt) { @@ -881,7 +881,7 @@ const initializeWindows = function() { if (hashes.length > 0) { new Request({ - url: 'api/v2/torrents/resume', + url: 'api/v2/torrents/start', method: 'post', data: { hashes: hashes.join("|") @@ -891,7 +891,7 @@ const initializeWindows = function() { } }; - pauseTorrentsByTrackerFN = function(trackerHash) { + stopTorrentsByTrackerFN = function(trackerHash) { const trackerHashInt = Number.parseInt(trackerHash, 10); let hashes = []; switch (trackerHashInt) { @@ -908,7 +908,7 @@ const initializeWindows = function() { if (hashes.length) { new Request({ - url: 'api/v2/torrents/pause', + url: 'api/v2/torrents/stop', method: 'post', data: { hashes: hashes.join("|") @@ -1047,12 +1047,12 @@ const initializeWindows = function() { } }; - addClickEvent('pauseAll', (e) => { + addClickEvent('stopAll', (e) => { new Event(e).stop(); - if (confirm('QBT_TR(Would you like to pause all torrents?)QBT_TR[CONTEXT=MainWindow]')) { + if (confirm('QBT_TR(Would you like to stop all torrents?)QBT_TR[CONTEXT=MainWindow]')) { new Request({ - url: 'api/v2/torrents/pause', + url: 'api/v2/torrents/stop', method: 'post', data: { hashes: "all" @@ -1062,12 +1062,12 @@ const initializeWindows = function() { } }); - addClickEvent('resumeAll', (e) => { + addClickEvent('startAll', (e) => { new Event(e).stop(); - if (confirm('QBT_TR(Would you like to resume all torrents?)QBT_TR[CONTEXT=MainWindow]')) { + if (confirm('QBT_TR(Would you like to start all torrents?)QBT_TR[CONTEXT=MainWindow]')) { new Request({ - url: 'api/v2/torrents/resume', + url: 'api/v2/torrents/start', method: 'post', data: { hashes: "all" @@ -1077,7 +1077,7 @@ const initializeWindows = function() { } }); - ['pause', 'resume', 'recheck'].each(function(item) { + ['stop', 'start', 'recheck'].each(function(item) { addClickEvent(item, function(e) { new Event(e).stop(); const hashes = torrentsTable.selectedRowsIds(); diff --git a/src/webui/www/private/upload.html b/src/webui/www/private/upload.html index d8f5754ef..ccdbc1124 100644 --- a/src/webui/www/private/upload.html +++ b/src/webui/www/private/upload.html @@ -63,7 +63,7 @@ - + diff --git a/src/webui/www/private/views/filters.html b/src/webui/www/private/views/filters.html index 580815d8e..9b65dfa40 100644 --- a/src/webui/www/private/views/filters.html +++ b/src/webui/www/private/views/filters.html @@ -7,8 +7,8 @@
      • DownloadingQBT_TR(Downloading (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • SeedingQBT_TR(Seeding (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • CompletedQBT_TR(Completed (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • -
      • ResumedQBT_TR(Resumed (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • -
      • PausedQBT_TR(Paused (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • +
      • RunningQBT_TR(Running (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • +
      • StoppedQBT_TR(Stopped (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • ActiveQBT_TR(Active (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • InactiveQBT_TR(Inactive (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • StalledQBT_TR(Stalled (0))QBT_TR[CONTEXT=StatusFilterWidget]
      • @@ -79,8 +79,8 @@ startTorrentsByCategory: function(element, ref) { startTorrentsByCategoryFN(Number(element.id)); }, - pauseTorrentsByCategory: function(element, ref) { - pauseTorrentsByCategoryFN(Number(element.id)); + stopTorrentsByCategory: function(element, ref) { + stopTorrentsByCategoryFN(Number(element.id)); }, deleteTorrentsByCategory: function(element, ref) { deleteTorrentsByCategoryFN(Number(element.id)); @@ -111,8 +111,8 @@ startTorrentsByTag: function(element, ref) { startTorrentsByTagFN(Number(element.id)); }, - pauseTorrentsByTag: function(element, ref) { - pauseTorrentsByTagFN(Number(element.id)); + stopTorrentsByTag: function(element, ref) { + stopTorrentsByTagFN(Number(element.id)); }, deleteTorrentsByTag: function(element, ref) { deleteTorrentsByTagFN(Number(element.id)); @@ -131,11 +131,11 @@ targets: '.trackersFilterContextMenuTarget', menu: 'trackersFilterMenu', actions: { - resumeTorrentsByTracker: function(element, ref) { - resumeTorrentsByTrackerFN(element.id); + startTorrentsByTracker: function(element, ref) { + startTorrentsByTrackerFN(element.id); }, - pauseTorrentsByTracker: function(element, ref) { - pauseTorrentsByTrackerFN(element.id); + stopTorrentsByTracker: function(element, ref) { + stopTorrentsByTrackerFN(element.id); }, deleteTorrentsByTracker: function(element, ref) { deleteTorrentsByTrackerFN(element.id); diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index d9bb0a186..769e26d76 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -705,7 +705,7 @@ +