Add setting to ignore slow torrents in queueing system

Closes https://bugs.launchpad.net/qbittorrent/+bug/799703
This commit is contained in:
Christophe Dumez
2011-09-18 19:34:29 +03:00
parent 9e5ec56770
commit 94f92aa4f9
40 changed files with 1287 additions and 1111 deletions

View File

@@ -170,7 +170,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-176</y>
<y>0</y>
<width>485</width>
<height>632</height>
</rect>
@@ -970,7 +970,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>443</width>
<width>485</width>
<height>506</height>
</rect>
</property>
@@ -1414,7 +1414,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>384</width>
<width>485</width>
<height>440</height>
</rect>
</property>
@@ -1825,9 +1825,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-67</y>
<width>530</width>
<height>444</height>
<height>471</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
@@ -2093,6 +2093,13 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="checkIgnoreSlowTorrentsForQueueing">
<property name="text">
<string>Do not count slow torrents in these limits</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -2576,8 +2583,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>98</width>
<height>28</height>
<width>502</width>
<height>366</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36"/>

View File

@@ -215,6 +215,7 @@ options_imp::options_imp(QWidget *parent):
connect(spinMaxActiveDownloads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxActiveUploads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxActiveTorrents, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkIgnoreSlowTorrentsForQueueing, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
// Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton()));
@@ -457,6 +458,7 @@ void options_imp::saveOptions(){
pref.setMaxActiveDownloads(spinMaxActiveDownloads->value());
pref.setMaxActiveUploads(spinMaxActiveUploads->value());
pref.setMaxActiveTorrents(spinMaxActiveTorrents->value());
pref.setIgnoreSlowTorrentsForQueueing(checkIgnoreSlowTorrentsForQueueing->isChecked());
// End Queueing system preferences
// Web UI
pref.setWebUiEnabled(isWebUiEnabled());
@@ -720,6 +722,7 @@ void options_imp::loadOptions(){
spinMaxActiveDownloads->setValue(pref.getMaxActiveDownloads());
spinMaxActiveUploads->setValue(pref.getMaxActiveUploads());
spinMaxActiveTorrents->setValue(pref.getMaxActiveTorrents());
checkIgnoreSlowTorrentsForQueueing->setChecked(pref.ignoreSlowTorrentsForQueueing());
// End Queueing system preferences
// Web UI
checkWebUi->setChecked(pref.isWebUiEnabled());

View File

@@ -709,6 +709,14 @@ public:
setValue(QString::fromUtf8("Preferences/Queueing/MaxActiveTorrents"), val);
}
void setIgnoreSlowTorrentsForQueueing(bool ignore) {
setValue("Preferences/Queueing/IgnoreSlowTorrents", ignore);
}
bool ignoreSlowTorrentsForQueueing() const {
return value("Preferences/Queueing/IgnoreSlowTorrents", false).toBool();
}
bool isWebUiEnabled() const {
return value("Preferences/WebUI/Enabled", false).toBool();
}