|
1 /* |
|
2 * LDForge: LDraw parts authoring CAD |
|
3 * Copyright (C) 2013 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 LDRAWPATHDIALOG_H |
|
20 #define LDRAWPATHDIALOG_H |
|
21 |
|
22 #include <qdialog.h> |
|
23 #include "common.h" |
|
24 |
|
25 class QLabel; |
|
26 class QLineEdit; |
|
27 class QDialogButtonBox; |
|
28 |
|
29 class LDrawPathDialog : public QDialog { |
|
30 Q_OBJECT |
|
31 |
|
32 public: |
|
33 explicit LDrawPathDialog (const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0); |
|
34 str path () const; |
|
35 void setPath (str path); |
|
36 void (*callback ()) () const { return m_callback; } |
|
37 void setCallback (void (*callback) ()) { m_callback = callback; } |
|
38 |
|
39 private: |
|
40 Q_DISABLE_COPY (LDrawPathDialog) |
|
41 |
|
42 QLabel* lb_resolution; |
|
43 QLineEdit* le_path; |
|
44 QPushButton* btn_findPath, *btn_tryConfigure, *btn_cancel; |
|
45 QDialogButtonBox* dbb_buttons; |
|
46 void (*m_callback) (); |
|
47 const bool m_validDefault; |
|
48 |
|
49 QPushButton* okButton (); |
|
50 |
|
51 private slots: |
|
52 void slot_findPath (); |
|
53 void slot_tryConfigure (); |
|
54 void slot_exit (); |
|
55 }; |
|
56 |
|
57 #endif // LDRAWPATHDIALOG_H |