~hendrik-grewe/transmission/private-patch

« back to all changes in this revision

Viewing changes to qt/prefs-dialog.h

  • Committer: charles
  • Date: 2009-04-09 17:55:47 UTC
  • Revision ID: svn-v4:f4695dd4-2c0a-0410-b89c-da849a56a58e:trunk:8188
(trunk) add the Qt beta into svn 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file Copyright (C) 2009 Charles Kerr <charles@transmissionbt.com>
 
3
 *
 
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.
 
9
 *
 
10
 * $Id:$
 
11
 */
 
12
 
 
13
#ifndef PREFS_DIALOG_H
 
14
#define PREFS_DIALOG_H
 
15
 
 
16
#include <QDialog>
 
17
#include <QSet>
 
18
#include "prefs.h"
 
19
 
 
20
class QAbstractButton;
 
21
class QCheckBox;
 
22
class QString;
 
23
class QDoubleSpinBox;
 
24
class QSpinBox;
 
25
class QLabel;
 
26
class QLineEdit;
 
27
class QVBoxLayout;
 
28
class QTime;
 
29
class QTimeEdit;
 
30
class QWidget;
 
31
class QPushButton;
 
32
class QMessageBox;
 
33
class QHttp;
 
34
 
 
35
class Prefs;
 
36
class Session;
 
37
 
 
38
class PrefsDialog: public QDialog
 
39
{
 
40
        Q_OBJECT
 
41
 
 
42
    private slots:
 
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 );
 
58
        void onPortTest( );
 
59
 
 
60
        void onUpdateBlocklistClicked( );
 
61
        void onUpdateBlocklistCancelled( );
 
62
        void onBlocklistDialogDestroyed( QObject * );
 
63
        void onBlocklistUpdated( int n );
 
64
 
 
65
    private:
 
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
 
 
73
    public:
 
74
        PrefsDialog( Session&, Prefs&, QWidget * parent = 0 );
 
75
        ~PrefsDialog( );
 
76
 
 
77
    private:
 
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( );
 
85
 
 
86
    private:
 
87
        typedef QMap<int,QWidget*> key2widget_t;
 
88
        key2widget_t myWidgets;
 
89
        const bool myIsServer;
 
90
        Session& mySession;
 
91
        Prefs& myPrefs;
 
92
        QVBoxLayout * myLayout;
 
93
        QLabel * myPortLabel;
 
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;
 
105
 
 
106
        int myBlocklistHttpTag;
 
107
        QHttp * myBlocklistHttp;
 
108
        QMessageBox * myBlocklistDialog;
 
109
};
 
110
 
 
111
#endif