Wed, 04 Mar 2015 15:37:21 +0200
- commit work done on projects
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
927
409b82a4765e
- bump copyright year
Teemu Piippo <crimsondusk64@gmail.com>
parents:
882
diff
changeset
|
3 | * Copyright (C) 2013 - 2015 Teemu Piippo |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #pragma once |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
20 | #include <functional> |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | #include <QMainWindow> |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include <QAction> |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include <QListWidget> |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | #include <QRadioButton> |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | #include "configuration.h" |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | #include "ldObject.h" |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | #include "ui_ldforge.h" |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
28 | #include "colors.h" |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | class MessageManager; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | class MainWindow; |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
32 | class LDColorData; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | class QToolButton; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | class QDialogButtonBox; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | class GLRenderer; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | class QComboBox; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | class QProgressBar; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | class Ui_LDForgeUI; |
790
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
39 | class Primitive; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | // Stuff for dialogs |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | #define IMPLEMENT_DIALOG_BUTTONS \ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); \ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | connect (bbx_buttons, SIGNAL (accepted()), this, SLOT (accept())); \ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject())); \ |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | class LDQuickColor |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | { |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
49 | PROPERTY (public, LDColor, color, setColor, STOCK_WRITE) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | PROPERTY (public, QToolButton*, toolButton, setToolButton, STOCK_WRITE) |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | public: |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
53 | LDQuickColor (LDColor color, QToolButton* toolButton); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
54 | bool isSeparator() const; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | static LDQuickColor getSeparator(); |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | |
794 | 59 | // |
60 | // Object list class for MainWindow | |
61 | // | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
62 | class ObjectList : public QListWidget |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
63 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | Q_OBJECT |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | protected: |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | void contextMenuEvent (QContextMenuEvent* ev); |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
68 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
69 | |
794 | 70 | // |
71 | // LDForge's main GUI class. | |
72 | // | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
73 | class MainWindow : public QMainWindow |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
74 | { |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
75 | Q_OBJECT |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | |
794 | 77 | public: |
78 | explicit MainWindow (QWidget* parent = null, Qt::WindowFlags flags = 0); | |
857
e62983881460
- fixed crash-on-exit (simply by not running full destruction processing during program termination)
Teemu Piippo <crimsondusk64@gmail.com>
parents:
844
diff
changeset
|
79 | ~MainWindow(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
80 | |
794 | 81 | // Rebuilds the object list. |
82 | void buildObjList(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | |
794 | 84 | // Updates the window title. |
85 | void updateTitle(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
86 | |
794 | 87 | // Builds the object list and tells the GL renderer to init a full |
88 | // refresh. | |
89 | void doFullRefresh(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
90 | |
794 | 91 | // Builds the object list and tells the GL renderer to do a soft update. |
92 | void refresh(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
93 | |
794 | 94 | // Returns the suggested position to place a new object at. |
95 | int getInsertionPoint(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | |
794 | 97 | // Updates the quick color toolbar |
98 | void updateColorToolbar(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | |
794 | 100 | // Rebuilds the recent files submenu |
101 | void updateRecentFilesMenu(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | |
794 | 103 | // Sets the selection based on what's selected in the object list. |
104 | void updateSelection(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | |
794 | 106 | // Updates the grids, selects the selected grid and deselects others. |
107 | void updateGridToolBar(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | |
794 | 109 | // Updates the edit modes, current one is selected and others are deselected. |
110 | void updateEditModeActions(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | |
794 | 112 | // Rebuilds the document tab list. |
113 | void updateDocumentList(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
114 | |
794 | 115 | // Updates the document tab for \c doc. If no such tab exists, the |
116 | // document list is rebuilt instead. | |
117 | void updateDocumentListItem (LDDocumentPtr doc); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
118 | |
794 | 119 | // Returns the uniform selected color (i.e. 4 if everything selected is |
120 | // red), -1 if there is no such consensus. | |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
121 | LDColor getSelectedColor(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | |
794 | 123 | // Automatically scrolls the object list so that it points to the first |
124 | // selected object. | |
125 | void scrollToSelection(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
126 | |
794 | 127 | // Spawns the context menu at the given position. |
128 | void spawnContextMenu (const QPoint pos); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
129 | |
794 | 130 | // Deletes all selected objects, returns the count of deleted objects. |
131 | int deleteSelection(); | |
132 | ||
133 | // Deletes all objects by the given color number. | |
795
195fa1fff9c3
- changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
794
diff
changeset
|
134 | void deleteByColor (LDColor color); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | |
794 | 136 | // Tries to save the given document. |
137 | bool save (LDDocumentPtr doc, bool saveAs); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
138 | |
794 | 139 | // Updates various actions, undo/redo are set enabled/disabled where |
140 | // appropriate, togglable actions are updated based on configuration, | |
141 | // etc. | |
142 | void updateActions(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
143 | |
794 | 144 | // Returns a pointer to the renderer |
145 | inline GLRenderer* R() | |
146 | { | |
147 | return m_renderer; | |
148 | } | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
149 | |
794 | 150 | // Sets the quick color list to the given list of colors. |
151 | inline void setQuickColors (const QList<LDQuickColor>& colors) | |
152 | { | |
153 | m_quickColors = colors; | |
154 | updateColorToolbar(); | |
155 | } | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
156 | |
794 | 157 | // Adds a message to the renderer's message manager. |
158 | void addMessage (QString msg); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
159 | |
794 | 160 | // Updates the object list. Right now this just rebuilds it. |
161 | void refreshObjectList(); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
162 | |
794 | 163 | void endAction(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
164 | |
794 | 165 | inline QTreeWidget* getPrimitivesTree() const |
166 | { | |
167 | return ui->primitives; | |
168 | } | |
790
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
169 | |
806
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
170 | static QKeySequence defaultShortcut (QAction* act); |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
171 | void loadShortcuts (QSettings const* settings); |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
172 | void saveShortcuts (QSettings* settings); |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
173 | void applyToActions (std::function<void(QAction*)> function); |
4240f47aa2d4
- moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
804
diff
changeset
|
174 | |
866
4951b737f8cb
- now able to spawn partial circular primitives
Teemu Piippo <crimsondusk64@gmail.com>
parents:
865
diff
changeset
|
175 | bool ringToolHiRes() const; |
4951b737f8cb
- now able to spawn partial circular primitives
Teemu Piippo <crimsondusk64@gmail.com>
parents:
865
diff
changeset
|
176 | int ringToolSegments() const; |
865
6d68840fcb26
- circle mode can now do hi-res
Teemu Piippo <crimsondusk64@gmail.com>
parents:
861
diff
changeset
|
177 | |
794 | 178 | public slots: |
179 | void updatePrimitives(); | |
180 | void changeCurrentFile(); | |
798
88d4973cfe1a
- added close buttons to tabs
Santeri Piippo <crimsondusk64@gmail.com>
parents:
795
diff
changeset
|
181 | void closeTab (int tabindex); |
866
4951b737f8cb
- now able to spawn partial circular primitives
Teemu Piippo <crimsondusk64@gmail.com>
parents:
865
diff
changeset
|
182 | void ringToolHiResClicked (bool clicked); |
871
a860edb4210b
- display a label next to the spinbox showing the fraction
Teemu Piippo <crimsondusk64@gmail.com>
parents:
866
diff
changeset
|
183 | void circleToolSegmentsChanged(); |
929
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
184 | void actionTriggered(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
185 | void actionNew(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
186 | void actionNewFile(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
187 | void actionOpen(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
188 | void actionDownloadFrom(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
189 | void actionSave(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
190 | void actionSaveAs(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
191 | void actionSaveAll(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
192 | void actionClose(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
193 | void actionCloseAll(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
194 | void actionInsertFrom(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
195 | void actionExportTo(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
196 | void actionSettings(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
197 | void actionSetLDrawPath(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
198 | void actionScanPrimitives(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
199 | void actionExit(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
200 | void actionResetView(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
201 | void actionAxes(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
202 | void actionWireframe(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
203 | void actionBFCView(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
204 | void actionSetOverlay(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
205 | void actionClearOverlay(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
206 | void actionScreenshot(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
207 | void actionInsertRaw(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
208 | void actionNewSubfile(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
209 | void actionNewLine(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
210 | void actionNewTriangle(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
211 | void actionNewQuad(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
212 | void actionNewCLine(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
213 | void actionNewComment(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
214 | void actionNewBFC(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
215 | void actionUndo(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
216 | void actionRedo(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
217 | void actionCut(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
218 | void actionCopy(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
219 | void actionPaste(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
220 | void actionDelete(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
221 | void actionSelectAll(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
222 | void actionSelectByColor(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
223 | void actionSelectByType(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
224 | void actionModeDraw(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
225 | void actionModeSelect(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
226 | void actionModeRectangle(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
227 | void actionModeCircle(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
228 | void actionModeMagicWand(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
229 | void actionModeLinePath(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
230 | void actionSetDrawDepth(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
231 | void actionSetColor(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
232 | void actionAutocolor(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
233 | void actionUncolor(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
234 | void actionInline(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
235 | void actionInlineDeep(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
236 | void actionInvert(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
237 | void actionMakePrimitive(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
238 | void actionSplitQuads(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
239 | void actionEditRaw(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
240 | void actionBorders(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
241 | void actionRoundCoordinates(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
242 | void actionVisibilityHide(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
243 | void actionVisibilityReveal(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
244 | void actionVisibilityToggle(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
245 | void actionReplaceCoords(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
246 | void actionFlip(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
247 | void actionDemote(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
248 | void actionYtruder(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
249 | void actionRectifier(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
250 | void actionIntersector(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
251 | void actionIsecalc(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
252 | void actionCoverer(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
253 | void actionEdger2(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
254 | void actionHelp(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
255 | void actionAbout(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
256 | void actionAboutQt(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
257 | void actionGridCoarse(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
258 | void actionGridMedium(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
259 | void actionGridFine(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
260 | void actionEdit(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
261 | void actionMoveUp(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
262 | void actionMoveDown(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
263 | void actionMoveXNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
264 | void actionMoveXPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
265 | void actionMoveYNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
266 | void actionMoveYPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
267 | void actionMoveZNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
268 | void actionMoveZPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
269 | void actionRotateXNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
270 | void actionRotateXPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
271 | void actionRotateYNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
272 | void actionRotateYPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
273 | void actionRotateZNeg(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
274 | void actionRotateZPos(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
275 | void actionRotationPoint(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
276 | void actionAddHistoryLine(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
277 | void actionJumpTo(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
278 | void actionSubfileSelection(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
279 | void actionDrawAngles(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
280 | void actionRandomColors(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
281 | void actionOpenSubfiles(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
282 | void actionSplitLines(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
283 | void actionDrawSurfaces(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
284 | void actionDrawEdgeLines(); |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
285 | void actionDrawConditionalLines(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
286 | |
794 | 287 | protected: |
288 | void closeEvent (QCloseEvent* ev); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
289 | |
794 | 290 | private: |
291 | GLRenderer* m_renderer; | |
929
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
292 | LDObjectList m_selection; |
794 | 293 | QList<LDQuickColor> m_quickColors; |
294 | QList<QToolButton*> m_colorButtons; | |
295 | QList<QAction*> m_recentFiles; | |
929
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
296 | MessageManager* m_messageLog; |
794 | 297 | Ui_LDForgeUI* ui; |
929
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
298 | QTabBar* m_tabBar; |
66e8453e1768
- refactor MainWindow a tad
Teemu Piippo <crimsondusk64@gmail.com>
parents:
928
diff
changeset
|
299 | bool m_isUpdatingTabs; |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
300 | |
794 | 301 | private slots: |
302 | void slot_selectionChanged(); | |
303 | void slot_recentFile(); | |
304 | void slot_quickColor(); | |
305 | void slot_lastSecondCleanup(); | |
306 | void slot_editObject (QListWidgetItem* listitem); | |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
307 | }; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
308 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
309 | //! Pointer to the instance of MainWindow. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
310 | extern MainWindow* g_win; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
311 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
312 | //! Get an icon by name from the resources directory. |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
313 | QPixmap GetIcon (QString iconName); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
314 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
315 | //! \returns a list of quick colors based on the configuration entry. |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
316 | QList<LDQuickColor> LoadQuickColorList(); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
317 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
318 | //! Asks the user a yes/no question with the given \c message and the given |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
319 | //! window \c title. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
320 | //! \returns true if the user answered yes, false if no. |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
321 | bool Confirm (const QString& title, const QString& message); // Generic confirm prompt |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
322 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
323 | //! An overload of \c confirm(), this asks the user a yes/no question with the |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
324 | //! given \c message. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
325 | //! \returns true if the user answered yes, false if no. |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
326 | bool Confirm (const QString& message); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
327 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
328 | //! Displays an error prompt with the given \c message |
882
2f3cc8e045d5
- fixed compilation on windows
Teemu Piippo <crimsondusk64@gmail.com>
parents:
876
diff
changeset
|
329 | void Critical (const QString& message); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
330 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
331 | //! Makes an icon of \c size x \c size pixels to represent \c colinfo |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
332 | QIcon MakeColorIcon (LDColor colinfo, const int size); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
333 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
334 | //! Fills the given combo-box with color information |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
335 | void MakeColorComboBox (QComboBox* box); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
336 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
337 | //! \returns a QImage from the given raw GL \c data |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
338 | QImage GetImageFromScreencap (uchar* data, int w, int h); |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
339 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
340 | //! |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
341 | //! Takes in pairs of radio buttons and respective values and finds the first |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
342 | //! selected one. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
343 | //! \returns returns the value of the first found radio button that was checked |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
344 | //! \returns by the user. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
345 | //! |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
346 | template<class T> |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
347 | T RadioSwitch (const T& defval, QList<Pair<QRadioButton*, T>> haystack) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
348 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
349 | for (Pair<QRadioButton*, const T&> i : haystack) |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
350 | { |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
351 | if (i.first->isChecked()) |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
352 | return i.second; |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
353 | } |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
354 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
355 | return defval; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
356 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
357 | |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
358 | //! |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
359 | //! Takes in pairs of radio buttons and respective values and checks the first |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
360 | //! found radio button whose respsective value matches \c expr have the given value. |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
361 | //! |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
362 | template<class T> |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
363 | void RadioDefault (const T& expr, QList<Pair<QRadioButton*, T>> haystack) |
655
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
364 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
365 | for (Pair<QRadioButton*, const T&> i : haystack) |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
366 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
367 | if (i.second == expr) |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
368 | { |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
369 | i.first->setChecked (true); |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
370 | return; |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
371 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
372 | } |
b376645315ab
- renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
373 | } |
790
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
374 | |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
375 | // ============================================================================= |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
376 | // |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
377 | class SubfileListItem : public QTreeWidgetItem |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
378 | { |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
379 | PROPERTY (public, Primitive*, primitive, setPrimitive, STOCK_WRITE) |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
380 | |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
381 | public: |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
382 | SubfileListItem (QTreeWidgetItem* parent, Primitive* info) : |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
383 | QTreeWidgetItem (parent), |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
384 | m_primitive (info) {} |
790
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
385 | |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
386 | SubfileListItem (QTreeWidget* parent, Primitive* info) : |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
387 | QTreeWidgetItem (parent), |
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
388 | m_primitive (info) {} |
790
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
389 | }; |
fe1b83f6ba82
- added primitives toolbox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
789
diff
changeset
|
390 | |
861
83426c5fa732
- major identifier renaming
Teemu Piippo <crimsondusk64@gmail.com>
parents:
857
diff
changeset
|
391 | void PopulatePrimitives (QTreeWidget* tw, const QString& selectByDefault = QString()); |