1 | /* |
---|
2 | * This file Copyright (C) 2009-2014 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: make-dialog.h 14378 2014-12-12 23:21:04Z mikedld $ |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef MAKE_DIALOG_H |
---|
11 | #define MAKE_DIALOG_H |
---|
12 | |
---|
13 | #include <QDialog> |
---|
14 | #include <QTimer> |
---|
15 | |
---|
16 | class QAbstractButton; |
---|
17 | class QPlainTextEdit; |
---|
18 | class QLineEdit; |
---|
19 | class QCheckBox; |
---|
20 | class QLabel; |
---|
21 | class QPushButton; |
---|
22 | class QRadioButton; |
---|
23 | class Session; |
---|
24 | class QProgressBar; |
---|
25 | class QDialogButtonBox; |
---|
26 | |
---|
27 | extern "C" |
---|
28 | { |
---|
29 | struct tr_metainfo_builder; |
---|
30 | } |
---|
31 | |
---|
32 | class MakeDialog: public QDialog |
---|
33 | { |
---|
34 | Q_OBJECT |
---|
35 | |
---|
36 | private slots: |
---|
37 | void onSourceChanged (); |
---|
38 | void onButtonBoxClicked (QAbstractButton*); |
---|
39 | void onNewButtonBoxClicked (QAbstractButton*); |
---|
40 | void onNewDialogDestroyed (QObject*); |
---|
41 | void onProgress (); |
---|
42 | |
---|
43 | void onFolderClicked (); |
---|
44 | void onFolderSelected (const QString&); |
---|
45 | void onFolderSelected (const QStringList&); |
---|
46 | |
---|
47 | void onFileClicked (); |
---|
48 | void onFileSelected (const QString&); |
---|
49 | void onFileSelected (const QStringList&); |
---|
50 | |
---|
51 | void onDestinationClicked (); |
---|
52 | void onDestinationSelected (const QString&); |
---|
53 | void onDestinationSelected (const QStringList&); |
---|
54 | |
---|
55 | private: |
---|
56 | void makeTorrent (); |
---|
57 | QString getSource () const; |
---|
58 | void enableBuddyWhenChecked (QCheckBox *, QWidget *); |
---|
59 | void enableBuddyWhenChecked (QRadioButton *, QWidget *); |
---|
60 | |
---|
61 | private: |
---|
62 | Session& mySession; |
---|
63 | QString myDestination; |
---|
64 | QString myTarget; |
---|
65 | QString myFile; |
---|
66 | QString myFolder; |
---|
67 | QTimer myTimer; |
---|
68 | QRadioButton * myFolderRadio; |
---|
69 | QRadioButton * myFileRadio; |
---|
70 | QPushButton * myDestinationButton; |
---|
71 | QPushButton * myFileButton; |
---|
72 | QPushButton * myFolderButton; |
---|
73 | QPlainTextEdit * myTrackerEdit; |
---|
74 | QCheckBox * myCommentCheck; |
---|
75 | QLineEdit * myCommentEdit; |
---|
76 | QCheckBox * myPrivateCheck; |
---|
77 | QLabel * mySourceLabel; |
---|
78 | QDialogButtonBox * myButtonBox; |
---|
79 | QProgressBar * myNewProgress; |
---|
80 | QLabel * myNewLabel; |
---|
81 | QDialogButtonBox * myNewButtonBox; |
---|
82 | QDialog * myNewDialog; |
---|
83 | tr_metainfo_builder * myBuilder; |
---|
84 | |
---|
85 | protected: |
---|
86 | virtual void dragEnterEvent (QDragEnterEvent *); |
---|
87 | virtual void dropEvent (QDropEvent *); |
---|
88 | |
---|
89 | public: |
---|
90 | MakeDialog (Session&, QWidget * parent = 0); |
---|
91 | ~MakeDialog (); |
---|
92 | }; |
---|
93 | |
---|
94 | #endif |
---|