zz_configDialog.cpp

Tue, 19 Mar 2013 18:14:37 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 19 Mar 2013 18:14:37 +0200
changeset 36
ac7779339b01
parent 34
d99006de6261
child 39
110669124caf
permissions
-rw-r--r--

ftoa: don't limit the amount of decimals

30
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
1 /*
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
2 * LDForge: LDraw parts authoring CAD
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
3 * Copyright (C) 2013 Santeri `arezey` Piippo
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
4 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
5 * This program is free software: you can redistribute it and/or modify
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
6 * it under the terms of the GNU General Public License as published by
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
8 * (at your option) any later version.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
9 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
10 * This program is distributed in the hope that it will be useful,
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
13 * GNU General Public License for more details.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
14 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
15 * You should have received a copy of the GNU General Public License
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
17 */
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
18
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #include "common.h"
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include "zz_configDialog.h"
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include "file.h"
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <qgridlayout.h>
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #include <qfiledialog.h>
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
24 #include <qcolordialog.h>
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
25
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
26 ConfigDialog* g_ConfigDialog = nullptr;
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 // =============================================================================
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 // =============================================================================
30
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
31 ConfigDialog::ConfigDialog (ForgeWindow* parent) : QDialog (parent) {
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
32 g_ConfigDialog = this;
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
33
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 qLDrawPath = new QLineEdit;
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
35 qLDrawPath->setText (io_ldpath.value.chars());
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 qLDrawPathLabel = new QLabel ("LDraw path:");
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 qLDrawPathFindButton = new QPushButton;
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 qLDrawPathFindButton->setIcon (QIcon ("icons/folder.png"));
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 connect (qLDrawPathFindButton, SIGNAL (clicked ()),
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 this, SLOT (slot_findLDrawPath ()));
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
44 qGLBackgroundLabel = new QLabel ("Background color:");
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
45 qGLBackgroundButton = new QPushButton;
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
46 setButtonBackground (qGLBackgroundButton, gl_bgcolor.value);
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
47 connect (qGLBackgroundButton, SIGNAL (clicked ()),
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
48 this, SLOT (slot_setGLBackground ()));
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
49
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
50 qGLForegroundLabel = new QLabel ("Foreground color:");
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
51 qGLForegroundButton = new QPushButton;
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
52 setButtonBackground (qGLForegroundButton, gl_maincolor.value);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
53 connect (qGLForegroundButton, SIGNAL (clicked ()),
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
54 this, SLOT (slot_setGLForeground ()));
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
55
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
56 qButtons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
57 connect (qButtons, SIGNAL (accepted ()), this, SLOT (accept ()));
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
58 connect (qButtons, SIGNAL (rejected ()), this, SLOT (reject ()));
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
59
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
60 QGridLayout* layout = new QGridLayout;
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
61 layout->addWidget (qLDrawPathLabel, 0, 0);
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
62 layout->addWidget (qLDrawPath, 0, 1, 1, 2);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
63 layout->addWidget (qLDrawPathFindButton, 0, 3);
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
64
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
65 layout->addWidget (qGLBackgroundLabel, 1, 0);
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
66 layout->addWidget (qGLBackgroundButton, 1, 1);
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
67 layout->addWidget (qGLForegroundLabel, 1, 2);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
68 layout->addWidget (qGLForegroundButton, 1, 3);
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
69
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
70 layout->addWidget (qButtons, 2, 2, 1, 2);
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
71 setLayout (layout);
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
72
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
73 setWindowTitle (APPNAME_DISPLAY " - editing settings");
30
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
74 setWindowIcon (QIcon ("icons/settings.png"));
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
75 }
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
76
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
77 // =============================================================================
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
78 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
79 // =============================================================================
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
80 ConfigDialog::~ConfigDialog() {
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
81 g_ConfigDialog = nullptr;
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
82 }
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
83
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
84 // =============================================================================
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
86 // =============================================================================
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
87 void ConfigDialog::slot_findLDrawPath () {
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
88 str zDir = QFileDialog::getExistingDirectory (this, "Choose LDraw directory",
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
89 qLDrawPath->text());
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
90
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
91 if (~zDir)
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
92 qLDrawPath->setText (zDir.chars());
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
93 }
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
94
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
95 // =============================================================================
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
97 // =============================================================================
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
98 void ConfigDialog::pickColor (strconfig& cfg, QPushButton* qButton) {
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
99 QColorDialog dlg (QColor (cfg.value.chars()));
33
3e0cca764fd6 Added color selection icon
Santeri Piippo <crimsondusk64@gmail.com>
parents: 32
diff changeset
100 dlg.setWindowIcon (QIcon ("icons/colorselect.png"));
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
101
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
102 if (dlg.exec ()) {
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
103 uchar r = dlg.currentColor ().red (),
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
104 g = dlg.currentColor ().green (),
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
105 b = dlg.currentColor ().blue ();
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
106 cfg.value.format ("#%.2X%.2X%.2X", r, g, b);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
107 setButtonBackground (qButton, cfg.value);
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
108 }
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
109 }
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
110
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
111 void ConfigDialog::slot_setGLBackground () {
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
112 pickColor (gl_bgcolor, qGLBackgroundButton);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
113 }
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
114
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
115 void ConfigDialog::slot_setGLForeground () {
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
116 pickColor (gl_maincolor, qGLForegroundButton);
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
117 }
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
118
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
119 // =============================================================================
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
121 // =============================================================================
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
122 void ConfigDialog::setButtonBackground (QPushButton* qButton, str zValue) {
34
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
123 qButton->setIcon (QIcon ("icons/colorselect.png"));
d99006de6261 Added main color configuration option, not implemented yet
Santeri Piippo <crimsondusk64@gmail.com>
parents: 33
diff changeset
124 qButton->setAutoFillBackground (true);
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
125 qButton->setStyleSheet (
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
126 str::mkfmt ("background-color: %s", zValue.chars()).chars()
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
127 );
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
128 }
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
129
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
130 // =============================================================================
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
132 // =============================================================================
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
133 void ConfigDialog::staticDialog (ForgeWindow* window) {
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
134 ConfigDialog dlg (window);
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
135
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
136 if (dlg.exec ()) {
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
137 io_ldpath = dlg.qLDrawPath->text();
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
138
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
139 // Save the config
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
140 config::save ();
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
141
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
142 // Reload all subfiles
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
143 reloadAllSubfiles ();
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
144
32
5d22b7ecf110 Made the GL renderer background color configurable
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
145 window->R->setBackground ();
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
146 }
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
147 }

mercurial