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 @@ @@ -10,12 +10,6 @@
<height>591</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Options</string>
</property>
@ -25,22 +19,10 @@ @@ -25,22 +19,10 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<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">
<bool>false</bool>
</property>
@ -50,9 +32,6 @@ @@ -50,9 +32,6 @@
<height>32</height>
</size>
</property>
<property name="flow">
<enum>QListView::LeftToRight</enum>
</property>
<property name="isWrapping" stdset="0">
<bool>true</bool>
</property>
@ -71,12 +50,6 @@ @@ -71,12 +50,6 @@
<property name="viewMode">
<enum>QListView::IconMode</enum>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
<property name="currentRow">
<number>0</number>
</property>
@ -164,6 +137,15 @@ @@ -164,6 +137,15 @@
</property>
<widget class="QWidget" name="tabOptionPage1">
<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>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
@ -180,8 +162,8 @@ @@ -180,8 +162,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>474</width>
<height>646</height>
<width>480</width>
<height>672</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
@ -519,6 +501,15 @@ @@ -519,6 +501,15 @@
</widget>
<widget class="QWidget" name="tabOptionPage2">
<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>
<widget class="QScrollArea" name="scrollArea_2">
<property name="widgetResizable">
@ -1026,6 +1017,15 @@ @@ -1026,6 +1017,15 @@
</widget>
<widget class="QWidget" name="tabOptionPage3">
<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>
<widget class="QScrollArea" name="scrollArea_3">
<property name="widgetResizable">
@ -1036,8 +1036,8 @@ @@ -1036,8 +1036,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>632</height>
<width>480</width>
<height>658</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_20">
@ -1386,12 +1386,12 @@ @@ -1386,12 +1386,12 @@
</item>
<item>
<widget class="QCheckBox" name="isProxyOnlyForTorrents">
<property name="text">
<string>Use proxy only for torrents</string>
</property>
<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>
</property>
<property name="text">
<string>Use proxy only for torrents</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
@ -1540,13 +1540,22 @@ @@ -1540,13 +1540,22 @@
</widget>
</widget>
</item>
<item>
<layout class="QVBoxLayout"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_2">
<widget class="QWidget" name="tabSpeedPage">
<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>
<widget class="QScrollArea" name="scrollArea_9">
<property name="widgetResizable">
@ -1557,400 +1566,347 @@ @@ -1557,400 +1566,347 @@
<rect>
<x>0</x>
<y>0</y>
<width>376</width>
<height>431</height>
<width>502</width>
<height>538</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGroupBox" name="bandwidthBox">
<widget class="QGroupBox" name="rateLimitBox">
<property name="title">
<string>Global Rate Limits</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<layout class="QGridLayout" name="rateLimitBoxLayout">
<item row="0" column="2">
<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">
<string notr="true"/>
<string>KiB/s</string>
</property>
</widget>
</item>
<item row="0" column="0" rowspan="2">
<widget class="QLabel" name="label_5">
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/slow_off.png</pixmap>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QCheckBox" name="checkUploadLimit">
<property name="text">
<string>Upload:</string>
</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 row="1" column="1">
<widget class="QCheckBox" name="checkDownloadLimit">
<property name="text">
<string>Download:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer>
<item row="0" column="4">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>200</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2">
<widget class="QGroupBox" name="groupBox_5">
</layout>
</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">
<string>Options</string>
<string>Schedule the use of alternative rate limits</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
<item>
<widget class="QCheckBox" name="checkuTP">
<property name="checkable">
<bool>true</bool>
</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">
<string>Enable bandwidth management (uTP)</string>
<string extracomment="from (time1 to time2)">From:</string>
</property>
<property name="checked">
</widget>
</item>
<item row="0" column="3">
<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>
<widget class="QCheckBox" name="checkLimituTPConnections">
<item row="0" column="2">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Apply rate limit to uTP connections</string>
<string extracomment="time1 to time2">To:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkLimitTransportOverhead">
<property name="text">
<string>Apply rate limit to transport overhead</string>
<item row="0" column="1">
<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="QCheckBox" name="checkLimitLocalPeerRate">
<item row="1" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Apply rate limit to peers on LAN</string>
<string>When:</string>
</property>
</widget>
</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>
</widget>
</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>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_6">
<widget class="QGroupBox" name="rateLimitsGroupBox">
<property name="title">
<string>Alternative Global Rate Limits</string>
<string>Rate Limits Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="minimumSize">
<size>
<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>
<layout class="QGridLayout" name="gridLayout_8">
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="checkLimitLocalPeerRate">
<property name="text">
<string>Apply rate limit to peers on LAN</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="check_schedule">
<property name="title">
<string>Schedule the use of alternative rate limits</string>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="checkLimitTransportOverhead">
<property name="text">
<string>Apply rate limit to transport overhead</string>
</property>
<property name="checkable">
<bool>true</bool>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="checkuTP">
<property name="text">
<string>Enable µTP protocol</string>
</property>
<property name="checked">
<bool>false</bool>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkLimituTPConnections">
<property name="text">
<string>Apply rate limit to µTP protocol</string>
</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>
</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>
</widget>
</item>
@ -1975,6 +1931,15 @@ @@ -1975,6 +1931,15 @@
</widget>
<widget class="QWidget" name="tabOptionPage4">
<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>
<widget class="QScrollArea" name="scrollArea_4">
<property name="widgetResizable">
@ -2329,6 +2294,15 @@ @@ -2329,6 +2294,15 @@
</widget>
<widget class="QWidget" name="tabOptionPage7">
<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>
<widget class="QScrollArea" name="scrollArea_7">
<property name="widgetResizable">
@ -2704,8 +2678,17 @@ @@ -2704,8 +2678,17 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="page_3">
<widget class="QWidget" name="tabAdvancedPage">
<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>
<widget class="QScrollArea" name="scrollArea_advanced">
<property name="widgetResizable">
@ -2720,7 +2703,20 @@ @@ -2720,7 +2703,20 @@
<height>28</height>
</rect>
</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>
</item>
@ -2730,34 +2726,11 @@ @@ -2730,34 +2726,11 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</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>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
@ -2893,22 +2866,6 @@ @@ -2893,22 +2866,6 @@
</hint>
</hints>
</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>
<sender>checkMaxUploads</sender>
<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 @@ @@ -34,7 +34,12 @@
#include "ui_options.h"
// actions on double-click on torrents
enum DoubleClickAction {TOGGLE_PAUSE, OPEN_DEST, NO_ACTION};
enum DoubleClickAction
{
TOGGLE_PAUSE,
OPEN_DEST,
NO_ACTION
};
class AdvancedSettings;
@ -42,128 +47,137 @@ QT_BEGIN_NAMESPACE @@ -42,128 +47,137 @@ QT_BEGIN_NAMESPACE
class QCloseEvent;
QT_END_NAMESPACE
class options_imp : public QDialog, private Ui_Preferences {
Q_OBJECT
class options_imp: public QDialog, private Ui_Preferences
{
Q_OBJECT
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:
// Constructor / Destructor
options_imp(QWidget *parent=0);
~options_imp();
// Constructor / Destructor
options_imp(QWidget *parent = 0);
~options_imp();
public slots:
void showConnectionTab();
void showConnectionTab();
signals:
void status_changed() const;
void exitWithCancel();
void status_changed() const;
void exitWithCancel();
private slots:
void enableProxy(int comboIndex);
void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e);
void on_buttonBox_rejected();
void applySettings(QAbstractButton* button);
void enableApplyButton();
void changePage(QListWidgetItem*, QListWidgetItem*);
void loadWindowState();
void saveWindowState() const;
void handleScanFolderViewSelectionChanged();
void on_IpFilterRefreshBtn_clicked();
void handleIPFilterParsed(bool error, int ruleCount);
void on_browseExportDirButton_clicked();
void on_browseExportDirFinButton_clicked();
void on_browseFilterButton_clicked();
void on_browseSaveDirButton_clicked();
void on_browseTempDirButton_clicked();
void on_randomButton_clicked();
void on_addScanFolderButton_clicked();
void on_removeScanFolderButton_clicked();
void on_btnWebUiCrt_clicked();
void on_btnWebUiKey_clicked();
void on_registerDNSBtn_clicked();
void setLocale(const QString &locale);
void enableProxy(int comboIndex);
void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e);
void on_buttonBox_rejected();
void applySettings(QAbstractButton* button);
void enableApplyButton();
void changePage(QListWidgetItem*, QListWidgetItem*);
void loadWindowState();
void saveWindowState() const;
void handleScanFolderViewSelectionChanged();
void on_IpFilterRefreshBtn_clicked();
void handleIPFilterParsed(bool error, int ruleCount);
void on_browseExportDirButton_clicked();
void on_browseExportDirFinButton_clicked();
void on_browseFilterButton_clicked();
void on_browseSaveDirButton_clicked();
void on_browseTempDirButton_clicked();
void on_randomButton_clicked();
void on_addScanFolderButton_clicked();
void on_removeScanFolderButton_clicked();
void on_btnWebUiCrt_clicked();
void on_btnWebUiKey_clicked();
void on_registerDNSBtn_clicked();
void setLocale(const QString &locale);
private:
// Methods
void saveOptions();
void loadOptions();
void initializeLanguageCombo();
static QString languageToLocalizedString(const QLocale &locale);
// General options
QString getLocale() const;
bool systrayIntegration() const;
bool minimizeToTray() const;
bool closeToTray() const;
bool startMinimized() const;
bool isSlashScreenDisabled() const;
bool preventFromSuspend() const;
// Methods
void saveOptions();
void loadOptions();
void initializeLanguageCombo();
static QString languageToLocalizedString(const QLocale &locale);
// General options
QString getLocale() const;
bool systrayIntegration() const;
bool minimizeToTray() const;
bool closeToTray() const;
bool startMinimized() const;
bool isSlashScreenDisabled() const;
bool preventFromSuspend() const;
#ifdef Q_OS_WIN
bool WinStartup() const;
bool WinStartup() const;
#endif
// Downloads
QString getSavePath() const;
bool isTempPathEnabled() const;
QString getTempPath() const;
bool preAllocateAllFiles() const;
bool useAdditionDialog() const;
bool addTorrentsInPause() const;
QString getTorrentExportDir() const;
QString getFinishedTorrentExportDir() const;
QString askForExportDir(const QString& currentExportPath);
int getActionOnDblClOnTorrentDl() const;
int getActionOnDblClOnTorrentFn() const;
// Connection options
int getPort() const;
bool isUPnPEnabled() const;
QPair<int,int> getGlobalBandwidthLimits() const;
QPair<int,int> getAltGlobalBandwidthLimits() const;
// Bittorrent options
int getMaxConnecs() const;
int getMaxConnecsPerTorrent() const;
int getMaxUploads() const;
int getMaxUploadsPerTorrent() const;
bool isDHTEnabled() const;
bool isLSDEnabled() const;
int getEncryptionSetting() const;
qreal getMaxRatio() const;
// Proxy options
bool isProxyEnabled() const;
bool isProxyAuthEnabled() const;
QString getProxyIp() const;
unsigned short getProxyPort() const;
QString getProxyUsername() const;
QString getProxyPassword() const;
int getProxyType() const;
// IP Filter
bool isFilteringEnabled() const;
QString getFilter() const;
bool m_refreshingIpFilter;
// Queueing system
bool isQueueingSystemEnabled() const;
int getMaxActiveDownloads() const;
int getMaxActiveUploads() const;
int getMaxActiveTorrents() const;
bool isWebUiEnabled() const;
quint16 webUiPort() const;
QString webUiUsername() const;
QString webUiPassword() const;
QSize sizeFittingScreen() const;
// Downloads
QString getSavePath() const;
bool isTempPathEnabled() const;
QString getTempPath() const;
bool preAllocateAllFiles() const;
bool useAdditionDialog() const;
bool addTorrentsInPause() const;
QString getTorrentExportDir() const;
QString getFinishedTorrentExportDir() const;
QString askForExportDir(const QString& currentExportPath);
int getActionOnDblClOnTorrentDl() const;
int getActionOnDblClOnTorrentFn() const;
// Connection options
int getPort() const;
bool isUPnPEnabled() const;
QPair<int, int> getGlobalBandwidthLimits() const;
QPair<int, int> getAltGlobalBandwidthLimits() const;
// Bittorrent options
int getMaxConnecs() const;
int getMaxConnecsPerTorrent() const;
int getMaxUploads() const;
int getMaxUploadsPerTorrent() const;
bool isDHTEnabled() const;
bool isLSDEnabled() const;
int getEncryptionSetting() const;
qreal getMaxRatio() const;
// Proxy options
bool isProxyEnabled() const;
bool isProxyAuthEnabled() const;
QString getProxyIp() const;
unsigned short getProxyPort() const;
QString getProxyUsername() const;
QString getProxyPassword() const;
int getProxyType() const;
// IP Filter
bool isFilteringEnabled() const;
QString getFilter() const;
bool m_refreshingIpFilter;
// Queueing system
bool isQueueingSystemEnabled() const;
int getMaxActiveDownloads() const;
int getMaxActiveUploads() const;
int getMaxActiveTorrents() const;
bool isWebUiEnabled() const;
quint16 webUiPort() const;
QString webUiUsername() const;
QString webUiPassword() const;
QSize sizeFittingScreen() const;
private:
void setSslKey(const QByteArray &key, bool interactive = true);
void setSslCertificate(const QByteArray &cert, bool interactive = true);
bool schedTimesOk();
void setSslKey(const QByteArray &key, bool interactive = true);
void setSslCertificate(const QByteArray &cert, bool interactive = true);
bool schedTimesOk();
private:
QButtonGroup choiceLanguage;
QAbstractButton *applyButton;
AdvancedSettings *advancedSettings;
QList<QString> addedScanDirs;
// SSL Cert / key
QByteArray m_sslCert, m_sslKey;
QButtonGroup choiceLanguage;
QAbstractButton *applyButton;
AdvancedSettings *advancedSettings;
QList<QString> addedScanDirs;
// SSL Cert / key
QByteArray m_sslCert, m_sslKey;
};
#endif

Loading…
Cancel
Save