Mon, 22 Apr 2013 16:30:33 +0300
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
104 | 3 | * Copyright (C) 2013 Santeri Piippo |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #include <qfiledialog.h> |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #include <qmessagebox.h> |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | #include "gui.h" |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include "file.h" |
123
a54d9d5c0c1f
Added the about dialog.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
23 | #include "history.h" |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | #include "zz_newPartDialog.h" |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | #include "zz_configDialog.h" |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | #include "zz_addObjectDialog.h" |
123
a54d9d5c0c1f
Added the about dialog.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
27 | #include "zz_aboutDialog.h" |
125
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
28 | #include "misc.h" |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | ACTION (newFile, "&New", "brick", "Create a new part model.", CTRL (N)) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | NewPartDialog::StaticDialog (); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | ACTION (open, "&Open", "file-open", "Load a part model from a file.", CTRL (O)) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | str zName; |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | zName += QFileDialog::getOpenFileName (g_ForgeWindow, "Open File", |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | "", "LDraw files (*.dat *.ldr)"); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | if (~zName) |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | openMainFile (zName); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
47 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | // ============================================================================= |
128
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
52 | void doSave (bool saveAs) { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
53 | str path = g_CurrentFile->zFileName; |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
54 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
55 | if (~path == 0 || saveAs) { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
56 | path = QFileDialog::getSaveFileName (g_ForgeWindow, "Save As", |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | "", "LDraw files (*.dat *.ldr)"); |
128
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
58 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
59 | if (~path == 0) { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
60 | // User didn't give a file name. This happens if the user cancelled |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
61 | // saving in the save file dialog. Abort. |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
62 | return; |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
63 | } |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
64 | } |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | |
128
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
66 | if (g_CurrentFile->save (path)) { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
67 | g_CurrentFile->zFileName = path; |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
68 | g_ForgeWindow->setTitle (); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
69 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
70 | logf ("Saved successfully to %s\n", path.chars ()); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
71 | } else { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
72 | setlocale (LC_ALL, "C"); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
73 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
74 | // Tell the user the save failed, and give the option for saving as with it. |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
75 | QMessageBox dlg (QMessageBox::Warning, "Save Failure", |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
76 | format ("Failed to save to %s\nReason: %s", path.chars(), strerror (g_CurrentFile->lastError)), |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
77 | QMessageBox::Close, g_ForgeWindow); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
78 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
79 | QPushButton* saveAsBtn = new QPushButton ("Save As"); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
80 | saveAsBtn->setIcon (getIcon ("file-save-as")); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
81 | dlg.addButton (saveAsBtn, QMessageBox::ActionRole); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
82 | dlg.setDefaultButton (QMessageBox::Close); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
83 | dlg.exec (); |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
84 | |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
85 | if (dlg.clickedButton () == saveAsBtn) |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
86 | doSave (true); // yay recursion! |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
87 | } |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
88 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
89 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
90 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
91 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
92 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
93 | ACTION (save, "&Save", "file-save", "Save the part model.", CTRL (S)) { |
128
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
94 | doSave (false); |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
98 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | // ============================================================================= |
128
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
100 | ACTION (saveAs, "Save &As", "file-save-as", "Save the part model to a specific file.", CTRL_SHIFT (S)) { |
73a7edf82ca9
Warn for save failures with the save and save as actions, also provide with a button to save the file under a different name.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
125
diff
changeset
|
101 | doSave (true); |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
104 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
106 | // ============================================================================= |
99
920d51fec412
Recent files are now remembered and displayed in a submenu
Santeri Piippo <crimsondusk64@gmail.com>
parents:
97
diff
changeset
|
107 | ACTION (settings, "Settin&gs", "settings", "Edit the settings of " APPNAME_DISPLAY ".", (0)) { |
100
e40358266290
Added user-configurable quick-coloring toolbar for.. quick coloring.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
99
diff
changeset
|
108 | ConfigDialog::staticDialog (); |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
110 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
112 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
113 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
114 | ACTION (exit, "&Exit", "exit", "Close " APPNAME_DISPLAY ".", CTRL (Q)) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
115 | exit (0); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
116 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
117 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
118 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
119 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
120 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
121 | ACTION (newSubfile, "New Subfile", "add-subfile", "Creates a new subfile reference.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
123 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
124 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
125 | ACTION (newLine, "New Line", "add-line", "Creates a new line.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
126 | AddObjectDialog::staticDialog (OBJ_Line, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
127 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
128 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
129 | ACTION (newTriangle, "New Triangle", "add-triangle", "Creates a new triangle.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
130 | AddObjectDialog::staticDialog (OBJ_Triangle, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
131 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
132 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
133 | ACTION (newQuad, "New Quadrilateral", "add-quad", "Creates a new quadrilateral.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
134 | AddObjectDialog::staticDialog (OBJ_Quad, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
136 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
137 | ACTION (newCondLine, "New Conditional Line", "add-condline", "Creates a new conditional line.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
138 | AddObjectDialog::staticDialog (OBJ_CondLine, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
139 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
140 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
141 | ACTION (newComment, "New Comment", "add-comment", "Creates a new comment.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
142 | AddObjectDialog::staticDialog (OBJ_Comment, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
143 | } |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
144 | |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
145 | ACTION (newVertex, "New Vertex", "add-vertex", "Creates a new vertex.", 0) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
146 | AddObjectDialog::staticDialog (OBJ_Vertex, g_ForgeWindow); |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
147 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
148 | |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
149 | ACTION (newRadial, "New Radial", "add-radial", "Creates a new radial.", 0) { |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
150 | AddObjectDialog::staticDialog (OBJ_Radial, g_ForgeWindow); |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
151 | } |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
152 | |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
153 | ACTION (help, "Help", "help", "Shows the " APPNAME_DISPLAY " help manual.", KEY (F1)) { |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
154 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
155 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
156 | |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
157 | // ============================================================================= |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
158 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
159 | // ============================================================================= |
80
fd61b467ff99
Added an icon for the 'about Qt' action. Let's hope Digia doesn't tear me apart for my horrible recreation of the Qt logo. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
79
diff
changeset
|
160 | ACTION (about, "About " APPNAME_DISPLAY, "ldforge", |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
161 | "Shows information about " APPNAME_DISPLAY ".", CTRL (F1)) |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
162 | { |
123
a54d9d5c0c1f
Added the about dialog.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
163 | AboutDialog dlg; |
a54d9d5c0c1f
Added the about dialog.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
111
diff
changeset
|
164 | dlg.exec (); |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
165 | } |
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
166 | |
80
fd61b467ff99
Added an icon for the 'about Qt' action. Let's hope Digia doesn't tear me apart for my horrible recreation of the Qt logo. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
79
diff
changeset
|
167 | ACTION (aboutQt, "About Qt", "qt", "Shows information about Qt.", CTRL_SHIFT (F1)) { |
79
f8917e9d07f6
Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
168 | QMessageBox::aboutQt (g_ForgeWindow); |
97
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
169 | } |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
170 | |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
171 | // ============================================================================= |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
172 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
173 | // ============================================================================= |
109
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
174 | ACTION (selectByColor, "Select by Color", "select-color", |
110
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
175 | "Select all objects by the given color.", CTRL_SHIFT (A)) |
109
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
176 | { |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
177 | short dColor = g_ForgeWindow->getSelectedColor (); |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
178 | |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
179 | if (dColor == -1) |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
180 | return; // no consensus on color |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
181 | |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
182 | g_ForgeWindow->paSelection.clear (); |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
183 | for (LDObject* obj : g_CurrentFile->objects) |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
184 | if (obj->dColor == dColor) |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
185 | g_ForgeWindow->paSelection.push_back (obj); |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
186 | |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
187 | g_ForgeWindow->updateSelection (); |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
188 | } |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
189 | |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
190 | ACTION (selectByType, "Select by Type", "select-type", |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
191 | "Select all objects by the given type.", (0)) |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
192 | { |
110
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
193 | if (g_ForgeWindow->selection ().size () == 0) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
194 | return; |
109
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
195 | |
110
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
196 | LDObjectType_e eType = g_ForgeWindow->getSelectedType (); |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
197 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
198 | if (eType == OBJ_Unidentified) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
199 | return; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
200 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
201 | // If we're selecting subfile references, the reference filename must also |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
202 | // be uniform. |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
203 | str zRefName; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
204 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
205 | if (eType == OBJ_Subfile) { |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
206 | zRefName = static_cast<LDSubfile*> (g_ForgeWindow->selection ()[0])->zFileName; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
207 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
208 | for (LDObject* pObj : g_ForgeWindow->selection ()) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
209 | if (static_cast<LDSubfile*> (pObj)->zFileName != zRefName) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
210 | return; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
211 | } |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
212 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
213 | g_ForgeWindow->paSelection.clear (); |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
214 | for (LDObject* obj : g_CurrentFile->objects) { |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
215 | if (obj->getType() != eType) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
216 | continue; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
217 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
218 | if (eType == OBJ_Subfile && static_cast<LDSubfile*> (obj)->zFileName != zRefName) |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
219 | continue; |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
220 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
221 | g_ForgeWindow->paSelection.push_back (obj); |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
222 | } |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
223 | |
a62ab18d1b80
Added select by type. Selection is now preserved over operations.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
109
diff
changeset
|
224 | g_ForgeWindow->updateSelection (); |
109
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
225 | } |
125
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
226 | |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
227 | // ============================================================================= |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
228 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
229 | // ============================================================================= |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
230 | ACTION (gridCoarse, "Coarse Grid", "grid-coarse", "Set the grid to Coarse", CTRL (1)) { |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
231 | grid = Grid::Coarse; |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
232 | g_ForgeWindow->updateGridToolBar (); |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
233 | } |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
234 | |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
235 | ACTION (gridMedium, "Medium Grid", "grid-medium", "Set the grid to Medium", CTRL (2)) { |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
236 | grid = Grid::Medium; |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
237 | g_ForgeWindow->updateGridToolBar (); |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
238 | } |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
239 | |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
240 | ACTION (gridFine, "Fine Grid", "grid-fine", "Set the grid to Fine", CTRL (3)) { |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
241 | grid = Grid::Fine; |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
242 | g_ForgeWindow->updateGridToolBar (); |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
243 | } |
7ee7aa5e28be
Make grid actions regular actions rather than auto-generated, this way they can have keyboard shortcuts
Santeri Piippo <crimsondusk64@gmail.com>
parents:
124
diff
changeset
|
244 | |
109
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
245 | // ============================================================================= |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
246 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f40b35142586
Improved shared selection handling; added select by color
Santeri Piippo <crimsondusk64@gmail.com>
parents:
104
diff
changeset
|
247 | // ============================================================================= |
97
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
248 | // Debug things |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
249 | #ifndef RELEASE |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
250 | ACTION (addTestQuad, "Add Test Quad", "add-quad", "Adds a test quad.", (0)) { |
97
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
251 | LDQuad* pQuad = new LDQuad; |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
252 | pQuad->dColor = rand () % 24; |
97
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
253 | pQuad->vaCoords[0] = { 1.0f, 0.0f, 1.0f}; |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
254 | pQuad->vaCoords[1] = {-1.0f, 0.0f, 1.0f}; |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
255 | pQuad->vaCoords[2] = {-1.0f, 0.0f, -1.0f}; |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
256 | pQuad->vaCoords[3] = { 1.0f, 0.0f, -1.0f}; |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
257 | |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
258 | g_CurrentFile->addObject (pQuad); |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
259 | History::addEntry (new AddHistory ({(ulong)pQuad->getIndex (g_CurrentFile)}, {pQuad->clone ()})); |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
260 | g_ForgeWindow->refresh (); |
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
261 | } |
111
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
262 | |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
263 | ACTION (addTestRadial, "Add Test Radial", "add-radial", "Adds a test radial.", (0)) { |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
264 | LDRadial* pRad = new LDRadial; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
265 | pRad->eRadialType = LDRadial::Cone; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
266 | pRad->mMatrix = g_mIdentity; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
267 | pRad->vPosition = vertex (0, 0, 0); |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
268 | pRad->dColor = rand () % 24; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
269 | pRad->dDivisions = 16; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
270 | pRad->dRingNum = 2; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
271 | pRad->dSegments = 16; |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
272 | |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
273 | g_CurrentFile->addObject (pRad); |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
274 | History::addEntry (new AddHistory ({(ulong)pRad->getIndex (g_CurrentFile)}, {pRad->clone ()})); |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
275 | g_ForgeWindow->refresh (); |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
276 | } |
125e8031dbf1
Added the radial type, this one sure has been on my wishlist for a while. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
110
diff
changeset
|
277 | |
97
52bcca21579e
Fleshed out the history dialog further
Santeri Piippo <crimsondusk64@gmail.com>
parents:
80
diff
changeset
|
278 | #endif // RELEASE |