173 void slot_lastSecondCleanup (); |
174 void slot_lastSecondCleanup (); |
174 void slot_editObject (QListWidgetItem* listitem); |
175 void slot_editObject (QListWidgetItem* listitem); |
175 }; |
176 }; |
176 |
177 |
177 // ----------------------------------------------------------------------------- |
178 // ----------------------------------------------------------------------------- |
|
179 // Pointer to the instance of ForgeWindow. |
|
180 extern ForgeWindow* g_win; |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
178 // Other GUI-related stuff not directly part of ForgeWindow: |
183 // Other GUI-related stuff not directly part of ForgeWindow: |
179 QPixmap getIcon (str iconName); |
184 QPixmap getIcon (str iconName); |
180 vector<quickColor> parseQuickColorMeta (); |
185 vector<quickColor> parseQuickColorMeta (); |
181 bool confirm (str title, str msg); |
186 bool confirm (str title, str msg); |
182 bool confirm (str msg); |
187 bool confirm (str msg); |
186 void makeColorSelector (QComboBox* box); |
191 void makeColorSelector (QComboBox* box); |
187 QDialogButtonBox* makeButtonBox (QDialog& dlg); |
192 QDialogButtonBox* makeButtonBox (QDialog& dlg); |
188 CheckBoxGroup* makeAxesBox (); |
193 CheckBoxGroup* makeAxesBox (); |
189 QImage imageFromScreencap (uchar* data, ushort w, ushort h); |
194 QImage imageFromScreencap (uchar* data, ushort w, ushort h); |
190 |
195 |
191 // ----------------------------------------------------------------------------- |
196 // ============================================================================= |
192 // Pointer to the instance of ForgeWindow. |
197 // ----------------------------------------------------------------------------- |
193 extern ForgeWindow* g_win; |
198 // Takes in pairs of radio buttons and respective values and returns the value of |
|
199 // the first found radio button that was checked. |
|
200 // ============================================================================= |
|
201 template<class T> T radioSwitch( const T& defval, vector<pair<QRadioButton*, T>> haystack ) |
|
202 { |
|
203 for( pair<QRadioButton*, const T&> i : haystack ) |
|
204 if( i.first->isChecked() ) |
|
205 return i.second; |
|
206 |
|
207 return defval; |
|
208 } |
|
209 |
|
210 // ============================================================================= |
|
211 // ----------------------------------------------------------------------------- |
|
212 // Takes in pairs of radio buttons and respective values and checks the first |
|
213 // found radio button to have the given value. |
|
214 // ============================================================================= |
|
215 template<class T> void radioDefault( const T& expr, vector<pair<QRadioButton*, T>> haystack ) |
|
216 { |
|
217 for( pair<QRadioButton*, const T&> i : haystack ) |
|
218 { |
|
219 if( i.second == expr ) |
|
220 { |
|
221 i.first->setChecked( true ); |
|
222 return; |
|
223 } |
|
224 } |
|
225 } |
194 |
226 |
195 // ============================================================================= |
227 // ============================================================================= |
196 // ActionAdder |
228 // ActionAdder |
197 // |
229 // |
198 // The MAKE_ACTION macro expands into - among other stuff - into an instance |
230 // The MAKE_ACTION macro expands into - among other stuff - into an instance |