2
* This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
4
* This file is licensed by the GPL version 2. Works owned by the
5
* Transmission project are granted a special exemption to clause 2(b)
6
* so that the bulk of its code can remain under the MIT license.
7
* This exemption does not extend to derived works not owned by
8
* the Transmission project.
13
#ifndef PREFS_DIALOG_H
14
#define PREFS_DIALOG_H
20
class QAbstractButton;
38
class PrefsDialog: public QDialog
43
void checkBoxToggled( bool checked );
44
void spinBoxChanged( int value );
45
void doubleSpinBoxChanged( double value );
46
void spinBoxChangedIdle( );
47
void timeChanged( const QTime& );
48
void textChanged( const QString& );
49
void updatePref( int key );
50
void encryptionEdited( int );
51
void altSpeedDaysEdited( int );
52
void sessionUpdated( );
53
void onWatchClicked( );
54
void onWatchSelected( const QStringList& );
55
void onDestinationClicked( );
56
void onDestinationSelected( const QStringList& );
57
void onPortTested( bool );
60
void onUpdateBlocklistClicked( );
61
void onUpdateBlocklistCancelled( );
62
void onBlocklistDialogDestroyed( QObject * );
63
void onBlocklistUpdated( int n );
66
QDoubleSpinBox * doubleSpinBoxNew( int key, double low, double high, double step, int decimals );
67
QCheckBox * checkBoxNew( const QString& text, int key );
68
QSpinBox * spinBoxNew( int key, int low, int high, int step );
69
QTimeEdit * timeEditNew( int key );
70
QLineEdit * lineEditNew( int key, int mode = 0 );
71
void enableBuddyWhenChecked( QCheckBox *, QWidget * );
72
void updateBlocklistCheckBox( );
75
PrefsDialog( Session&, Prefs&, QWidget * parent = 0 );
79
bool isAllowed( int key ) const;
80
QWidget * createTorrentsTab( );
81
QWidget * createPeersTab( );
82
QWidget * createNetworkTab( );
83
QWidget * createBandwidthTab( );
84
QWidget * createWebTab( Session& );
85
QWidget * createTrackerTab( );
88
typedef QMap<int,QWidget*> key2widget_t;
89
key2widget_t myWidgets;
90
const bool myIsServer;
93
QVBoxLayout * myLayout;
95
QPushButton * myPortButton;
96
QPushButton * myWatchButton;
97
QPushButton * myDestinationButton;
98
QWidgetList myWebWidgets;
99
QWidgetList myWebAuthWidgets;
100
QWidgetList myWebWhitelistWidgets;
101
QWidgetList myProxyWidgets;
102
QWidgetList myProxyAuthWidgets;
103
QWidgetList mySchedWidgets;
104
QWidgetList myBlockWidgets;
105
QWidgetList myUnsupportedWhenRemote;
107
int myBlocklistHttpTag;
108
QHttp * myBlocklistHttp;
109
QMessageBox * myBlocklistDialog;