mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Turn off the scheduler when the user manually changes the rate limits mode.
This commit is contained in:
parent
d0893bc1c7
commit
18b9de831f
@ -356,7 +356,7 @@ void QBtSession::configureSession() {
|
|||||||
}
|
}
|
||||||
bd_scheduler->start();
|
bd_scheduler->start();
|
||||||
} else {
|
} else {
|
||||||
if (bd_scheduler) delete bd_scheduler;
|
delete bd_scheduler;
|
||||||
}
|
}
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
// Resolve countries
|
// Resolve countries
|
||||||
@ -708,6 +708,9 @@ void QBtSession::useAlternativeSpeedsLimit(bool alternative) {
|
|||||||
qDebug() << Q_FUNC_INFO << alternative;
|
qDebug() << Q_FUNC_INFO << alternative;
|
||||||
// Save new state to remember it on startup
|
// Save new state to remember it on startup
|
||||||
Preferences pref;
|
Preferences pref;
|
||||||
|
// Stop the scheduler when the user has manually changed the bandwidth mode
|
||||||
|
if (!pref.isSchedulerEnabled())
|
||||||
|
delete bd_scheduler;
|
||||||
pref.setAltBandwidthEnabled(alternative);
|
pref.setAltBandwidthEnabled(alternative);
|
||||||
// Apply settings to the bittorrent session
|
// Apply settings to the bittorrent session
|
||||||
int down_limit = alternative ? pref.getAltGlobalDownloadLimit() : pref.getGlobalDownloadLimit();
|
int down_limit = alternative ? pref.getAltGlobalDownloadLimit() : pref.getGlobalDownloadLimit();
|
||||||
|
@ -207,7 +207,12 @@ public slots:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void toggleAlternativeSpeeds() {
|
void toggleAlternativeSpeeds() {
|
||||||
QBtSession::instance()->useAlternativeSpeedsLimit(!Preferences().isAltBandwidthEnabled());
|
Preferences pref;
|
||||||
|
if (pref.isSchedulerEnabled()) {
|
||||||
|
pref.setSchedulerEnabled(false);
|
||||||
|
m_bar->showMessage(tr("Manual change of rate limits mode. The scheduler is disabled."), 5000);
|
||||||
|
}
|
||||||
|
QBtSession::instance()->useAlternativeSpeedsLimit(!pref.isAltBandwidthEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
void capDownloadSpeed() {
|
void capDownloadSpeed() {
|
||||||
|
Loading…
Reference in New Issue
Block a user