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 * );
74
PrefsDialog( Session&, Prefs&, QWidget * parent = 0 );
78
bool isAllowed( int key ) const;
79
QWidget * createTorrentsTab( );
80
QWidget * createPeersTab( const Session& session );
81
QWidget * createNetworkTab( );
82
QWidget * createBandwidthTab( );
83
QWidget * createWebTab( Session& );
84
QWidget * createTrackerTab( );
87
typedef QMap<int,QWidget*> key2widget_t;
88
key2widget_t myWidgets;
89
const bool myIsServer;
92
QVBoxLayout * myLayout;
94
QPushButton * myPortButton;
95
QPushButton * myWatchButton;
96
QPushButton * myDestinationButton;
97
QWidgetList myWebWidgets;
98
QWidgetList myWebAuthWidgets;
99
QWidgetList myWebWhitelistWidgets;
100
QWidgetList myProxyWidgets;
101
QWidgetList myProxyAuthWidgets;
102
QWidgetList mySchedWidgets;
103
QWidgetList myBlockWidgets;
104
QWidgetList myUnsupportedWhenRemote;
106
int myBlocklistHttpTag;
107
QHttp * myBlocklistHttp;
108
QMessageBox * myBlocklistDialog;