Browse Source

- Moved "Transfer list refresh interval" to advanced settings

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
1a4f638ff6
  1. 17
      src/advancedsettings.h
  2. 7
      src/options_imp.cpp
  3. 1
      src/options_imp.h
  4. 15
      src/preferences.h
  5. 47
      src/ui/options.ui

17
src/advancedsettings.h

@ -8,14 +8,14 @@ @@ -8,14 +8,14 @@
#include "preferences.h"
enum AdvSettingsCols {PROPERTY, VALUE};
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED };
#define ROW_COUNT 6
enum AdvSettingsRows {DISK_CACHE, OUTGOING_PORT_MIN, OUTGOING_PORT_MAX, IGNORE_LIMIT_LAN, COUNT_OVERHEAD, RECHECK_COMPLETED, LIST_REFRESH };
#define ROW_COUNT 7
class AdvancedSettings: public QTableWidget {
Q_OBJECT
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;
public:
@ -40,6 +40,7 @@ public: @@ -40,6 +40,7 @@ public:
delete cb_ignore_limits_lan;
delete cb_count_overhead;
delete cb_recheck_completed;
delete spin_list_refresh;
}
public slots:
@ -55,6 +56,8 @@ public slots: @@ -55,6 +56,8 @@ public slots:
Preferences::includeOverheadInLimits(cb_count_overhead->isChecked());
// Recheck torrents on completion
Preferences::recheckTorrentsOnCompletion(cb_recheck_completed->isChecked());
// Transfer list refresh interval
Preferences::setRefreshInterval(spin_list_refresh->value());
}
protected slots:
@ -101,6 +104,14 @@ protected slots: @@ -101,6 +104,14 @@ protected slots:
connect(cb_recheck_completed, SIGNAL(toggled(bool)), this, SLOT(emitSettingsChanged()));
cb_recheck_completed->setChecked(Preferences::recheckTorrentsOnCompletion());
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() {

7
src/options_imp.cpp

@ -186,7 +186,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -186,7 +186,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(comboStyle, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(checkConfirmExit, 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(checkNoSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkCloseToSystray, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
@ -380,7 +379,6 @@ void options_imp::saveOptions(){ @@ -380,7 +379,6 @@ void options_imp::saveOptions(){
settings.setValue(QString::fromUtf8("Style"), getStyle());
settings.setValue(QString::fromUtf8("ExitConfirm"), confirmOnExit());
settings.setValue(QString::fromUtf8("SpeedInTitleBar"), speedInTitleBar());
settings.setValue(QString::fromUtf8("RefreshInterval"), getRefreshInterval());
settings.setValue(QString::fromUtf8("AlternatingRowColors"), checkAltRowColors->isChecked());
settings.setValue(QString::fromUtf8("SystrayEnabled"), systrayIntegration());
settings.setValue(QString::fromUtf8("CloseToTray"), closeToTray());
@ -596,7 +594,6 @@ void options_imp::loadOptions(){ @@ -596,7 +594,6 @@ void options_imp::loadOptions(){
setStyle(Preferences::getStyle());
checkConfirmExit->setChecked(Preferences::confirmOnExit());
checkSpeedInTitle->setChecked(Preferences::speedInTitleBar());
spinRefreshInterval->setValue(Preferences::getRefreshInterval());
checkAltRowColors->setChecked(Preferences::useAlternatingRowColors());
checkNoSystray->setChecked(!Preferences::systrayIntegration());
checkDisplayToolbar->setChecked(Preferences::isToolbarDisplayed());
@ -962,10 +959,6 @@ bool options_imp::closeToTray() const{ @@ -962,10 +959,6 @@ bool options_imp::closeToTray() const{
return checkCloseToSystray->isChecked();
}
unsigned int options_imp::getRefreshInterval() const {
return spinRefreshInterval->value();
}
bool options_imp::confirmOnExit() const{
return checkConfirmExit->isChecked();
}

1
src/options_imp.h

@ -68,7 +68,6 @@ protected: @@ -68,7 +68,6 @@ protected:
int getStyle() const;
bool confirmOnExit() const;
bool speedInTitleBar() const;
unsigned int getRefreshInterval() const;
bool systrayIntegration() const;
bool minimizeToTray() const;
bool closeToTray() const;

15
src/preferences.h

@ -68,11 +68,6 @@ public: @@ -68,11 +68,6 @@ public:
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() {
QSettings settings("qBittorrent", "qBittorrent");
return settings.value(QString::fromUtf8("Preferences/General/AlternatingRowColors"), true).toBool();
@ -888,6 +883,16 @@ public: @@ -888,6 +883,16 @@ public:
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

47
src/ui/options.ui

@ -254,7 +254,7 @@ @@ -254,7 +254,7 @@
<x>0</x>
<y>0</y>
<width>602</width>
<height>590</height>
<height>555</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@ -413,50 +413,6 @@ @@ -413,50 +413,6 @@
<string>Transfer list</string>
</property>
<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>
<widget class="QCheckBox" name="checkAltRowColors">
<property name="text">
@ -3169,7 +3125,6 @@ QGroupBox { @@ -3169,7 +3125,6 @@ QGroupBox {
<tabstop>comboStyle</tabstop>
<tabstop>checkConfirmExit</tabstop>
<tabstop>checkSpeedInTitle</tabstop>
<tabstop>spinRefreshInterval</tabstop>
<tabstop>checkNoSystray</tabstop>
<tabstop>checkCloseToSystray</tabstop>
<tabstop>checkMinimizeToSysTray</tabstop>

Loading…
Cancel
Save