mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Moved "Transfer list refresh interval" to advanced settings
This commit is contained in:
parent
77239db3c5
commit
1a4f638ff6
5 changed files with 25 additions and 62 deletions
|
@ -8,14 +8,14 @@
|
||||||
#include "preferences.h"
|
#include "preferences.h"
|
||||||
|
|
||||||
enum AdvSettingsCols {PROPERTY, VALUE};
|
enum AdvSettingsCols {PROPERTY, VALUE};
|
||||||
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED };
|
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH };
|
||||||
#define ROW_COUNT 6
|
#define ROW_COUNT 7
|
||||||
|
|
||||||
class AdvancedSettings: public QTableWidget {
|
class AdvancedSettings: public QTableWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max;
|
QSpinBox *spin_cache, *outgoing_ports_min, *outgoing_ports_max, *spin_list_refresh;
|
||||||
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed;
|
QCheckBox *cb_ignore_limits_lan, *cb_count_overhead, *cb_recheck_completed;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -40,6 +40,7 @@ public:
|
||||||
delete cb_ignore_limits_lan;
|
delete cb_ignore_limits_lan;
|
||||||
delete cb_count_overhead;
|
delete cb_count_overhead;
|
||||||
delete cb_recheck_completed;
|
delete cb_recheck_completed;
|
||||||
|
delete spin_list_refresh;
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -55,6 +56,8 @@ public slots:
|
||||||
Preferences::includeOverheadInLimits(cb_count_overhead->isChecked());
|
Preferences::includeOverheadInLimits(cb_count_overhead->isChecked());
|
||||||
// Recheck torrents on completion
|
// Recheck torrents on completion
|
||||||
Preferences::recheckTorrentsOnCompletion(cb_recheck_completed->isChecked());
|
Preferences::recheckTorrentsOnCompletion(cb_recheck_completed->isChecked());
|
||||||
|
// Transfer list refresh interval
|
||||||
|
Preferences::setRefreshInterval(spin_list_refresh->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
|
@ -101,6 +104,14 @@ protected slots:
|
||||||
connect(cb_recheck_completed, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
connect(cb_recheck_completed, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
|
||||||
cb_recheck_completed->setChecked(Preferences::recheckTorrentsOnCompletion());
|
cb_recheck_completed->setChecked(Preferences::recheckTorrentsOnCompletion());
|
||||||
setCellWidget(RECHECK_COMPLETED, VALUE, cb_recheck_completed);
|
setCellWidget(RECHECK_COMPLETED, VALUE, cb_recheck_completed);
|
||||||
|
// Transfer list refresh interval
|
||||||
|
setItem(LIST_REFRESH, PROPERTY, new QTableWidgetItem(tr("Transfer list refresh interval (ms)")));
|
||||||
|
spin_list_refresh = new QSpinBox();
|
||||||
|
connect(spin_list_refresh, SIGNAL(valueChanged(int)), this, SLOT(emitSettingsChanged()));
|
||||||
|
spin_list_refresh->setMinimum(30);
|
||||||
|
spin_list_refresh->setMaximum(99999);
|
||||||
|
spin_list_refresh->setValue(Preferences::getRefreshInterval());
|
||||||
|
setCellWidget(LIST_REFRESH, VALUE, spin_list_refresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void emitSettingsChanged() {
|
void emitSettingsChanged() {
|
||||||
|
|
|
@ -186,7 +186,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
|
||||||
connect(comboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
connect(comboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkConfirmExit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkConfirmExit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkSpeedInTitle, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkSpeedInTitle, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(spinRefreshInterval, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
|
|
||||||
connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkAltRowColors, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkNoSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkNoSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
|
||||||
|
@ -380,7 +379,6 @@ void options_imp::saveOptions(){
|
||||||
settings.setValue(QString::fromUtf8("Style"), getStyle());
|
settings.setValue(QString::fromUtf8("Style"), getStyle());
|
||||||
settings.setValue(QString::fromUtf8("ExitConfirm"), confirmOnExit());
|
settings.setValue(QString::fromUtf8("ExitConfirm"), confirmOnExit());
|
||||||
settings.setValue(QString::fromUtf8("SpeedInTitleBar"), speedInTitleBar());
|
settings.setValue(QString::fromUtf8("SpeedInTitleBar"), speedInTitleBar());
|
||||||
settings.setValue(QString::fromUtf8("RefreshInterval"), getRefreshInterval());
|
|
||||||
settings.setValue(QString::fromUtf8("AlternatingRowColors"), checkAltRowColors->isChecked());
|
settings.setValue(QString::fromUtf8("AlternatingRowColors"), checkAltRowColors->isChecked());
|
||||||
settings.setValue(QString::fromUtf8("SystrayEnabled"), systrayIntegration());
|
settings.setValue(QString::fromUtf8("SystrayEnabled"), systrayIntegration());
|
||||||
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
|
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
|
||||||
|
@ -596,7 +594,6 @@ void options_imp::loadOptions(){
|
||||||
setStyle(Preferences::getStyle());
|
setStyle(Preferences::getStyle());
|
||||||
checkConfirmExit->setChecked(Preferences::confirmOnExit());
|
checkConfirmExit->setChecked(Preferences::confirmOnExit());
|
||||||
checkSpeedInTitle->setChecked(Preferences::speedInTitleBar());
|
checkSpeedInTitle->setChecked(Preferences::speedInTitleBar());
|
||||||
spinRefreshInterval->setValue(Preferences::getRefreshInterval());
|
|
||||||
checkAltRowColors->setChecked(Preferences::useAlternatingRowColors());
|
checkAltRowColors->setChecked(Preferences::useAlternatingRowColors());
|
||||||
checkNoSystray->setChecked(!Preferences::systrayIntegration());
|
checkNoSystray->setChecked(!Preferences::systrayIntegration());
|
||||||
checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed());
|
checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed());
|
||||||
|
@ -962,10 +959,6 @@ bool options_imp::closeToTray() const{
|
||||||
return checkCloseToSystray->isChecked();
|
return checkCloseToSystray->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int options_imp::getRefreshInterval() const {
|
|
||||||
return spinRefreshInterval->value();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool options_imp::confirmOnExit() const{
|
bool options_imp::confirmOnExit() const{
|
||||||
return checkConfirmExit->isChecked();
|
return checkConfirmExit->isChecked();
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,6 @@ protected:
|
||||||
int getStyle() const;
|
int getStyle() const;
|
||||||
bool confirmOnExit() const;
|
bool confirmOnExit() const;
|
||||||
bool speedInTitleBar() const;
|
bool speedInTitleBar() const;
|
||||||
unsigned int getRefreshInterval() const;
|
|
||||||
bool systrayIntegration() const;
|
bool systrayIntegration() const;
|
||||||
bool minimizeToTray() const;
|
bool minimizeToTray() const;
|
||||||
bool closeToTray() const;
|
bool closeToTray() const;
|
||||||
|
|
|
@ -68,11 +68,6 @@ public:
|
||||||
return settings.value(QString::fromUtf8("Preferences/General/SpeedInTitleBar"), false).toBool();
|
return settings.value(QString::fromUtf8("Preferences/General/SpeedInTitleBar"), false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int getRefreshInterval() {
|
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
|
||||||
return settings.value(QString::fromUtf8("Preferences/General/RefreshInterval"), 1500).toUInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool useAlternatingRowColors() {
|
static bool useAlternatingRowColors() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
return settings.value(QString::fromUtf8("Preferences/General/AlternatingRowColors"), true).toBool();
|
return settings.value(QString::fromUtf8("Preferences/General/AlternatingRowColors"), true).toBool();
|
||||||
|
@ -888,6 +883,16 @@ public:
|
||||||
settings.setValue(QString::fromUtf8("Preferences/Advanced/RecheckOnCompletion"), recheck);
|
settings.setValue(QString::fromUtf8("Preferences/Advanced/RecheckOnCompletion"), recheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int getRefreshInterval() {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
return settings.value(QString::fromUtf8("Preferences/General/RefreshInterval"), 1500).toUInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setRefreshInterval(uint interval) {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
settings.setValue(QString::fromUtf8("Preferences/General/RefreshInterval"), interval);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PREFERENCES_H
|
#endif // PREFERENCES_H
|
||||||
|
|
|
@ -254,7 +254,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>602</width>
|
<width>602</width>
|
||||||
<height>590</height>
|
<height>555</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||||
|
@ -413,50 +413,6 @@
|
||||||
<string>Transfer list</string>
|
<string>Transfer list</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_27">
|
<layout class="QVBoxLayout" name="verticalLayout_27">
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Refresh interval:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QSpinBox" name="spinRefreshInterval">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>30</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>99999</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>1500</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_6">
|
|
||||||
<property name="text">
|
|
||||||
<string>ms</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkAltRowColors">
|
<widget class="QCheckBox" name="checkAltRowColors">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -3169,7 +3125,6 @@ QGroupBox {
|
||||||
<tabstop>comboStyle</tabstop>
|
<tabstop>comboStyle</tabstop>
|
||||||
<tabstop>checkConfirmExit</tabstop>
|
<tabstop>checkConfirmExit</tabstop>
|
||||||
<tabstop>checkSpeedInTitle</tabstop>
|
<tabstop>checkSpeedInTitle</tabstop>
|
||||||
<tabstop>spinRefreshInterval</tabstop>
|
|
||||||
<tabstop>checkNoSystray</tabstop>
|
<tabstop>checkNoSystray</tabstop>
|
||||||
<tabstop>checkCloseToSystray</tabstop>
|
<tabstop>checkCloseToSystray</tabstop>
|
||||||
<tabstop>checkMinimizeToSysTray</tabstop>
|
<tabstop>checkMinimizeToSysTray</tabstop>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue