| |
1 /* |
| |
2 * LDForge: LDraw parts authoring CAD |
| |
3 * Copyright (C) 2013, 2014 Santeri Piippo |
| |
4 * |
| |
5 * This program is free software: you can redistribute it and/or modify |
| |
6 * it under the terms of the GNU General Public License as published by |
| |
7 * the Free Software Foundation, either version 3 of the License, or |
| |
8 * (at your option) any later version. |
| |
9 * |
| |
10 * This program is distributed in the hope that it will be useful, |
| |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
13 * GNU General Public License for more details. |
| |
14 * |
| |
15 * You should have received a copy of the GNU General Public License |
| |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| |
17 */ |
| |
18 |
| |
19 #ifndef LDFORGE_DIALOGS_H |
| |
20 #define LDFORGE_DIALOGS_H |
| |
21 |
| |
22 #include <QDialog> |
| |
23 #include "Main.h" |
| |
24 #include "Types.h" |
| |
25 |
| |
26 class Ui_ExtProgPath; |
| |
27 class QRadioButton; |
| |
28 class QCheckBox; |
| |
29 class QProgressBar; |
| |
30 class QGroupBox; |
| |
31 class QDialogButtonBox; |
| |
32 class QDoubleSpinBox; |
| |
33 class QPushButton; |
| |
34 class QLineEdit; |
| |
35 class QSpinBox; |
| |
36 class RadioGroup; |
| |
37 class QLabel; |
| |
38 class QAbstractButton; |
| |
39 class Ui_OverlayUI; |
| |
40 class Ui_LDPathUI; |
| |
41 class Ui_OpenProgressUI; |
| |
42 |
| |
43 class OverlayDialog : public QDialog |
| |
44 { |
| |
45 Q_OBJECT |
| |
46 |
| |
47 public: |
| |
48 explicit OverlayDialog (QWidget* parent = null, Qt::WindowFlags f = 0); |
| |
49 virtual ~OverlayDialog(); |
| |
50 |
| |
51 QString fpath() const; |
| |
52 int ofsx() const; |
| |
53 int ofsy() const; |
| |
54 double lwidth() const; |
| |
55 double lheight() const; |
| |
56 int camera() const; |
| |
57 |
| |
58 private: |
| |
59 Ui_OverlayUI* ui; |
| |
60 QList<pair<QRadioButton*, int>> m_cameraArgs; |
| |
61 |
| |
62 private slots: |
| |
63 void slot_fpath(); |
| |
64 void slot_help(); |
| |
65 void slot_dimensionsChanged(); |
| |
66 void fillDefaults (int newcam); |
| |
67 }; |
| |
68 |
| |
69 // ============================================================================= |
| |
70 class LDrawPathDialog : public QDialog |
| |
71 { |
| |
72 Q_OBJECT |
| |
73 |
| |
74 public: |
| |
75 explicit LDrawPathDialog (const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0); |
| |
76 virtual ~LDrawPathDialog(); |
| |
77 QString filename() const; |
| |
78 void setPath (QString path); |
| |
79 |
| |
80 private: |
| |
81 Q_DISABLE_COPY (LDrawPathDialog) |
| |
82 const bool m_validDefault; |
| |
83 Ui_LDPathUI* ui; |
| |
84 QPushButton* okButton(); |
| |
85 QPushButton* cancelButton(); |
| |
86 |
| |
87 private slots: |
| |
88 void slot_findPath(); |
| |
89 void slot_tryConfigure(); |
| |
90 void slot_exit(); |
| |
91 void slot_accept(); |
| |
92 }; |
| |
93 |
| |
94 // ============================================================================= |
| |
95 class OpenProgressDialog : public QDialog |
| |
96 { |
| |
97 Q_OBJECT |
| |
98 PROPERTY (public, int, Progress, NUM_OPS, STOCK_WRITE) |
| |
99 PROPERTY (public, int, NumLines, NUM_OPS, CUSTOM_WRITE) |
| |
100 |
| |
101 public: |
| |
102 explicit OpenProgressDialog (QWidget* parent = null, Qt::WindowFlags f = 0); |
| |
103 virtual ~OpenProgressDialog(); |
| |
104 |
| |
105 public slots: |
| |
106 void updateProgress (int progress); |
| |
107 |
| |
108 private: |
| |
109 Ui_OpenProgressUI* ui; |
| |
110 |
| |
111 void updateValues(); |
| |
112 }; |
| |
113 |
| |
114 // ============================================================================= |
| |
115 class ExtProgPathPrompt : public QDialog |
| |
116 { |
| |
117 Q_OBJECT |
| |
118 |
| |
119 public: |
| |
120 explicit ExtProgPathPrompt (QString progName, QWidget* parent = 0, Qt::WindowFlags f = 0); |
| |
121 virtual ~ExtProgPathPrompt(); |
| |
122 QString getPath() const; |
| |
123 |
| |
124 public slots: |
| |
125 void findPath(); |
| |
126 |
| |
127 private: |
| |
128 Ui_ExtProgPath* ui; |
| |
129 }; |
| |
130 |
| |
131 // ============================================================================= |
| |
132 class AboutDialog : public QDialog |
| |
133 { |
| |
134 Q_OBJECT |
| |
135 |
| |
136 public: |
| |
137 AboutDialog (QWidget* parent = null, Qt::WindowFlags f = 0); |
| |
138 |
| |
139 private slots: |
| |
140 void slot_mail(); |
| |
141 }; |
| |
142 |
| |
143 void bombBox (const QString& message); |
| |
144 |
| |
145 #endif // LDFORGE_DIALOGS_H |