Tue, 30 Jul 2013 07:38:08 +0300
Renamed vector to List, changed it to wrap around std::deque.
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 |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
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. |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
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. |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
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/>. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #ifndef CONFIGDIALOG_H |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #define CONFIGDIALOG_H |
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 | #include "gui.h" |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
23 | #include <QDialog> |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
24 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
25 | class Ui_ConfigUI; |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
26 | class QLabel; |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
27 | class QDoubleSpinBox; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | // ============================================================================= |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
30 | class ShortcutListItem : public QListWidgetItem |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
31 | { |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
32 | PROPERTY (keyseqconfig*, keyConfig, setKeyConfig) |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
33 | PROPERTY (QAction*, action, setAction) |
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
34 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | public: |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
36 | explicit ShortcutListItem( QListWidget* view = null, int type = Type ) : |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
37 | QListWidgetItem( view, type ) {} |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | // ============================================================================= |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
41 | class ConfigDialog : public QDialog |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
42 | { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | Q_OBJECT |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
44 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | public: |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
46 | ConfigDialog (ForgeWindow* parent); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
47 | virtual ~ConfigDialog(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
48 | static void staticDialog(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
49 | const Ui_ConfigUI* getUI() const; |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
50 | float getGridValue (int i, int j) const; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | |
402
ec95fc95e5f3
Renamed vector to List, changed it to wrap around std::deque.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
395
diff
changeset
|
52 | List<LDQuickColor> quickColors; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
53 | QDoubleSpinBox* dsb_gridData[3][4]; |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
54 | |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
55 | private: |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
56 | Ui_ConfigUI* ui; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | QLabel* lb_gridLabels[3]; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
58 | QLabel* lb_gridIcons[3]; |
402
ec95fc95e5f3
Renamed vector to List, changed it to wrap around std::deque.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
395
diff
changeset
|
59 | List<QListWidgetItem*> quickColorItems; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
61 | void initMainTab(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
62 | void initShortcutsTab(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
63 | void initQuickColorTab(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
64 | void initGridTab(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
65 | void initExtProgTab(); |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
66 | void addShortcut (keyseqconfig& cfg, QAction* act, ulong& i); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
67 | void setButtonBackground( QPushButton* button, str value ); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
68 | void pickColor( strconfig& cfg, QPushButton* button ); |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
382
diff
changeset
|
69 | void updateQuickColorList( LDQuickColor* sel = null ); |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
70 | void setShortcutText (ShortcutListItem* item); |
402
ec95fc95e5f3
Renamed vector to List, changed it to wrap around std::deque.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
395
diff
changeset
|
71 | int getItemRow( QListWidgetItem* item, List<QListWidgetItem*>& haystack ); |
395
5210bcb1d7e0
Further restructure, removed GUI toolbar icon size slider (always 22x22 now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
382
diff
changeset
|
72 | str quickColorString(); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
73 | QListWidgetItem* getSelectedQuickColor(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
74 | QList<ShortcutListItem*> getShortcutSelection(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
75 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
76 | private slots: |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
77 | void slot_setGLBackground(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
78 | void slot_setGLForeground(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
79 | void slot_setShortcut(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
80 | void slot_resetShortcut(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
81 | void slot_clearShortcut(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
82 | void slot_setColor(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
83 | void slot_delColor(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
84 | void slot_addColorSeparator(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
85 | void slot_moveColor(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
86 | void slot_clearColors(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
87 | void slot_setExtProgPath(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
88 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
89 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
90 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
91 | // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
92 | // ============================================================================= |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
93 | class KeySequenceDialog : public QDialog |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
94 | { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | Q_OBJECT |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
96 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | public: |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
98 | explicit KeySequenceDialog( QKeySequence seq, QWidget* parent = null, Qt::WindowFlags f = 0 ); |
382
c1642530ea35
Converted ForgeWindow to Designer UI(!)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
367
diff
changeset
|
99 | static bool staticDialog( keyseqconfig* cfg, QWidget* parent = null ); |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
100 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
101 | QLabel* lb_output; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | QDialogButtonBox* bbx_buttons; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | QKeySequence seq; |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
104 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | private: |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
106 | void updateOutput(); |
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
107 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | private slots: |
367
3745caa5d87d
apply the c++11 'override' keyword to overriding virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
328
diff
changeset
|
109 | virtual void keyPressEvent( QKeyEvent* ev ) override; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
110 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | |
328
b6a814a608c6
Converted the config dialog to a designer UI file
Santeri Piippo <crimsondusk64@gmail.com>
parents:
252
diff
changeset
|
112 | #endif // CONFIGDIALOG_H |