Browse Source

Still improving program options

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
b81c8d29ba
  1. 33
      src/options_imp.cpp
  2. 3
      src/options_imp.h
  3. 506
      src/ui/options.ui

33
src/options_imp.cpp

@ -161,9 +161,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Connect signals / slots // Connect signals / slots
// General tab // General tab
connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(setSystrayOptionsState(bool))); connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(setSystrayOptionsState(bool)));
// Downloads tab
connect(checkTempFolder, SIGNAL(toggled(bool)), this, SLOT(enableTempPathInput(bool)));
connect(checkExportDir, SIGNAL(toggled(bool)), this, SLOT(enableTorrentExport(bool)));
// Connection tab // Connection tab
connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableUploadLimit(bool))); connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableUploadLimit(bool)));
connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableDownloadLimit(bool))); connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableDownloadLimit(bool)));
@ -185,7 +182,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Misc tab // Misc tab
connect(checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableFilter(bool))); connect(checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableFilter(bool)));
connect(checkEnableRSS, SIGNAL(toggled(bool)), this, SLOT(enableRSS(bool))); connect(checkEnableRSS, SIGNAL(toggled(bool)), this, SLOT(enableRSS(bool)));
connect(checkEnableQueueing, SIGNAL(toggled(bool)), this, SLOT(enableQueueingSystem(bool)));
// Web UI tab // Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool))); connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool)));
@ -619,10 +615,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
if(Preferences::isTempPathEnabled()) { if(Preferences::isTempPathEnabled()) {
// enable // enable
checkTempFolder->setChecked(true); checkTempFolder->setChecked(true);
enableTempPathInput(checkTempFolder->isChecked());
} else { } else {
checkTempFolder->setChecked(false); checkTempFolder->setChecked(false);
enableTempPathInput(checkTempFolder->isChecked());
} }
QString temp_path = Preferences::getTempPath(); QString temp_path = Preferences::getTempPath();
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
@ -641,7 +635,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
if(strValue.isEmpty()) { if(strValue.isEmpty()) {
// Disable // Disable
checkExportDir->setChecked(false); checkExportDir->setChecked(false);
enableTorrentExport(checkExportDir->isChecked());
} else { } else {
// enable // enable
checkExportDir->setChecked(true); checkExportDir->setChecked(true);
@ -649,7 +642,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
strValue = strValue.replace("/", "\\"); strValue = strValue.replace("/", "\\");
#endif #endif
textExportDir->setText(strValue); textExportDir->setText(strValue);
enableTorrentExport(checkExportDir->isChecked());
} }
intValue = Preferences::getActionOnDblClOnTorrentDl(); intValue = Preferences::getActionOnDblClOnTorrentDl();
@ -849,7 +841,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// End RSS preferences // End RSS preferences
// Queueing system preferences // Queueing system preferences
checkEnableQueueing->setChecked(Preferences::isQueueingSystemEnabled()); checkEnableQueueing->setChecked(Preferences::isQueueingSystemEnabled());
enableQueueingSystem(checkEnableQueueing->isChecked());
spinMaxActiveDownloads->setValue(Preferences::getMaxActiveDownloads()); spinMaxActiveDownloads->setValue(Preferences::getMaxActiveDownloads());
spinMaxActiveUploads->setValue(Preferences::getMaxActiveUploads()); spinMaxActiveUploads->setValue(Preferences::getMaxActiveUploads());
spinMaxActiveTorrents->setValue(Preferences::getMaxActiveTorrents()); spinMaxActiveTorrents->setValue(Preferences::getMaxActiveTorrents());
@ -1109,16 +1100,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
} }
} }
void options_imp::enableTempPathInput(bool checked){
if(checked){
textTempPath->setEnabled(true);
browseTempDirButton->setEnabled(true);
}else{
textTempPath->setEnabled(false);
browseTempDirButton->setEnabled(false);
}
}
bool options_imp::useAdditionDialog() const{ bool options_imp::useAdditionDialog() const{
return checkAdditionDialog->isChecked(); return checkAdditionDialog->isChecked();
} }
@ -1133,15 +1114,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
spinMaxConnec->setEnabled(checked); spinMaxConnec->setEnabled(checked);
} }
void options_imp::enableQueueingSystem(bool checked) {
spinMaxActiveDownloads->setEnabled(checked);
spinMaxActiveUploads->setEnabled(checked);
label_max_active_dl->setEnabled(checked);
label_max_active_up->setEnabled(checked);
maxActiveTorrents_lbl->setEnabled(checked);
spinMaxActiveTorrents->setEnabled(checked);
}
void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){ void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){
spinMaxConnecPerTorrent->setEnabled(checked); spinMaxConnecPerTorrent->setEnabled(checked);
} }
@ -1264,11 +1236,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
textProxyPassword_http->setEnabled(checked); textProxyPassword_http->setEnabled(checked);
} }
void options_imp::enableTorrentExport(bool checked) {
textExportDir->setEnabled(checked);
browseExportDirButton->setEnabled(checked);
}
bool options_imp::isSlashScreenDisabled() const { bool options_imp::isSlashScreenDisabled() const {
return !checkShowSplash->isChecked(); return !checkShowSplash->isChecked();
} }

3
src/options_imp.h

@ -130,8 +130,6 @@ protected:
protected slots: protected slots:
void enableUploadLimit(bool checked); void enableUploadLimit(bool checked);
void enableDownloadLimit(bool checked); void enableDownloadLimit(bool checked);
void enableTempPathInput(bool checked);
void enableTorrentExport(bool checked);
void enablePeerProxy(int comboIndex); void enablePeerProxy(int comboIndex);
void enablePeerProxyAuth(bool checked); void enablePeerProxyAuth(bool checked);
void enableHTTPProxy(int comboIndex); void enableHTTPProxy(int comboIndex);
@ -146,7 +144,6 @@ protected slots:
void enableRSS(bool checked); void enableRSS(bool checked);
void enableDHTSettings(bool checked); void enableDHTSettings(bool checked);
void enableDHTPortSettings(bool checked); void enableDHTPortSettings(bool checked);
void enableQueueingSystem(bool checked);
void enableSpoofingSettings(int index); void enableSpoofingSettings(int index);
void setStyle(QString style); void setStyle(QString style);
void on_buttonBox_accepted(); void on_buttonBox_accepted();

506
src/ui/options.ui

@ -539,11 +539,137 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>632</width> <width>506</width>
<height>686</height> <height>630</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_17"> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="torrentAdditionBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>When adding a torrent</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkAdditionDialog">
<property name="text">
<string>Display torrent content and some options</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkStartPaused">
<property name="text">
<string comment="The torrent will be added to download list in pause state">Do not start the download automatically</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="checkEnableQueueing">
<property name="title">
<string>Torrent queueing</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_max_active_dl">
<property name="text">
<string>Maximum active downloads:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinMaxActiveDownloads">
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_max_active_up">
<property name="text">
<string>Maximum active uploads:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinMaxActiveUploads">
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="maxActiveTorrents_lbl">
<property name="text">
<string>Maximum active torrents:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinMaxActiveTorrents">
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="1" column="2">
<spacer name="horizontalSpacer_2">
<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>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="fileSystemBox"> <widget class="QGroupBox" name="fileSystemBox">
<property name="sizePolicy"> <property name="sizePolicy">
@ -556,25 +682,37 @@
<string>File system</string> <string>File system</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_25"> <layout class="QVBoxLayout" name="verticalLayout_25">
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QGroupBox" name="groupBox_3"> <widget class="QGroupBox" name="groupBox_3">
<property name="styleSheet"> <property name="styleSheet">
<string>QGroupBox::title { <string notr="true">QGroupBox::title {
font-weight: normal; font-weight: normal;
margin-left: -3px; margin-left: 0px;
} }
QGroupBox { QGroupBox {
border-width: 0; border-width: 0;
}</string> }</string>
</property> </property>
<property name="title"> <property name="title">
<string>Destination Folder:</string> <string>Save files to location:</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_26"> <layout class="QVBoxLayout" name="verticalLayout_26">
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_10"> <layout class="QHBoxLayout" name="horizontalLayout_10">
<item> <item>
<widget class="QLineEdit" name="textSavePath"> <widget class="QLineEdit" name="textSavePath">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
@ -608,7 +746,7 @@ QGroupBox {
<item> <item>
<widget class="QCheckBox" name="checkAppendLabel"> <widget class="QCheckBox" name="checkAppendLabel">
<property name="text"> <property name="text">
<string>Append the torrent's label</string> <string>Append the label of the torrent to the save path</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -616,31 +754,41 @@ QGroupBox {
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkTempFolder"> <widget class="QCheckBox" name="checkPreallocateAll">
<property name="text"> <property name="text">
<string>Use a different folder for incomplete downloads:</string> <string>Pre-allocate disk space for all files</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_7"> <widget class="QGroupBox" name="checkTempFolder">
<item>
<widget class="QLineEdit" name="textTempPath">
<property name="enabled">
<bool>false</bool>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string>QLineEdit { <string notr="true">QGroupBox::title {
margin-left: 23px; font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string> }</string>
</property> </property>
</widget> <property name="title">
</item> <string>Keep incomplete torrents in:</string>
<item> </property>
<widget class="QToolButton" name="browseTempDirButton"> <property name="checkable">
<property name="enabled"> <bool>true</bool>
</property>
<property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLineEdit" name="textTempPath"/>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="browseTempDirButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>25</horstretch> <horstretch>25</horstretch>
@ -666,13 +814,33 @@ QGroupBox {
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkAppendqB">
<property name="text">
<string>Append .!qB extension to incomplete files' names</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="styleSheet">
<string notr="true">QGroupBox::title {
font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string>
</property>
<property name="title"> <property name="title">
<string>Check Folders for .torrent Files:</string> <string>Automatically add torrents from:</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_38"> <layout class="QVBoxLayout" name="verticalLayout_38">
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_16"> <layout class="QHBoxLayout" name="horizontalLayout_16">
<item> <item>
@ -686,7 +854,7 @@ QGroupBox {
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>250</width> <width>250</width>
<height>150</height> <height>75</height>
</size> </size>
</property> </property>
<property name="selectionMode"> <property name="selectionMode">
@ -720,7 +888,7 @@ QGroupBox {
<item> <item>
<widget class="QPushButton" name="addScanFolderButton"> <widget class="QPushButton" name="addScanFolderButton">
<property name="text"> <property name="text">
<string>Add folder ...</string> <string>Add folder...</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -749,53 +917,40 @@ QGroupBox {
</item> </item>
</layout> </layout>
</item> </item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkExportDir"> <widget class="QGroupBox" name="checkExportDir">
<property name="text"> <property name="styleSheet">
<string notr="true">QGroupBox::title {
font-weight: normal;
margin-left: 0px;
}
QGroupBox {
border-width: 0;
}</string>
</property>
<property name="title">
<string>Copy .torrent files to:</string> <string>Copy .torrent files to:</string>
</property> </property>
</widget> <property name="checkable">
</item> <bool>true</bool>
<item> </property>
<layout class="QHBoxLayout" name="horizontalLayout_15"> <property name="checked">
<item>
<widget class="QLineEdit" name="textExportDir">
<property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="styleSheet"> <layout class="QGridLayout" name="gridLayout_4">
<string>QLineEdit { <property name="bottomMargin">
margin-left: 23px; <number>0</number>
}</string>
</property> </property>
</widget> <item row="0" column="0">
<widget class="QLineEdit" name="textExportDir"/>
</item> </item>
<item> <item row="0" column="1">
<widget class="QToolButton" name="browseExportDirButton"> <widget class="QToolButton" name="browseExportDirButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>22</width> <width>22</width>
@ -815,237 +970,9 @@ QGroupBox {
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
<item>
<widget class="QCheckBox" name="checkAppendqB">
<property name="text">
<string>Append .!qB extension to incomplete files</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkPreallocateAll">
<property name="text">
<string>Pre-allocate all files</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QGroupBox" name="groupQueueing">
<property name="title">
<string>Torrent queueing</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkEnableQueueing">
<property name="text">
<string>Enable queueing system</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="_2">
<item>
<widget class="QLabel" name="label_max_active_dl">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Maximum active downloads:</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinMaxActiveDownloads">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item>
<item>
<layout class="QHBoxLayout" name="_6">
<item>
<widget class="QLabel" name="label_max_active_up">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Maximum active uploads:</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>
<item>
<widget class="QSpinBox" name="spinMaxActiveUploads">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="_7">
<item>
<widget class="QLabel" name="maxActiveTorrents_lbl">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Maximum active torrents:</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>381</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinMaxActiveTorrents">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QGroupBox" name="torrentAdditionBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>When adding a torrent</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="checkAdditionDialog">
<property name="text">
<string>Display torrent content and some options</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<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>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="checkStartPaused">
<property name="text">
<string comment="The torrent will be added to download list in pause state">Do not start download automatically</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<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>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
@ -1062,10 +989,6 @@ QGroupBox {
</spacer> </spacer>
</item> </item>
</layout> </layout>
</item>
</layout>
</item>
</layout>
</widget> </widget>
</widget> </widget>
</item> </item>
@ -3086,7 +3009,6 @@ QGroupBox {
<tabstop>checkMinimizeToSysTray</tabstop> <tabstop>checkMinimizeToSysTray</tabstop>
<tabstop>textSavePath</tabstop> <tabstop>textSavePath</tabstop>
<tabstop>browseSaveDirButton</tabstop> <tabstop>browseSaveDirButton</tabstop>
<tabstop>checkPreallocateAll</tabstop>
<tabstop>checkAdditionDialog</tabstop> <tabstop>checkAdditionDialog</tabstop>
<tabstop>checkStartPaused</tabstop> <tabstop>checkStartPaused</tabstop>
<tabstop>spinPort</tabstop> <tabstop>spinPort</tabstop>

Loading…
Cancel
Save