Thu, 04 Jul 2013 22:40:11 +0300
Converted ldraw path prompt
241
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
1 | /* |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
3 | * Copyright (C) 2013 Santeri Piippo |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
4 | * |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
8 | * (at your option) any later version. |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
9 | * |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
13 | * GNU General Public License for more details. |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
14 | * |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
17 | */ |
cffab8e109f6
Added LICENSE.icons to help clarity on the licensing of the icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
18 | |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #ifndef DIALOGS_H |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #define DIALOGS_H |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include <QDialog> |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "common.h" |
262
56f8987f4c7c
Fixed behavior of mid-button vertex selector, add ability to all-replace and relative moving to replace coords
Santeri Piippo <crimsondusk64@gmail.com>
parents:
259
diff
changeset
|
24 | #include "types.h" |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
26 | class QRadioButton; |
262
56f8987f4c7c
Fixed behavior of mid-button vertex selector, add ability to all-replace and relative moving to replace coords
Santeri Piippo <crimsondusk64@gmail.com>
parents:
259
diff
changeset
|
27 | class QCheckBox; |
248
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
28 | class QProgressBar; |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
202
diff
changeset
|
29 | class QGroupBox; |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | class QDialogButtonBox; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | class QDoubleSpinBox; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | class QPushButton; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | class QLineEdit; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | class QSpinBox; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | class RadioBox; |
202
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
200
diff
changeset
|
36 | class CheckBoxGroup; |
199
10dd5909a50e
Made Qt file includes more proper (<QLineEdit> instead of <qlineedit.h>), merged setContentsDialog.cpp into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
37 | class QLabel; |
10dd5909a50e
Made Qt file includes more proper (<QLineEdit> instead of <qlineedit.h>), merged setContentsDialog.cpp into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
38 | class QAbstractButton; |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
39 | class Ui_OverlayUI; |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
40 | class Ui_LDPathUI; |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
42 | class OverlayDialog : public QDialog |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
43 | { |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | Q_OBJECT |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
45 | |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | public: |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
47 | explicit OverlayDialog( QWidget* parent = null, Qt::WindowFlags f = 0 ); |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
48 | virtual ~OverlayDialog(); |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
50 | str fpath() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
51 | ushort ofsx() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
52 | ushort ofsy() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
53 | double lwidth() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
54 | double lheight() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
55 | int camera() const; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
56 | |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | private: |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
58 | Ui_OverlayUI* ui; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
59 | vector<pair<QRadioButton*, int>> m_cameraArgs; |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
60 | |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | private slots: |
335
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
62 | void slot_fpath(); |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
63 | void slot_help(); |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
64 | void slot_dimensionsChanged(); |
30c11cff511d
Converted overlay prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
333
diff
changeset
|
65 | void fillDefaults( int newcam ); |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | }; |
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | |
199
10dd5909a50e
Made Qt file includes more proper (<QLineEdit> instead of <qlineedit.h>), merged setContentsDialog.cpp into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
68 | // ============================================================================= |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
69 | class LDrawPathDialog : public QDialog |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
70 | { |
200
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
71 | Q_OBJECT |
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
72 | |
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
73 | public: |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
74 | explicit LDrawPathDialog( const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0 ); |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
75 | virtual ~LDrawPathDialog(); |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
76 | str filename() const; |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
77 | void setPath( str path ); |
200
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
78 | |
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
79 | private: |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
80 | Q_DISABLE_COPY( LDrawPathDialog ) |
200
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
81 | const bool m_validDefault; |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
82 | Ui_LDPathUI* ui; |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
83 | QPushButton* okButton(); |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
84 | QPushButton* cancelButton(); |
200
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
85 | |
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
86 | private slots: |
337
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
87 | void slot_findPath(); |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
88 | void slot_tryConfigure(); |
4e05207c76c9
Converted ldraw path prompt
Santeri Piippo <crimsondusk64@gmail.com>
parents:
335
diff
changeset
|
89 | void slot_exit(); |
200
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
90 | }; |
5583af82087e
Merged new part and LDraw path dialogs into dialogs.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents:
199
diff
changeset
|
91 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
202
diff
changeset
|
92 | // ============================================================================= |
249
6b2cc2d82ba6
Use QMutex for the thread locking, remove filename from the progress dialog since it's not known anyway
Santeri Piippo <crimsondusk64@gmail.com>
parents:
248
diff
changeset
|
93 | class OpenProgressDialog : public QDialog { |
248
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
94 | Q_OBJECT |
266
12e7302f14e9
Make LDObject's color and parent properties with accessors
Santeri Piippo <crimsondusk64@gmail.com>
parents:
262
diff
changeset
|
95 | READ_PROPERTY (ulong, progress, setProgress) |
274
d232fe4d88a6
Reworked properties a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
96 | DECLARE_PROPERTY (ulong, numLines, setNumLines) |
248
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
97 | |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
98 | public: |
249
6b2cc2d82ba6
Use QMutex for the thread locking, remove filename from the progress dialog since it's not known anyway
Santeri Piippo <crimsondusk64@gmail.com>
parents:
248
diff
changeset
|
99 | explicit OpenProgressDialog (QWidget* parent = null, Qt::WindowFlags f = 0); |
248
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
100 | |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
101 | public slots: |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
102 | void updateProgress (int progress); |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
103 | |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
104 | private: |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
105 | QProgressBar* progressBar; |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
106 | QLabel* progressText; |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
107 | |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
108 | void updateValues (); |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
109 | }; |
4431371f3ffe
Added a progress dialog for file loading to respond to desktops while loading files. With large files the no-response policy could be a bad thing. My first real use case of multi-threading...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
241
diff
changeset
|
110 | |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | #endif // DIALOGS_H |