Browse Source

Merge pull request #3736 from Chocobo1/option

Cleanup in options_imp
adaptive-webui-19844
sledgehammer999 9 years ago
parent
commit
5cb022c7b1
  1. 803
      src/gui/options.ui
  2. 2369
      src/gui/options_imp.cpp
  3. 226
      src/gui/options_imp.h

803
src/gui/options.ui

@ -10,12 +10,6 @@
<height>591</height> <height>591</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Options</string> <string>Options</string>
</property> </property>
@ -25,22 +19,10 @@
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QListWidget" name="tabSelection"> <widget class="QListWidget" name="tabSelection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>116</width>
<height>0</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="autoScroll"> <property name="autoScroll">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -50,9 +32,6 @@
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="flow">
<enum>QListView::LeftToRight</enum>
</property>
<property name="isWrapping" stdset="0"> <property name="isWrapping" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -71,12 +50,6 @@
<property name="viewMode"> <property name="viewMode">
<enum>QListView::IconMode</enum> <enum>QListView::IconMode</enum>
</property> </property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
<property name="currentRow"> <property name="currentRow">
<number>0</number> <number>0</number>
</property> </property>
@ -164,6 +137,15 @@
</property> </property>
<widget class="QWidget" name="tabOptionPage1"> <widget class="QWidget" name="tabOptionPage1">
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea"> <widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy"> <property name="sizePolicy">
@ -180,8 +162,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>474</width> <width>480</width>
<height>646</height> <height>672</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_9"> <layout class="QVBoxLayout" name="verticalLayout_9">
@ -519,6 +501,15 @@
</widget> </widget>
<widget class="QWidget" name="tabOptionPage2"> <widget class="QWidget" name="tabOptionPage2">
<layout class="QVBoxLayout" name="verticalLayout_13"> <layout class="QVBoxLayout" name="verticalLayout_13">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_2"> <widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable"> <property name="widgetResizable">
@ -1026,6 +1017,15 @@
</widget> </widget>
<widget class="QWidget" name="tabOptionPage3"> <widget class="QWidget" name="tabOptionPage3">
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_3"> <widget class="QScrollArea" name="scrollArea_3">
<property name="widgetResizable"> <property name="widgetResizable">
@ -1036,8 +1036,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>450</width> <width>480</width>
<height>632</height> <height>658</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_20"> <layout class="QVBoxLayout" name="verticalLayout_20">
@ -1386,12 +1386,12 @@
</item> </item>
<item> <item>
<widget class="QCheckBox" name="isProxyOnlyForTorrents"> <widget class="QCheckBox" name="isProxyOnlyForTorrents">
<property name="text">
<string>Use proxy only for torrents</string>
</property>
<property name="toolTip"> <property name="toolTip">
<string>RSS feeds, search engine, software updates or anything else other than torrent transfers and related operations (such as peer exchanges) will use a direct connection</string> <string>RSS feeds, search engine, software updates or anything else other than torrent transfers and related operations (such as peer exchanges) will use a direct connection</string>
</property> </property>
<property name="text">
<string>Use proxy only for torrents</string>
</property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -1540,13 +1540,22 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item>
<layout class="QVBoxLayout"/>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2"> <widget class="QWidget" name="tabSpeedPage">
<layout class="QVBoxLayout" name="verticalLayout_34"> <layout class="QVBoxLayout" name="verticalLayout_34">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_9"> <widget class="QScrollArea" name="scrollArea_9">
<property name="widgetResizable"> <property name="widgetResizable">
@ -1557,400 +1566,347 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>376</width> <width>502</width>
<height>431</height> <height>538</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_33"> <layout class="QVBoxLayout" name="verticalLayout_5">
<item> <item>
<widget class="QGroupBox" name="bandwidthBox"> <widget class="QGroupBox" name="rateLimitBox">
<property name="title"> <property name="title">
<string>Global Rate Limits</string> <string>Global Rate Limits</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_7"> <layout class="QGridLayout" name="rateLimitBoxLayout">
<item row="0" column="0"> <item row="0" column="2">
<widget class="QLabel" name="label_5"> <widget class="QSpinBox" name="spinUploadLimit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkUploadLimit">
<property name="text">
<string>Upload:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_10">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="spinDownloadLimit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_13">
<property name="text"> <property name="text">
<string notr="true"/> <string>KiB/s</string>
</property> </property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="label_5">
<property name="pixmap"> <property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/slow_off.png</pixmap> <pixmap resource="../icons.qrc">:/icons/slow_off.png</pixmap>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="1" column="1">
<layout class="QGridLayout" name="gridLayout_6"> <widget class="QCheckBox" name="checkDownloadLimit">
<item row="0" column="0"> <property name="text">
<widget class="QCheckBox" name="checkUploadLimit"> <string>Download:</string>
<property name="text"> </property>
<string>Upload:</string> </widget>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinUploadLimit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkDownloadLimit">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinDownloadLimit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="suffix">
<string/>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>100</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_13">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="0" column="2"> <item row="0" column="4">
<spacer> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>200</width> <width>40</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="1" colspan="2"> </layout>
<widget class="QGroupBox" name="groupBox_5"> </widget>
</item>
<item>
<widget class="QGroupBox" name="altRateLimitBox">
<property name="title">
<string>Alternative Rate Limits</string>
</property>
<layout class="QGridLayout" name="gridLayout_6">
<item row="2" column="0" colspan="5">
<widget class="QGroupBox" name="check_schedule">
<property name="title"> <property name="title">
<string>Options</string> <string>Schedule the use of alternative rate limits</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_27"> <property name="checkable">
<item> <bool>true</bool>
<widget class="QCheckBox" name="checkuTP"> </property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="text"> <property name="text">
<string>Enable bandwidth management (uTP)</string> <string extracomment="from (time1 to time2)">From:</string>
</property> </property>
<property name="checked"> </widget>
</item>
<item row="0" column="3">
<widget class="QTimeEdit" name="schedule_to">
<property name="wrapping">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
<property name="time">
<time>
<hour>20</hour>
<minute>0</minute>
<second>0</second>
</time>
</property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="2">
<widget class="QCheckBox" name="checkLimituTPConnections"> <widget class="QLabel" name="label_17">
<property name="text"> <property name="text">
<string>Apply rate limit to uTP connections</string> <string extracomment="time1 to time2">To:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QCheckBox" name="checkLimitTransportOverhead"> <widget class="QTimeEdit" name="schedule_from">
<property name="text"> <property name="wrapping">
<string>Apply rate limit to transport overhead</string> <bool>true</bool>
</property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
<property name="calendarPopup">
<bool>false</bool>
</property>
<property name="time">
<time>
<hour>8</hour>
<minute>0</minute>
<second>0</second>
</time>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QCheckBox" name="checkLimitLocalPeerRate"> <widget class="QLabel" name="label_18">
<property name="text"> <property name="text">
<string>Apply rate limit to peers on LAN</string> <string>When:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" colspan="3">
<widget class="QComboBox" name="schedule_days">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item>
<property name="text">
<string>Every day</string>
</property>
</item>
<item>
<property name="text">
<string>Weekdays</string>
</property>
</item>
<item>
<property name="text">
<string>Weekends</string>
</property>
</item>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_8">
<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> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="label_16">
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/slow.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="checkUploadLimitAlt">
<property name="text">
<string>Upload:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="checkDownloadLimitAlt">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="spinUploadLimitAlt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="spinDownloadLimitAlt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_15">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="0" column="4">
<spacer name="horizontalSpacer_5">
<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> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_6"> <widget class="QGroupBox" name="rateLimitsGroupBox">
<property name="title"> <property name="title">
<string>Alternative Global Rate Limits</string> <string>Rate Limits Settings</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_11"> <layout class="QGridLayout" name="gridLayout_8">
<item> <item row="4" column="0" colspan="3">
<layout class="QGridLayout" name="gridLayout_9"> <widget class="QCheckBox" name="checkLimitLocalPeerRate">
<item row="0" column="0"> <property name="text">
<widget class="QLabel" name="label_16"> <string>Apply rate limit to peers on LAN</string>
<property name="minimumSize"> </property>
<size> </widget>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>48</width>
<height>48</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/slow.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="1">
<widget class="QSpinBox" name="spinUploadLimitAlt">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_14">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinDownloadLimitAlt">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_15">
<property name="text">
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkUploadLimitAlt">
<property name="text">
<string>Upload:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkDownloadLimitAlt">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>222</width>
<height>59</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item row="3" column="0" colspan="3">
<widget class="QGroupBox" name="check_schedule"> <widget class="QCheckBox" name="checkLimitTransportOverhead">
<property name="title"> <property name="text">
<string>Schedule the use of alternative rate limits</string> <string>Apply rate limit to transport overhead</string>
</property> </property>
<property name="checkable"> </widget>
<bool>true</bool> </item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="checkuTP">
<property name="text">
<string>Enable µTP protocol</string>
</property> </property>
<property name="checked"> </widget>
<bool>false</bool> </item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkLimituTPConnections">
<property name="text">
<string>Apply rate limit to µTP protocol</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<property name="leftMargin">
<number>5</number>
</property>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string extracomment="from (time1 to time2)">from</string>
</property>
</widget>
</item>
<item>
<widget class="QTimeEdit" name="schedule_from">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
<property name="calendarPopup">
<bool>false</bool>
</property>
<property name="time">
<time>
<hour>8</hour>
<minute>0</minute>
<second>0</second>
</time>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string extracomment="time1 to time2">to</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTimeEdit" name="schedule_to">
<property name="wrapping">
<bool>true</bool>
</property>
<property name="displayFormat">
<string notr="true">hh:mm</string>
</property>
<property name="time">
<time>
<hour>20</hour>
<minute>0</minute>
<second>0</second>
</time>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<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_14">
<property name="leftMargin">
<number>5</number>
</property>
<item>
<widget class="QLabel" name="label_18">
<property name="text">
<string>When:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="schedule_days">
<item>
<property name="text">
<string>Every day</string>
</property>
</item>
<item>
<property name="text">
<string>Week days</string>
</property>
</item>
<item>
<property name="text">
<string>Week ends</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<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 row="2" column="2">
<spacer name="horizontalSpacer_9">
<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> </layout>
</widget> </widget>
</item> </item>
@ -1975,6 +1931,15 @@
</widget> </widget>
<widget class="QWidget" name="tabOptionPage4"> <widget class="QWidget" name="tabOptionPage4">
<layout class="QVBoxLayout" name="verticalLayout_15"> <layout class="QVBoxLayout" name="verticalLayout_15">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_4"> <widget class="QScrollArea" name="scrollArea_4">
<property name="widgetResizable"> <property name="widgetResizable">
@ -2329,6 +2294,15 @@
</widget> </widget>
<widget class="QWidget" name="tabOptionPage7"> <widget class="QWidget" name="tabOptionPage7">
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_7"> <widget class="QScrollArea" name="scrollArea_7">
<property name="widgetResizable"> <property name="widgetResizable">
@ -2704,8 +2678,17 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_3"> <widget class="QWidget" name="tabAdvancedPage">
<layout class="QVBoxLayout" name="verticalLayout_35"> <layout class="QVBoxLayout" name="verticalLayout_35">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QScrollArea" name="scrollArea_advanced"> <widget class="QScrollArea" name="scrollArea_advanced">
<property name="widgetResizable"> <property name="widgetResizable">
@ -2720,7 +2703,20 @@
<height>28</height> <height>28</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_36"/> <layout class="QVBoxLayout" name="verticalLayout_36">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</widget> </widget>
</widget> </widget>
</item> </item>
@ -2730,34 +2726,11 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <widget class="QDialogButtonBox" name="buttonBox">
<item> <property name="standardButtons">
<spacer name="horizontalSpacer"> <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<property name="orientation"> </property>
<enum>Qt::Horizontal</enum> </widget>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>208</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -2893,22 +2866,6 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>checkuTP</sender>
<signal>toggled(bool)</signal>
<receiver>checkLimituTPConnections</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>421</x>
<y>147</y>
</hint>
<hint type="destinationlabel">
<x>711</x>
<y>172</y>
</hint>
</hints>
</connection>
<connection> <connection>
<sender>checkMaxUploads</sender> <sender>checkMaxUploads</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>

2369
src/gui/options_imp.cpp

File diff suppressed because it is too large Load Diff

226
src/gui/options_imp.h

@ -34,7 +34,12 @@
#include "ui_options.h" #include "ui_options.h"
// actions on double-click on torrents // actions on double-click on torrents
enum DoubleClickAction {TOGGLE_PAUSE, OPEN_DEST, NO_ACTION}; enum DoubleClickAction
{
TOGGLE_PAUSE,
OPEN_DEST,
NO_ACTION
};
class AdvancedSettings; class AdvancedSettings;
@ -42,128 +47,137 @@ QT_BEGIN_NAMESPACE
class QCloseEvent; class QCloseEvent;
QT_END_NAMESPACE QT_END_NAMESPACE
class options_imp : public QDialog, private Ui_Preferences { class options_imp: public QDialog, private Ui_Preferences
Q_OBJECT {
Q_OBJECT
private: private:
enum Tabs {TAB_UI, TAB_DOWNLOADS, TAB_CONNECTION, TAB_SPEED, TAB_BITTORRENT, TAB_WEBUI, TAB_ADVANCED}; enum Tabs
{
TAB_UI,
TAB_DOWNLOADS,
TAB_CONNECTION,
TAB_SPEED,
TAB_BITTORRENT,
TAB_WEBUI,
TAB_ADVANCED
};
public: public:
// Constructor / Destructor // Constructor / Destructor
options_imp(QWidget *parent=0); options_imp(QWidget *parent = 0);
~options_imp(); ~options_imp();
public slots: public slots:
void showConnectionTab(); void showConnectionTab();
signals: signals:
void status_changed() const; void status_changed() const;
void exitWithCancel(); void exitWithCancel();
private slots: private slots:
void enableProxy(int comboIndex); void enableProxy(int comboIndex);
void on_buttonBox_accepted(); void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
void on_buttonBox_rejected(); void on_buttonBox_rejected();
void applySettings(QAbstractButton* button); void applySettings(QAbstractButton* button);
void enableApplyButton(); void enableApplyButton();
void changePage(QListWidgetItem*, QListWidgetItem*); void changePage(QListWidgetItem*, QListWidgetItem*);
void loadWindowState(); void loadWindowState();
void saveWindowState() const; void saveWindowState() const;
void handleScanFolderViewSelectionChanged(); void handleScanFolderViewSelectionChanged();
void on_IpFilterRefreshBtn_clicked(); void on_IpFilterRefreshBtn_clicked();
void handleIPFilterParsed(bool error, int ruleCount); void handleIPFilterParsed(bool error, int ruleCount);
void on_browseExportDirButton_clicked(); void on_browseExportDirButton_clicked();
void on_browseExportDirFinButton_clicked(); void on_browseExportDirFinButton_clicked();
void on_browseFilterButton_clicked(); void on_browseFilterButton_clicked();
void on_browseSaveDirButton_clicked(); void on_browseSaveDirButton_clicked();
void on_browseTempDirButton_clicked(); void on_browseTempDirButton_clicked();
void on_randomButton_clicked(); void on_randomButton_clicked();
void on_addScanFolderButton_clicked(); void on_addScanFolderButton_clicked();
void on_removeScanFolderButton_clicked(); void on_removeScanFolderButton_clicked();
void on_btnWebUiCrt_clicked(); void on_btnWebUiCrt_clicked();
void on_btnWebUiKey_clicked(); void on_btnWebUiKey_clicked();
void on_registerDNSBtn_clicked(); void on_registerDNSBtn_clicked();
void setLocale(const QString &locale); void setLocale(const QString &locale);
private: private:
// Methods // Methods
void saveOptions(); void saveOptions();
void loadOptions(); void loadOptions();
void initializeLanguageCombo(); void initializeLanguageCombo();
static QString languageToLocalizedString(const QLocale &locale); static QString languageToLocalizedString(const QLocale &locale);
// General options // General options
QString getLocale() const; QString getLocale() const;
bool systrayIntegration() const; bool systrayIntegration() const;
bool minimizeToTray() const; bool minimizeToTray() const;
bool closeToTray() const; bool closeToTray() const;
bool startMinimized() const; bool startMinimized() const;
bool isSlashScreenDisabled() const; bool isSlashScreenDisabled() const;
bool preventFromSuspend() const; bool preventFromSuspend() const;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
bool WinStartup() const; bool WinStartup() const;
#endif #endif
// Downloads // Downloads
QString getSavePath() const; QString getSavePath() const;
bool isTempPathEnabled() const; bool isTempPathEnabled() const;
QString getTempPath() const; QString getTempPath() const;
bool preAllocateAllFiles() const; bool preAllocateAllFiles() const;
bool useAdditionDialog() const; bool useAdditionDialog() const;
bool addTorrentsInPause() const; bool addTorrentsInPause() const;
QString getTorrentExportDir() const; QString getTorrentExportDir() const;
QString getFinishedTorrentExportDir() const; QString getFinishedTorrentExportDir() const;
QString askForExportDir(const QString& currentExportPath); QString askForExportDir(const QString& currentExportPath);
int getActionOnDblClOnTorrentDl() const; int getActionOnDblClOnTorrentDl() const;
int getActionOnDblClOnTorrentFn() const; int getActionOnDblClOnTorrentFn() const;
// Connection options // Connection options
int getPort() const; int getPort() const;
bool isUPnPEnabled() const; bool isUPnPEnabled() const;
QPair<int,int> getGlobalBandwidthLimits() const; QPair<int, int> getGlobalBandwidthLimits() const;
QPair<int,int> getAltGlobalBandwidthLimits() const; QPair<int, int> getAltGlobalBandwidthLimits() const;
// Bittorrent options // Bittorrent options
int getMaxConnecs() const; int getMaxConnecs() const;
int getMaxConnecsPerTorrent() const; int getMaxConnecsPerTorrent() const;
int getMaxUploads() const; int getMaxUploads() const;
int getMaxUploadsPerTorrent() const; int getMaxUploadsPerTorrent() const;
bool isDHTEnabled() const; bool isDHTEnabled() const;
bool isLSDEnabled() const; bool isLSDEnabled() const;
int getEncryptionSetting() const; int getEncryptionSetting() const;
qreal getMaxRatio() const; qreal getMaxRatio() const;
// Proxy options // Proxy options
bool isProxyEnabled() const; bool isProxyEnabled() const;
bool isProxyAuthEnabled() const; bool isProxyAuthEnabled() const;
QString getProxyIp() const; QString getProxyIp() const;
unsigned short getProxyPort() const; unsigned short getProxyPort() const;
QString getProxyUsername() const; QString getProxyUsername() const;
QString getProxyPassword() const; QString getProxyPassword() const;
int getProxyType() const; int getProxyType() const;
// IP Filter // IP Filter
bool isFilteringEnabled() const; bool isFilteringEnabled() const;
QString getFilter() const; QString getFilter() const;
bool m_refreshingIpFilter; bool m_refreshingIpFilter;
// Queueing system // Queueing system
bool isQueueingSystemEnabled() const; bool isQueueingSystemEnabled() const;
int getMaxActiveDownloads() const; int getMaxActiveDownloads() const;
int getMaxActiveUploads() const; int getMaxActiveUploads() const;
int getMaxActiveTorrents() const; int getMaxActiveTorrents() const;
bool isWebUiEnabled() const; bool isWebUiEnabled() const;
quint16 webUiPort() const; quint16 webUiPort() const;
QString webUiUsername() const; QString webUiUsername() const;
QString webUiPassword() const; QString webUiPassword() const;
QSize sizeFittingScreen() const; QSize sizeFittingScreen() const;
private: private:
void setSslKey(const QByteArray &key, bool interactive = true); void setSslKey(const QByteArray &key, bool interactive = true);
void setSslCertificate(const QByteArray &cert, bool interactive = true); void setSslCertificate(const QByteArray &cert, bool interactive = true);
bool schedTimesOk(); bool schedTimesOk();
private: private:
QButtonGroup choiceLanguage; QButtonGroup choiceLanguage;
QAbstractButton *applyButton; QAbstractButton *applyButton;
AdvancedSettings *advancedSettings; AdvancedSettings *advancedSettings;
QList<QString> addedScanDirs; QList<QString> addedScanDirs;
// SSL Cert / key // SSL Cert / key
QByteArray m_sslCert, m_sslKey; QByteArray m_sslCert, m_sslKey;
}; };
#endif #endif

Loading…
Cancel
Save