source: trunk/qt/OptionsDialog.h @ 14539

Last change on this file since 14539 was 14539, checked in by mikedld, 6 years ago

Unify/prettify Qt client headers style

  • Property svn:keywords set to Date Rev Author Id
File size: 1.8 KB
Line 
1/*
2 * This file Copyright (C) 2009-2015 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: OptionsDialog.h 14539 2015-06-12 22:12:12Z mikedld $
8 */
9
10#ifndef QTR_OPTIONS_DIALOG_H
11#define QTR_OPTIONS_DIALOG_H
12
13#include <QCryptographicHash>
14#include <QDialog>
15#include <QDir>
16#include <QFile>
17#include <QMap>
18#include <QString>
19#include <QTimer>
20#include <QVector>
21
22#include "AddData.h" // AddData
23#include "Torrent.h" // FileList
24
25#include "ui_OptionsDialog.h"
26
27class Prefs;
28class Session;
29
30extern "C"
31{
32  struct tr_variant;
33}
34
35class OptionsDialog: public QDialog
36{
37    Q_OBJECT
38
39  public:
40    OptionsDialog (Session& session, const Prefs& prefs, const AddData& addme, QWidget * parent = nullptr);
41    virtual ~OptionsDialog ();
42
43  private:
44    typedef QMap<uint32_t, int32_t> mybins_t;
45
46  private:
47    void reload ();
48    void clearInfo ();
49    void clearVerify ();
50
51  private slots:
52    void onAccepted ();
53    void onPriorityChanged (const QSet<int>& fileIndices, int);
54    void onWantedChanged (const QSet<int>& fileIndices, bool);
55    void onVerify ();
56    void onTimeout ();
57
58    void onSourceChanged ();
59    void onDestinationChanged ();
60
61  private:
62    Session& mySession;
63    AddData myAdd;
64
65    Ui::OptionsDialog ui;
66
67    QDir myLocalDestination;
68    bool myHaveInfo;
69    tr_info myInfo;
70    QPushButton * myVerifyButton;
71    QVector<int> myPriorities;
72    QVector<bool> myWanted;
73    FileList myFiles;
74
75    QTimer myVerifyTimer;
76    char myVerifyBuf[2048 * 4];
77    QFile myVerifyFile;
78    uint64_t myVerifyFilePos;
79    int myVerifyFileIndex;
80    uint32_t myVerifyPieceIndex;
81    uint32_t myVerifyPiecePos;
82    QVector<bool> myVerifyFlags;
83    QCryptographicHash myVerifyHash;
84    mybins_t myVerifyBins;
85    QTimer myEditTimer;
86};
87
88#endif // QTR_OPTIONS_DIALOG_H
Note: See TracBrowser for help on using the repository browser.