Thu, 22 Aug 2013 20:24:16 +0300
Changed build system from qmake to CMake.
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) 2013 Santeri Piippo |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
4 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
9 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
14 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
471 | 17 | * ===================================================================== |
18 | * | |
19 | * configDialog.cpp: Settings dialog and everything related to it. | |
20 | * Actual configuration core is in config.cpp. | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | */ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | |
202
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
23 | #include <QGridLayout> |
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
24 | #include <QFileDialog> |
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
25 | #include <QColorDialog> |
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
26 | #include <QBoxLayout> |
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
27 | #include <QKeyEvent> |
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
28 | #include <QGroupBox> |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
29 | #include <QDoubleSpinBox> |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
30 | #include <QLineEdit> |
343
75487752f3e6
Completed Edger 2 interface
Santeri Piippo <crimsondusk64@gmail.com>
parents:
328
diff
changeset
|
31 | #include <QCheckBox> |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | #include "common.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | #include "configDialog.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | #include "file.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | #include "config.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | #include "misc.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | #include "colors.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | #include "colorSelectDialog.h" |
198
f246725199dc
Split some stuff into separate files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
39 | #include "gldraw.h" |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
40 | #include "ui_config.h" |
473
2a84149fe642
Changed build system from qmake to CMake.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
471
diff
changeset
|
41 | #include "moc_configDialog.cxx" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
43 | extern_cfg (String, gl_bgcolor); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
44 | extern_cfg (String, gl_maincolor); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
45 | extern_cfg (Bool, lv_colorize); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
46 | extern_cfg (Bool, gl_colorbfc); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
47 | extern_cfg (Float, gl_maincolor_alpha); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
48 | extern_cfg (Int, gl_linethickness); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
49 | extern_cfg (String, gui_colortoolbar); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
50 | extern_cfg (Bool, edit_schemanticinline); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
51 | extern_cfg (Bool, gl_blackedges); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
52 | extern_cfg (Bool, gui_implicitfiles); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
53 | extern_cfg (String, net_downloadpath); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
54 | extern_cfg (Bool, net_guesspaths); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
55 | extern_cfg (Bool, net_autoclose); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
56 | extern_cfg (Bool, gl_logostuds); |
464
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
57 | extern_cfg (String, ld_defaultname); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
58 | extern_cfg (String, ld_defaultuser); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
59 | extern_cfg (Int, ld_defaultlicense); |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
60 | extern_cfg (String, prog_ytruder); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
61 | extern_cfg (String, prog_rectifier); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
62 | extern_cfg (String, prog_intersector); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
63 | extern_cfg (String, prog_coverer); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
64 | extern_cfg (String, prog_isecalc); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
65 | extern_cfg (String, prog_edger2); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
66 | extern_cfg (Bool, prog_ytruder_wine); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
67 | extern_cfg (Bool, prog_rectifier_wine); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
68 | extern_cfg (Bool, prog_intersector_wine); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
69 | extern_cfg (Bool, prog_coverer_wine); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
70 | extern_cfg (Bool, prog_isecalc_wine); |
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
71 | extern_cfg (Bool, prog_edger2_wine); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
72 | |
471 | 73 | #define act(N) extern_cfg (KeySequence, key_##N); |
74 | #include "actions.h" | |
75 | ||
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
76 | const char* g_extProgPathFilter = |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
77 | #ifdef _WIN32 |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
78 | "Applications (*.exe)(*.exe);;All files (*.*)(*.*)"; |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
79 | #else |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
80 | ""; |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
81 | #endif |
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
82 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
83 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
84 | // ----------------------------------------------------------------------------- |
467
59549731151a
Added ListConfig type, using it in recent files now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
464
diff
changeset
|
85 | ConfigDialog::ConfigDialog (ConfigDialog::Tab deftab, QWidget* parent, Qt::WindowFlags f) : |
59549731151a
Added ListConfig type, using it in recent files now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
464
diff
changeset
|
86 | QDialog (parent, f) |
59549731151a
Added ListConfig type, using it in recent files now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
464
diff
changeset
|
87 | { |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
88 | assert (g_win); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
89 | ui = new Ui_ConfigUI; |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
417
diff
changeset
|
90 | ui->setupUi (this); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
91 | |
471 | 92 | // Interface tab |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
93 | setButtonBackground (ui->backgroundColorButton, gl_bgcolor); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
94 | connect (ui->backgroundColorButton, SIGNAL (clicked()), |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
95 | this, SLOT (slot_setGLBackground())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
96 | |
471 | 97 | setButtonBackground (ui->mainColorButton, gl_maincolor); |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
98 | connect (ui->mainColorButton, SIGNAL (clicked()), |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
99 | this, SLOT (slot_setGLForeground())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
100 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
101 | ui->mainColorAlpha->setValue (gl_maincolor_alpha * 10.0f); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
102 | ui->lineThickness->setValue (gl_linethickness); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
103 | ui->colorizeObjects->setChecked (lv_colorize); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
104 | ui->colorBFC->setChecked (gl_colorbfc); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
105 | ui->blackEdges->setChecked (gl_blackedges); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
106 | ui->implicitFiles->setChecked (gui_implicitfiles); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
107 | ui->m_logostuds->setChecked (gl_logostuds); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
108 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
109 | ulong i = 0; |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
110 | #define act(N) addShortcut (key_##N, ACTION(N), i); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
111 | #include "actions.h" |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
112 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
113 | ui->shortcutsList->setSortingEnabled (true); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
114 | ui->shortcutsList->sortItems(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
115 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
116 | connect (ui->shortcut_set, SIGNAL (clicked()), this, SLOT (slot_setShortcut())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
117 | connect (ui->shortcut_reset, SIGNAL (clicked()), this, SLOT (slot_resetShortcut())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
118 | connect (ui->shortcut_clear, SIGNAL (clicked()), this, SLOT (slot_clearShortcut())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
119 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
120 | quickColors = quickColorsFromConfig(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
121 | updateQuickColorList(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
122 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
123 | connect (ui->quickColor_add, SIGNAL (clicked()), this, SLOT (slot_setColor())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
124 | connect (ui->quickColor_remove, SIGNAL (clicked()), this, SLOT (slot_delColor())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
125 | connect (ui->quickColor_edit, SIGNAL (clicked()), this, SLOT (slot_setColor())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
126 | connect (ui->quickColor_addSep, SIGNAL (clicked()), this, SLOT (slot_addColorSeparator())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
127 | connect (ui->quickColor_moveUp, SIGNAL (clicked()), this, SLOT (slot_moveColor())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
128 | connect (ui->quickColor_moveDown, SIGNAL (clicked()), this, SLOT (slot_moveColor())); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
129 | connect (ui->quickColor_clear, SIGNAL (clicked()), this, SLOT (slot_clearColors())); |
430
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
130 | |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
131 | ui->downloadPath->setText (net_downloadpath); |
431
ec1e2059319b
stability to downloading
Santeri Piippo <crimsondusk64@gmail.com>
parents:
430
diff
changeset
|
132 | ui->guessNetPaths->setChecked (net_guesspaths); |
ec1e2059319b
stability to downloading
Santeri Piippo <crimsondusk64@gmail.com>
parents:
430
diff
changeset
|
133 | ui->autoCloseNetPrompt->setChecked (net_autoclose); |
430
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
134 | connect (ui->findDownloadPath, SIGNAL (clicked(bool)), this, SLOT (slot_findDownloadFolder())); |
464
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
135 | |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
136 | ui->m_profileName->setText (ld_defaultname); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
137 | ui->m_profileUsername->setText (ld_defaultuser); |
3779a14d597c
added profile data auto-filling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
461
diff
changeset
|
138 | ui->m_profileLicense->setCurrentIndex (ld_defaultlicense); |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
139 | ui->tabs->setCurrentIndex (deftab); |
467
59549731151a
Added ListConfig type, using it in recent files now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
464
diff
changeset
|
140 | |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
141 | initGrids(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
142 | initExtProgs(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
143 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
144 | connect (ui->buttonBox, SIGNAL (clicked (QAbstractButton*)), |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
145 | this, SLOT (buttonClicked(QAbstractButton*))); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
146 | } |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
147 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
148 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
149 | // ----------------------------------------------------------------------------- |
411 | 150 | ConfigDialog::~ConfigDialog() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
151 | delete ui; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
152 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
153 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
154 | // ============================================================================= |
471 | 155 | // Adds a shortcut entry to the list of shortcuts. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
156 | // ----------------------------------------------------------------------------- |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
157 | void ConfigDialog::addShortcut (KeySequenceConfig& cfg, QAction* act, ulong& i) { |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
158 | ShortcutListItem* item = new ShortcutListItem; |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
159 | item->setIcon (act->icon()); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
160 | item->setKeyConfig (&cfg); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
161 | item->setAction (act); |
386
751d31336f08
fixed config dialog crashing
Santeri Piippo <crimsondusk64@gmail.com>
parents:
382
diff
changeset
|
162 | setShortcutText (item); |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
163 | |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
164 | // If the action doesn't have a valid icon, use an empty one |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
165 | // so that the list is kept aligned. |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
166 | if (act->icon().isNull()) |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
167 | item->setIcon (getIcon ("empty")); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
168 | |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
169 | ui->shortcutsList->insertItem (i++, item); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
170 | } |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
171 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
172 | // ============================================================================= |
471 | 173 | // Initializes the table of grid stuff |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
174 | // ----------------------------------------------------------------------------- |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
175 | void ConfigDialog::initGrids() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
176 | QGridLayout* gridlayout = new QGridLayout; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
177 | QLabel* xlabel = new QLabel ("X"), |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
178 | *ylabel = new QLabel ("Y"), |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
179 | *zlabel = new QLabel ("Z"), |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
180 | *anglabel = new QLabel ("Angle"); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
181 | short i = 1; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
182 | |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
417
diff
changeset
|
183 | for (QLabel* label : initlist<QLabel*> ({ xlabel, ylabel, zlabel, anglabel })) { |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
184 | label->setAlignment (Qt::AlignCenter); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
185 | gridlayout->addWidget (label, 0, i++); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
186 | } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
187 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
188 | for (int i = 0; i < g_NumGrids; ++i) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
189 | // Icon |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
190 | lb_gridIcons[i] = new QLabel; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
191 | lb_gridIcons[i]->setPixmap (getIcon (fmt ("grid-%1", str (g_GridInfo[i].name).toLower()))); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
192 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
193 | // Text label |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
194 | lb_gridLabels[i] = new QLabel (fmt ("%1:", g_GridInfo[i].name)); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
195 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
196 | QHBoxLayout* labellayout = new QHBoxLayout; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
197 | labellayout->addWidget (lb_gridIcons[i]); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
198 | labellayout->addWidget (lb_gridLabels[i]); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
199 | gridlayout->addLayout (labellayout, i + 1, 0); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
200 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
201 | // Add the widgets |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
202 | for (int j = 0; j < 4; ++j) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
203 | dsb_gridData[i][j] = new QDoubleSpinBox; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
204 | dsb_gridData[i][j]->setValue (g_GridInfo[i].confs[j]->value); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
205 | gridlayout->addWidget (dsb_gridData[i][j], i + 1, j + 1); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
206 | } |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
207 | } |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
208 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
209 | ui->grids->setLayout (gridlayout); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
210 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
211 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
212 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
213 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
214 | static const struct extProgInfo { |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
215 | const str name, iconname; |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
216 | StringConfig* const path; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
217 | mutable QLineEdit* input; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
218 | mutable QPushButton* setPathButton; |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
219 | #ifndef _WIN32 |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
220 | BoolConfig* const wine; |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
221 | mutable QCheckBox* wineBox; |
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
222 | #endif // _WIN32 |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
223 | } g_extProgInfo[] = { |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
224 | #ifndef _WIN32 |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
225 | # define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &prog_##LOWNAME, null, null, &prog_##LOWNAME##_wine, null }, |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
226 | #else |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
227 | # define EXTPROG(NAME, LOWNAME) { #NAME, #LOWNAME, &prog_##LOWNAME, null, null }, |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
228 | #endif |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
229 | EXTPROG (Ytruder, ytruder) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
230 | EXTPROG (Rectifier, rectifier) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
231 | EXTPROG (Intersector, intersector) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
232 | EXTPROG (Isecalc, isecalc) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
233 | EXTPROG (Coverer, coverer) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
234 | EXTPROG (Edger2, edger2) |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
235 | #undef EXTPROG |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
236 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
237 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
238 | // ============================================================================= |
471 | 239 | // Initializes the stuff in the ext programs tab |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
240 | // ----------------------------------------------------------------------------- |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
241 | void ConfigDialog::initExtProgs() { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
242 | QGridLayout* pathsLayout = new QGridLayout; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
243 | ulong row = 0; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
244 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
245 | for (const extProgInfo & info : g_extProgInfo) { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
246 | QLabel* icon = new QLabel, |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
247 | *progLabel = new QLabel (info.name); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
248 | QLineEdit* input = new QLineEdit; |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
249 | QPushButton* setPathButton = new QPushButton; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
250 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
251 | icon->setPixmap (getIcon (info.iconname)); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
252 | input->setText (info.path->value); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
253 | setPathButton->setIcon (getIcon ("folder")); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
254 | info.input = input; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
255 | info.setPathButton = setPathButton; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
256 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
257 | connect (setPathButton, SIGNAL (clicked()), this, SLOT (slot_setExtProgPath())); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
258 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
259 | pathsLayout->addWidget (icon, row, 0); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
260 | pathsLayout->addWidget (progLabel, row, 1); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
261 | pathsLayout->addWidget (input, row, 2); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
262 | pathsLayout->addWidget (setPathButton, row, 3); |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
263 | |
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
264 | #ifndef _WIN32 |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
265 | QCheckBox* wineBox = new QCheckBox ("Wine"); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
266 | wineBox->setChecked (*info.wine); |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
267 | info.wineBox = wineBox; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
268 | pathsLayout->addWidget (wineBox, row, 4); |
300
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
269 | #endif |
0c7e00cc3d44
Added support for launching external programs with Wine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
286
diff
changeset
|
270 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
271 | ++row; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
272 | } |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
273 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
274 | ui->extProgs->setLayout (pathsLayout); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
275 | } |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
276 | |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
277 | // ============================================================================= |
471 | 278 | // Set the settings based on widget data. |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
279 | // ----------------------------------------------------------------------------- |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
280 | void ConfigDialog::applySettings() { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
281 | // Apply configuration |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
282 | lv_colorize = ui->colorizeObjects->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
283 | gl_colorbfc = ui->colorBFC->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
284 | gl_blackedges = ui->blackEdges->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
285 | gl_maincolor_alpha = ((double) ui->mainColorAlpha->value()) / 10.0f; |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
286 | gl_linethickness = ui->lineThickness->value(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
287 | gui_implicitfiles = ui->implicitFiles->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
288 | net_downloadpath = ui->downloadPath->text(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
289 | net_guesspaths = ui->guessNetPaths->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
290 | net_autoclose = ui->autoCloseNetPrompt->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
291 | gl_logostuds = ui->m_logostuds->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
292 | ld_defaultuser = ui->m_profileUsername->text(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
293 | ld_defaultname = ui->m_profileName->text(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
294 | ld_defaultlicense = ui->m_profileLicense->currentIndex(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
295 | |
471 | 296 | // Ensure '/' postfix to the download path |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
297 | if (net_downloadpath.value.right (1) != DIRSLASH) |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
298 | net_downloadpath += DIRSLASH; |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
299 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
300 | // Rebuild the quick color toolbar |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
301 | g_win->setQuickColors (quickColors); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
302 | gui_colortoolbar = quickColorString(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
303 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
304 | // Set the grid settings |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
305 | for (int i = 0; i < g_NumGrids; ++i) |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
306 | for (int j = 0; j < 4; ++j) |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
307 | g_GridInfo[i].confs[j]->value = dsb_gridData[i][j]->value(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
308 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
309 | // Apply key shortcuts |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
310 | #define act(N) ACTION(N)->setShortcut (key_##N); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
311 | #include "actions.h" |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
312 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
313 | // Ext program settings |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
314 | for (const extProgInfo & info : g_extProgInfo) { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
315 | *info.path = info.input->text(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
316 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
317 | #ifndef _WIN32 |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
318 | *info.wine = info.wineBox->isChecked(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
319 | #endif // _WIN32 |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
320 | } |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
321 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
322 | Config::save(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
323 | reloadAllSubfiles(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
324 | loadLogoedStuds(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
325 | g_win->R()->setBackground(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
326 | g_win->fullRefresh(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
327 | g_win->updateToolBars(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
328 | g_win->updateFileList(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
329 | } |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
330 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
331 | // ============================================================================= |
471 | 332 | // A dialog button was clicked |
469
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
333 | // ----------------------------------------------------------------------------- |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
334 | void ConfigDialog::buttonClicked (QAbstractButton* button) { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
335 | typedef QDialogButtonBox QDDB; |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
336 | QDialogButtonBox* dbb = ui->buttonBox; |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
337 | |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
338 | if (button == dbb->button (QDDB::Ok)) { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
339 | applySettings(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
340 | accept(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
341 | } elif (button == dbb->button (QDDB::Apply)) { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
342 | applySettings(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
343 | } elif (button == dbb->button (QDDB::Cancel)) { |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
344 | reject(); |
f2faed654633
more changes. Spawn the config prompt on first start, on the profile tab. gl_colorbfc and gl_blackedges now default to false.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
467
diff
changeset
|
345 | } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
346 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
347 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
348 | // ============================================================================= |
471 | 349 | // Update the list of color toolbar items in the quick color tab. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
350 | // ----------------------------------------------------------------------------- |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
417
diff
changeset
|
351 | void ConfigDialog::updateQuickColorList (LDQuickColor* sel) { |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
352 | for (QListWidgetItem* item : quickColorItems) |
186
a130960bb220
Make quick color toolbar use QToolButtons, make color selector's process of making color icons a method and use that for generic color icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
183
diff
changeset
|
353 | delete item; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
354 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
355 | quickColorItems.clear(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
356 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
357 | // Init table items |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
358 | for (LDQuickColor& entry : quickColors) { |
186
a130960bb220
Make quick color toolbar use QToolButtons, make color selector's process of making color icons a method and use that for generic color icons
Santeri Piippo <crimsondusk64@gmail.com>
parents:
183
diff
changeset
|
359 | QListWidgetItem* item = new QListWidgetItem; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
360 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
361 | if (entry.isSeparator) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
362 | item->setText ("--------"); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
363 | item->setIcon (getIcon ("empty")); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
364 | } else { |
364
7c3af0a6f8ab
Renamed the color class to LDColor for clarity
Santeri Piippo <crimsondusk64@gmail.com>
parents:
343
diff
changeset
|
365 | LDColor* col = entry.col; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
366 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
367 | if (col == null) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
368 | item->setText ("[[unknown color]]"); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
369 | item->setIcon (getIcon ("error")); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
370 | } else { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
371 | item->setText (col->name); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
372 | item->setIcon (makeColorIcon (col, 16)); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
373 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
374 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
375 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
376 | ui->quickColorList->addItem (item); |
252
3f9067022d74
Take the aforementioned operator<< into use
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
377 | quickColorItems << item; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
378 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
379 | if (sel && &entry == sel) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
380 | ui->quickColorList->setCurrentItem (item); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
381 | ui->quickColorList->scrollToItem (item); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
382 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
383 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
384 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
385 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
386 | // ============================================================================= |
471 | 387 | // Quick colors: add or edit button was clicked. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
388 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
389 | void ConfigDialog::slot_setColor() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
390 | LDQuickColor* entry = null; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
391 | QListWidgetItem* item = null; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
392 | const bool isNew = static_cast<QPushButton*> (sender()) == ui->quickColor_add; |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
393 | |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
394 | if (isNew == false) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
395 | item = getSelectedQuickColor(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
396 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
397 | if (!item) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
398 | return; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
399 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
400 | ulong i = getItemRow (item, quickColorItems); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
401 | entry = &quickColors[i]; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
402 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
403 | if (entry->isSeparator == true) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
404 | return; // don't color separators |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
405 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
406 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
407 | short defval = entry ? entry->col->index : -1; |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
408 | short val; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
409 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
410 | if (ColorSelector::getColor (val, defval, this) == false) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
411 | return; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
412 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
413 | if (entry) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
414 | entry->col = getColor (val); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
415 | else { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
416 | LDQuickColor entry = {getColor (val), null, false}; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
417 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
418 | item = getSelectedQuickColor(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
419 | ulong idx; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
420 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
421 | if (item) |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
422 | idx = getItemRow (item, quickColorItems) + 1; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
423 | else |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
424 | idx = quickColorItems.size(); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
425 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
426 | quickColors.insert (idx, entry); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
427 | entry = quickColors[idx]; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
428 | } |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
429 | |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
430 | updateQuickColorList (entry); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
431 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
432 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
433 | // ============================================================================= |
471 | 434 | // Remove a quick color |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
435 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
436 | void ConfigDialog::slot_delColor() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
437 | if (ui->quickColorList->selectedItems().size() == 0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
438 | return; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
439 | |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
440 | QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
441 | quickColors.erase (getItemRow (item, quickColorItems)); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
442 | updateQuickColorList(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
443 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
444 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
445 | // ============================================================================= |
471 | 446 | // Move a quick color up/down |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
447 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
448 | void ConfigDialog::slot_moveColor() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
449 | const bool up = (static_cast<QPushButton*> (sender()) == ui->quickColor_moveUp); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
450 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
451 | if (ui->quickColorList->selectedItems().size() == 0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
452 | return; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
453 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
454 | QListWidgetItem* item = ui->quickColorList->selectedItems() [0]; |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
455 | int idx = getItemRow (item, quickColorItems); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
456 | int dest = up ? (idx - 1) : (idx + 1); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
457 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
458 | if (dest < 0 || (ulong) dest >= quickColorItems.size()) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
459 | return; // destination out of bounds |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
460 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
461 | LDQuickColor tmp = quickColors[dest]; |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
462 | quickColors[dest] = quickColors[idx]; |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
463 | quickColors[idx] = tmp; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
464 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
465 | updateQuickColorList (&quickColors[dest]); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
466 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
467 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
468 | // ============================================================================= |
471 | 469 | // Add a separator to quick colors |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
470 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
471 | void ConfigDialog::slot_addColorSeparator() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
472 | quickColors << LDQuickColor ({null, null, true}); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
473 | updateQuickColorList (&quickColors[quickColors.size() - 1]); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
474 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
475 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
476 | // ============================================================================= |
471 | 477 | // Clear all quick colors |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
478 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
479 | void ConfigDialog::slot_clearColors() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
480 | quickColors.clear(); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
481 | updateQuickColorList(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
482 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
483 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
484 | // ============================================================================= |
471 | 485 | // Pick a color and set the appropriate configuration option. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
486 | // ----------------------------------------------------------------------------- |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
487 | void ConfigDialog::pickColor (StringConfig& conf, QPushButton* button) { |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
488 | QColor col = QColorDialog::getColor (QColor (conf)); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
489 | |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
490 | if (col.isValid()) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
491 | uchar r = col.red(), |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
492 | g = col.green(), |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
493 | b = col.blue(); |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
494 | conf.value.sprintf ("#%.2X%.2X%.2X", r, g, b); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
495 | setButtonBackground (button, conf.value); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
496 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
497 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
498 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
499 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
500 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
501 | void ConfigDialog::slot_setGLBackground() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
502 | pickColor (gl_bgcolor, ui->backgroundColorButton); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
503 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
504 | |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
505 | // ============================================================================= |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
506 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
507 | void ConfigDialog::slot_setGLForeground() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
508 | pickColor (gl_maincolor, ui->mainColorButton); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
509 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
510 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
511 | // ============================================================================= |
471 | 512 | // Sets background color of a given button. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
513 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
514 | void ConfigDialog::setButtonBackground (QPushButton* button, str value) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
515 | button->setIcon (getIcon ("colorselect")); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
516 | button->setAutoFillBackground (true); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
517 | button->setStyleSheet (fmt ("background-color: %1", value)); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
518 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
519 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
520 | // ============================================================================= |
471 | 521 | // Finds the given list widget item in the list of widget items given. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
522 | // ----------------------------------------------------------------------------- |
402
ec95fc95e5f3
Renamed vector to List, changed it to wrap around std::deque.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
395
diff
changeset
|
523 | int ConfigDialog::getItemRow (QListWidgetItem* item, List<QListWidgetItem*>& haystack) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
524 | int i = 0; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
525 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
526 | for (QListWidgetItem* it : haystack) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
527 | if (it == item) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
528 | return i; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
529 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
530 | ++i; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
531 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
532 | return -1; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
533 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
534 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
535 | // ============================================================================= |
471 | 536 | // Which quick color is currently selected? |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
537 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
538 | QListWidgetItem* ConfigDialog::getSelectedQuickColor() { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
539 | if (ui->quickColorList->selectedItems().size() == 0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
540 | return null; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
541 | |
471 | 542 | return ui->quickColorList->selectedItems()[0]; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
543 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
544 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
545 | // ============================================================================= |
471 | 546 | // Get the list of shortcuts selected |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
547 | // ----------------------------------------------------------------------------- |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
548 | QList<ShortcutListItem*> ConfigDialog::getShortcutSelection() { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
549 | QList<ShortcutListItem*> out; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
550 | |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
417
diff
changeset
|
551 | for (QListWidgetItem* entry : ui->shortcutsList->selectedItems()) |
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
417
diff
changeset
|
552 | out << static_cast<ShortcutListItem*> (entry); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
553 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
554 | return out; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
555 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
556 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
557 | // ============================================================================= |
471 | 558 | // Edit the shortcut of a given action. |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
559 | // ----------------------------------------------------------------------------- |
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
560 | void ConfigDialog::slot_setShortcut() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
561 | QList<ShortcutListItem*> sel = getShortcutSelection(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
562 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
563 | if (sel.size() < 1) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
564 | return; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
565 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
566 | ShortcutListItem* item = sel[0]; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
567 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
568 | if (KeySequenceDialog::staticDialog (item->keyConfig(), this)) |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
569 | setShortcutText (item); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
570 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
571 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
572 | // ============================================================================= |
471 | 573 | // Reset a shortcut to defaults |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
574 | // ----------------------------------------------------------------------------- |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
575 | void ConfigDialog::slot_resetShortcut() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
576 | QList<ShortcutListItem*> sel = getShortcutSelection(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
577 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
578 | for (ShortcutListItem* item : sel) { |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
579 | item->keyConfig()->reset(); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
580 | setShortcutText (item); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
581 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
582 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
583 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
584 | // ============================================================================= |
471 | 585 | // Remove the shortcut of an action. |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
586 | // ----------------------------------------------------------------------------- |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
587 | void ConfigDialog::slot_clearShortcut() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
588 | QList<ShortcutListItem*> sel = getShortcutSelection(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
589 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
590 | for (ShortcutListItem* item : sel) { |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
591 | item->keyConfig()->value = QKeySequence(); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
592 | setShortcutText (item); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
593 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
594 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
595 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
596 | // ============================================================================= |
471 | 597 | // Set the path of an external program |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
598 | // ----------------------------------------------------------------------------- |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
599 | void ConfigDialog::slot_setExtProgPath() { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
600 | const extProgInfo* info = null; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
601 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
602 | for (const extProgInfo& it : g_extProgInfo) { |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
603 | if (it.setPathButton == sender()) { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
604 | info = ⁢ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
605 | break; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
606 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
607 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
608 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
609 | assert (info != null); |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
610 | str fpath = QFileDialog::getOpenFileName (this, fmt ("Path to %1", info->name), *info->path, g_extProgPathFilter); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
611 | |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
612 | if (fpath.isEmpty()) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
613 | return; |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
614 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
615 | info->input->setText (fpath); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
616 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
617 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
618 | // ============================================================================= |
471 | 619 | // '...' button pressed for the download path |
430
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
620 | // ----------------------------------------------------------------------------- |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
621 | void ConfigDialog::slot_findDownloadFolder() { |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
622 | str dpath = QFileDialog::getExistingDirectory(); |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
623 | ui->downloadPath->setText (dpath); |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
624 | } |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
625 | |
8458cf2719d1
added config option, refined logic and regexps. This behaves coherently now. :)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
421
diff
changeset
|
626 | // ============================================================================= |
471 | 627 | // Updates the text string for a given shortcut list item |
452
47cc663e4ff4
ask the user for ext prog paths instead of telling to go to configuration if no path is defined
Santeri Piippo <crimsondusk64@gmail.com>
parents:
431
diff
changeset
|
628 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
629 | void ConfigDialog::setShortcutText (ShortcutListItem* item) { |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
630 | QAction* act = item->action(); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
631 | str label = act->iconText(); |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
632 | str keybind = item->keyConfig()->value.toString(); |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
633 | item->setText (fmt ("%1 (%2)", label, keybind)); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
634 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
635 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
636 | // ============================================================================= |
471 | 637 | // Gets the configuration string of the quick color toolbar |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
638 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
639 | str ConfigDialog::quickColorString() { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
640 | str val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
641 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
642 | for (LDQuickColor entry : quickColors) { |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
643 | if (val.length() > 0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
644 | val += ':'; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
645 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
646 | if (entry.isSeparator) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
647 | val += '|'; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
648 | else |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
649 | val += fmt ("%1", entry.col->index); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
650 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
651 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
652 | return val; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
653 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
654 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
655 | // ========================================================================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
656 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
657 | // ========================================================================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
658 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
659 | // ========================================================================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
660 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
661 | // ========================================================================================================================= |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
662 | KeySequenceDialog::KeySequenceDialog (QKeySequence seq, QWidget* parent, Qt::WindowFlags f) : |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
663 | QDialog (parent, f), seq (seq) { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
664 | lb_output = new QLabel; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
665 | IMPLEMENT_DIALOG_BUTTONS |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
666 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
667 | setWhatsThis ("Into this dialog you can input a key sequence for use as a " |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
668 | "shortcut in LDForge. Use OK to confirm the new shortcut and Cancel to " |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
669 | "dismiss."); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
670 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
671 | QVBoxLayout* layout = new QVBoxLayout; |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
672 | layout->addWidget (lb_output); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
673 | layout->addWidget (bbx_buttons); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
674 | setLayout (layout); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
675 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
676 | updateOutput(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
677 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
678 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
679 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
680 | // ----------------------------------------------------------------------------- |
461
fbcc91ae1dd2
- added "Go to line" action, renamed the config classes to proper camelcase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
681 | bool KeySequenceDialog::staticDialog (KeySequenceConfig* cfg, QWidget* parent) { |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
682 | KeySequenceDialog dlg (cfg->value, parent); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
683 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
684 | if (dlg.exec() == false) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
685 | return false; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
686 | |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
373
diff
changeset
|
687 | cfg->value = dlg.seq; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
688 | return true; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
689 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
690 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
691 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
692 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
693 | void KeySequenceDialog::updateOutput() { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
694 | str shortcut = seq.toString(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
695 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
696 | if (seq == QKeySequence()) |
202
a027f6fc6141
Un-templated CheckBoxGroup, moved it and RadioButton into widgets.cpp/widgets.h; removed license text tab because I think LICENSE is enough.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
198
diff
changeset
|
697 | shortcut = "<empty>"; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
698 | |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
699 | str text = fmt ("<center><b>%1</b></center>", shortcut); |
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
700 | lb_output->setText (text); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
701 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
702 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
703 | // ============================================================================= |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
704 | // ----------------------------------------------------------------------------- |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
386
diff
changeset
|
705 | void KeySequenceDialog::keyPressEvent (QKeyEvent* ev) { |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
706 | seq = ev->key() + ev->modifiers(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
327
diff
changeset
|
707 | updateOutput(); |
455
c5d14d112034
Code formatting: use same separators everywhere, remove extra spaces from license headers, simplified message manager api a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
452
diff
changeset
|
708 | } |