source: trunk/qt/options.h @ 8232

Last change on this file since 8232 was 8232, checked in by charles, 13 years ago

(trunk qt) clean up #includes

File size: 2.5 KB
Line 
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 OPTIONS_DIALOG_H
14#define OPTIONS_DIALOG_H
15
16#include <QDialog>
17#include <QEvent>
18#include <QString>
19#include <QDir>
20#include <QVector>
21#include <QMap>
22#include <QPushButton>
23#include <QStringList>
24#include <QCryptographicHash>
25#include <QFile>
26#include <QTimer>
27
28#include "file-tree.h"
29
30class FileTreeView;
31class Prefs;
32class QCheckBox;
33class Session;
34
35class Options: public QDialog
36{
37        Q_OBJECT
38
39    public:
40        Options( Session& session, const Prefs& prefs, const QString& filename, QWidget * parent = 0 );
41        ~Options( );
42
43    private:
44        void reload( );
45        void clearInfo( );
46        void refreshFileButton( int width=-1 );
47        void refreshDestinationButton( int width=-1 );
48        void refreshButton( QPushButton *, const QString&, int width=-1 );
49
50    private:
51        Session& mySession;
52        QString myFile;
53        QDir myDestination;
54        bool myHaveInfo;
55        tr_info myInfo;
56        FileTreeView * myTree;
57        QCheckBox * myStartCheck;
58        QCheckBox * myTrashCheck;
59        QPushButton * myFileButton;
60        QPushButton * myDestinationButton;
61        QPushButton * myVerifyButton;
62        QVector<int> myPriorities;
63        QVector<bool> myWanted;
64        FileList myFiles;
65
66    private slots:
67        void onAccepted( );
68        void onPriorityChanged( const QSet<int>& fileIndices, int );
69        void onWantedChanged( const QSet<int>& fileIndices, bool );
70        void onVerify( );
71        void onTimeout( );
72        void onFilenameClicked( );
73        void onDestinationClicked( );
74        void onFilesSelected( const QStringList& );
75        void onDestinationsSelected( const QStringList& );
76
77    private:
78        bool eventFilter( QObject *, QEvent * );
79
80    private:
81        QTimer myVerifyTimer;
82        char myVerifyBuf[2048*4];
83        QFile myVerifyFile;
84        uint64_t myVerifyFilePos;
85        int myVerifyFileIndex;
86        uint32_t myVerifyPieceIndex;
87        uint32_t myVerifyPiecePos;
88        void clearVerify( );
89        QVector<bool> myVerifyFlags;
90        QCryptographicHash myVerifyHash;
91        typedef QMap<uint32_t,int32_t> mybins_t;
92        mybins_t myVerifyBins;
93
94};
95
96#endif
Note: See TracBrowser for help on using the repository browser.