Merge lp:~hile/mixxx/forumlinks into lp:~mixxxdevelopers/mixxx/trunk
- forumlinks
- Merge into trunk
Proposed by
Ilkka Tuohela
Status: | Merged |
---|---|
Merged at revision: | 3278 |
Proposed branch: | lp:~hile/mixxx/forumlinks |
Merge into: | lp:~mixxxdevelopers/mixxx/trunk |
Diff against target: |
466 lines (+163/-98) 9 files modified
mixxx/res/controllers/Behringer BCD2000.midi.xml (+1/-1) mixxx/res/controllers/Hercules DJ Control AIR.midi.xml (+1/-1) mixxx/src/controllers/controllerpreset.h (+9/-0) mixxx/src/controllers/controllerpresetfilehandler.cpp (+5/-0) mixxx/src/controllers/controllerpresetinfo.cpp (+5/-0) mixxx/src/controllers/controllerpresetinfo.h (+2/-0) mixxx/src/controllers/dlgprefcontroller.cpp (+11/-0) mixxx/src/controllers/dlgprefcontroller.h (+1/-0) mixxx/src/controllers/dlgprefcontrollerdlg.ui (+128/-96) |
To merge this branch: | bzr merge lp:~hile/mixxx/forumlinks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mixxx Development Team | Pending | ||
Review via email:
|
Commit message
Description of the change
Since we seem to have <forums> tags in info headers, I thought it might be useful to show these in UI as well.
This branch implements trivial QLabel with automatic link opening from Qt desktop libs, which will show any <forums> links and provide a clickable link to it.
I also fixed here the two XML parsing errors in hercules air and behringer bcd2000 mappings (URLs contained & instead of entity), these were actually my test cases for the little patch.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'mixxx/res/controllers/Behringer BCD2000.midi.xml' |
2 | --- mixxx/res/controllers/Behringer BCD2000.midi.xml 2012-06-02 17:55:13 +0000 |
3 | +++ mixxx/res/controllers/Behringer BCD2000.midi.xml 2012-06-14 15:38:23 +0000 |
4 | @@ -2,7 +2,7 @@ |
5 | <info> |
6 | <author>Golzo</author> |
7 | <name>Behringer BCD2000</name> |
8 | - <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&t=3563</forums> |
9 | + <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&t=3563</forums> |
10 | </info> |
11 | <controller id="BCD2000 MIDI 1"> |
12 | <scriptfiles> |
13 | |
14 | === modified file 'mixxx/res/controllers/Hercules DJ Control AIR.midi.xml' |
15 | --- mixxx/res/controllers/Hercules DJ Control AIR.midi.xml 2012-06-02 17:58:16 +0000 |
16 | +++ mixxx/res/controllers/Hercules DJ Control AIR.midi.xml 2012-06-14 15:38:23 +0000 |
17 | @@ -2,7 +2,7 @@ |
18 | <info> |
19 | <author>rojaro</author> |
20 | <name>Hercules DJ Control AIR</name> |
21 | - <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&t=3263</forums> |
22 | + <forums>http://www.mixxx.org/forums/viewtopic.php?f=7&t=3263</forums> |
23 | </info> |
24 | <controller id="DJ Control Air"> |
25 | <scriptfiles> |
26 | |
27 | === modified file 'mixxx/src/controllers/controllerpreset.h' |
28 | --- mixxx/src/controllers/controllerpreset.h 2012-05-16 15:00:00 +0000 |
29 | +++ mixxx/src/controllers/controllerpreset.h 2012-06-14 15:38:23 +0000 |
30 | @@ -72,6 +72,14 @@ |
31 | return m_description; |
32 | } |
33 | |
34 | + inline void setForumLink(const QString forumlink) { |
35 | + m_forumlink = forumlink; |
36 | + } |
37 | + |
38 | + inline QString forumlink() const { |
39 | + return m_forumlink; |
40 | + } |
41 | + |
42 | inline void setSchemaVersion(const QString schemaVersion) { |
43 | m_schemaVersion = schemaVersion; |
44 | } |
45 | @@ -108,6 +116,7 @@ |
46 | QString m_name; |
47 | QString m_author; |
48 | QString m_description; |
49 | + QString m_forumlink; |
50 | QString m_schemaVersion; |
51 | QString m_mixxxVersion; |
52 | }; |
53 | |
54 | === modified file 'mixxx/src/controllers/controllerpresetfilehandler.cpp' |
55 | --- mixxx/src/controllers/controllerpresetfilehandler.cpp 2012-04-29 04:31:26 +0000 |
56 | +++ mixxx/src/controllers/controllerpresetfilehandler.cpp 2012-06-14 15:38:23 +0000 |
57 | @@ -42,6 +42,8 @@ |
58 | preset->setAuthor(author.isNull() ? "" : author.text()); |
59 | QDomElement description = info.firstChildElement("description"); |
60 | preset->setDescription(description.isNull() ? "" : description.text()); |
61 | + QDomElement forums = info.firstChildElement("forums"); |
62 | + preset->setForumLink(forums.isNull() ? "" : forums.text()); |
63 | } |
64 | |
65 | QDomElement ControllerPresetFileHandler::getControllerNode(const QDomElement& root, |
66 | @@ -151,6 +153,9 @@ |
67 | if (preset.description().length() > 0) { |
68 | addTextTag(doc, info, "description", preset.description()); |
69 | } |
70 | + if (preset.forumlink().length() > 0) { |
71 | + addTextTag(doc, info, "forums", preset.forumlink()); |
72 | + } |
73 | |
74 | QDomElement controller = doc.createElement("controller"); |
75 | // Strip off the serial number |
76 | |
77 | === modified file 'mixxx/src/controllers/controllerpresetinfo.cpp' |
78 | --- mixxx/src/controllers/controllerpresetinfo.cpp 2012-05-31 06:38:14 +0000 |
79 | +++ mixxx/src/controllers/controllerpresetinfo.cpp 2012-06-14 15:38:23 +0000 |
80 | @@ -24,11 +24,13 @@ |
81 | // info.name Mapping name, used for drop down menus in dialogs |
82 | // info.author Mapping author |
83 | // info.description Mapping description |
84 | + // info.forums Link to mixxx forum discussion for the mapping |
85 | // info.devices.product List of device matches, specific to device type |
86 | path = QFileInfo(preset_path).absoluteFilePath(); |
87 | name = ""; |
88 | author = ""; |
89 | description = ""; |
90 | + forumlink = ""; |
91 | |
92 | QDomElement root = XmlParse::openXMLFile(path, "controller"); |
93 | if (root.isNull()) { |
94 | @@ -52,6 +54,9 @@ |
95 | QDomElement dom_description = info.firstChildElement("description"); |
96 | if (!dom_description.isNull()) description = dom_description.text(); |
97 | |
98 | + QDomElement dom_forums = info.firstChildElement("forums"); |
99 | + if (!dom_forums.isNull()) forumlink = dom_forums.text(); |
100 | + |
101 | QDomElement devices = info.firstChildElement("devices"); |
102 | if (!devices.isNull()) { |
103 | QDomElement product = devices.firstChildElement("product"); |
104 | |
105 | === modified file 'mixxx/src/controllers/controllerpresetinfo.h' |
106 | --- mixxx/src/controllers/controllerpresetinfo.h 2012-05-31 06:38:14 +0000 |
107 | +++ mixxx/src/controllers/controllerpresetinfo.h 2012-06-14 15:38:23 +0000 |
108 | @@ -32,6 +32,7 @@ |
109 | |
110 | inline const QString getName() const { return name; } ; |
111 | inline const QString getDescription() const { return description; }; |
112 | + inline const QString getForumLink() const { return forumlink; }; |
113 | inline const QString getAuthor() const { return author; }; |
114 | |
115 | inline const QList< QHash<QString,QString> > getProducts() const { return products; }; |
116 | @@ -47,6 +48,7 @@ |
117 | QString name; |
118 | QString author; |
119 | QString description; |
120 | + QString forumlink; |
121 | QList< QHash<QString,QString> > products; |
122 | }; |
123 | |
124 | |
125 | === modified file 'mixxx/src/controllers/dlgprefcontroller.cpp' |
126 | --- mixxx/src/controllers/dlgprefcontroller.cpp 2012-05-31 06:38:14 +0000 |
127 | +++ mixxx/src/controllers/dlgprefcontroller.cpp 2012-06-14 15:38:23 +0000 |
128 | @@ -35,6 +35,7 @@ |
129 | |
130 | m_ui.labelLoadedPreset->setText(presetShortName(pPreset)); |
131 | m_ui.labelLoadedPresetDescription->setText(presetDescription(pPreset)); |
132 | + m_ui.labelLoadedPresetForumLink->setText(presetForumLink(pPreset)); |
133 | |
134 | //m_pVerticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); |
135 | //m_pLayout->addItem(m_pVerticalSpacer, 4, 0, 1, 3); |
136 | @@ -97,6 +98,16 @@ |
137 | return description; |
138 | } |
139 | |
140 | +QString DlgPrefController::presetForumLink(const ControllerPresetPointer pPreset) const { |
141 | + QString url = tr("No Forum Link for Mapping"); |
142 | + if (pPreset) { |
143 | + QString link = pPreset->forumlink(); |
144 | + if (link.length() > 0) |
145 | + url = "<a href=\"" +link+ "\">" + link + "</a>"; |
146 | + } |
147 | + return url; |
148 | +} |
149 | + |
150 | void DlgPrefController::addWidgetToLayout(QWidget* pWidget) { |
151 | // Remove the vertical spacer since we're adding stuff |
152 | //m_pLayout->removeItem(m_pVerticalSpacer); |
153 | |
154 | === modified file 'mixxx/src/controllers/dlgprefcontroller.h' |
155 | --- mixxx/src/controllers/dlgprefcontroller.h 2012-05-16 15:00:00 +0000 |
156 | +++ mixxx/src/controllers/dlgprefcontroller.h 2012-06-14 15:38:23 +0000 |
157 | @@ -68,6 +68,7 @@ |
158 | private: |
159 | QString presetShortName(const ControllerPresetPointer pPreset) const; |
160 | QString presetDescription(const ControllerPresetPointer pPreset) const; |
161 | + QString presetForumLink(const ControllerPresetPointer pPreset) const; |
162 | void savePreset(QString path); |
163 | |
164 | void enableDevice(); |
165 | |
166 | === modified file 'mixxx/src/controllers/dlgprefcontrollerdlg.ui' |
167 | --- mixxx/src/controllers/dlgprefcontrollerdlg.ui 2012-05-16 15:00:00 +0000 |
168 | +++ mixxx/src/controllers/dlgprefcontrollerdlg.ui 2012-06-14 15:38:23 +0000 |
169 | @@ -6,8 +6,8 @@ |
170 | <rect> |
171 | <x>0</x> |
172 | <y>0</y> |
173 | - <width>603</width> |
174 | - <height>536</height> |
175 | + <width>754</width> |
176 | + <height>754</height> |
177 | </rect> |
178 | </property> |
179 | <property name="sizePolicy"> |
180 | @@ -20,6 +20,32 @@ |
181 | <string>Dialog</string> |
182 | </property> |
183 | <layout class="QGridLayout" name="gridLayout_4"> |
184 | + <item row="8" column="0"> |
185 | + <spacer name="verticalSpacer"> |
186 | + <property name="orientation"> |
187 | + <enum>Qt::Vertical</enum> |
188 | + </property> |
189 | + <property name="sizeHint" stdset="0"> |
190 | + <size> |
191 | + <width>20</width> |
192 | + <height>40</height> |
193 | + </size> |
194 | + </property> |
195 | + </spacer> |
196 | + </item> |
197 | + <item row="7" column="0"> |
198 | + <widget class="QLabel" name="labelTroubleshooting"> |
199 | + <property name="text"> |
200 | + <string><a href="http://mixxx.org/wiki/doku.php/midi_scripting">Troubleshooting</a></string> |
201 | + </property> |
202 | + <property name="alignment"> |
203 | + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
204 | + </property> |
205 | + <property name="openExternalLinks"> |
206 | + <bool>true</bool> |
207 | + </property> |
208 | + </widget> |
209 | + </item> |
210 | <item row="0" column="0"> |
211 | <widget class="QLabel" name="labelDeviceName"> |
212 | <property name="enabled"> |
213 | @@ -44,71 +70,23 @@ |
214 | </property> |
215 | </widget> |
216 | </item> |
217 | - <item row="6" column="0"> |
218 | - <widget class="QLabel" name="labelTroubleshooting"> |
219 | - <property name="text"> |
220 | - <string><a href="http://mixxx.org/wiki/doku.php/midi_scripting">Troubleshooting</a></string> |
221 | - </property> |
222 | - <property name="alignment"> |
223 | - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> |
224 | - </property> |
225 | - <property name="openExternalLinks"> |
226 | + <item row="1" column="0"> |
227 | + <widget class="QLabel" name="labelDeviceCategory"> |
228 | + <property name="enabled"> |
229 | <bool>true</bool> |
230 | </property> |
231 | - </widget> |
232 | - </item> |
233 | - <item row="5" column="0"> |
234 | - <widget class="QPushButton" name="pushButtonLearning"> |
235 | - <property name="enabled"> |
236 | - <bool>false</bool> |
237 | - </property> |
238 | <property name="sizePolicy"> |
239 | - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
240 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> |
241 | <horstretch>0</horstretch> |
242 | <verstretch>0</verstretch> |
243 | </sizepolicy> |
244 | </property> |
245 | - <property name="maximumSize"> |
246 | - <size> |
247 | - <width>300</width> |
248 | - <height>16777215</height> |
249 | - </size> |
250 | - </property> |
251 | - <property name="toolTip"> |
252 | - <string>Click to start the Controller Learning wizard.</string> |
253 | - </property> |
254 | <property name="text"> |
255 | - <string>Learning Wizard (MIDI Only)</string> |
256 | + <string>TextLabel</string> |
257 | </property> |
258 | </widget> |
259 | </item> |
260 | - <item row="5" column="1"> |
261 | - <spacer name="horizontalSpacer"> |
262 | - <property name="orientation"> |
263 | - <enum>Qt::Horizontal</enum> |
264 | - </property> |
265 | - <property name="sizeHint" stdset="0"> |
266 | - <size> |
267 | - <width>40</width> |
268 | - <height>20</height> |
269 | - </size> |
270 | - </property> |
271 | - </spacer> |
272 | - </item> |
273 | - <item row="7" column="0"> |
274 | - <spacer name="verticalSpacer"> |
275 | - <property name="orientation"> |
276 | - <enum>Qt::Vertical</enum> |
277 | - </property> |
278 | - <property name="sizeHint" stdset="0"> |
279 | - <size> |
280 | - <width>20</width> |
281 | - <height>40</height> |
282 | - </size> |
283 | - </property> |
284 | - </spacer> |
285 | - </item> |
286 | - <item row="4" column="0" colspan="2"> |
287 | + <item row="4" column="0" colspan="3"> |
288 | <widget class="QGroupBox" name="groupBoxPresets"> |
289 | <property name="sizePolicy"> |
290 | <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> |
291 | @@ -138,7 +116,45 @@ |
292 | <property name="margin"> |
293 | <number>0</number> |
294 | </property> |
295 | - <item row="2" column="2"> |
296 | + <item row="0" column="3"> |
297 | + <widget class="QLabel" name="labelLoadedPreset"> |
298 | + <property name="sizePolicy"> |
299 | + <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
300 | + <horstretch>0</horstretch> |
301 | + <verstretch>0</verstretch> |
302 | + </sizepolicy> |
303 | + </property> |
304 | + <property name="minimumSize"> |
305 | + <size> |
306 | + <width>300</width> |
307 | + <height>0</height> |
308 | + </size> |
309 | + </property> |
310 | + <property name="text"> |
311 | + <string notr="true">(preset name goes here)</string> |
312 | + </property> |
313 | + <property name="wordWrap"> |
314 | + <bool>true</bool> |
315 | + </property> |
316 | + </widget> |
317 | + </item> |
318 | + <item row="1" column="1"> |
319 | + <widget class="QLabel" name="label_description"> |
320 | + <property name="sizePolicy"> |
321 | + <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> |
322 | + <horstretch>0</horstretch> |
323 | + <verstretch>0</verstretch> |
324 | + </sizepolicy> |
325 | + </property> |
326 | + <property name="text"> |
327 | + <string>Description:</string> |
328 | + </property> |
329 | + <property name="alignment"> |
330 | + <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set> |
331 | + </property> |
332 | + </widget> |
333 | + </item> |
334 | + <item row="4" column="3"> |
335 | <widget class="QComboBox" name="comboBoxPreset"> |
336 | <property name="sizePolicy"> |
337 | <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
338 | @@ -154,7 +170,7 @@ |
339 | </property> |
340 | </widget> |
341 | </item> |
342 | - <item row="2" column="1"> |
343 | + <item row="4" column="1"> |
344 | <widget class="QLabel" name="label"> |
345 | <property name="sizePolicy"> |
346 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> |
347 | @@ -195,39 +211,7 @@ |
348 | </property> |
349 | </widget> |
350 | </item> |
351 | - <item row="0" column="2"> |
352 | - <widget class="QLabel" name="labelLoadedPreset"> |
353 | - <property name="sizePolicy"> |
354 | - <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> |
355 | - <horstretch>0</horstretch> |
356 | - <verstretch>0</verstretch> |
357 | - </sizepolicy> |
358 | - </property> |
359 | - <property name="text"> |
360 | - <string notr="true">(preset name goes here)</string> |
361 | - </property> |
362 | - <property name="wordWrap"> |
363 | - <bool>true</bool> |
364 | - </property> |
365 | - </widget> |
366 | - </item> |
367 | - <item row="1" column="1"> |
368 | - <widget class="QLabel" name="label_description"> |
369 | - <property name="sizePolicy"> |
370 | - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> |
371 | - <horstretch>0</horstretch> |
372 | - <verstretch>0</verstretch> |
373 | - </sizepolicy> |
374 | - </property> |
375 | - <property name="text"> |
376 | - <string>Description:</string> |
377 | - </property> |
378 | - <property name="alignment"> |
379 | - <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set> |
380 | - </property> |
381 | - </widget> |
382 | - </item> |
383 | - <item row="1" column="2"> |
384 | + <item row="1" column="3" rowspan="2" alignment="Qt::AlignLeft|Qt::AlignTop"> |
385 | <widget class="QLabel" name="labelLoadedPresetDescription"> |
386 | <property name="sizePolicy"> |
387 | <sizepolicy hsizetype="Maximum" vsizetype="Fixed"> |
388 | @@ -252,25 +236,73 @@ |
389 | </property> |
390 | </widget> |
391 | </item> |
392 | + <item row="3" column="3"> |
393 | + <widget class="QLabel" name="labelLoadedPresetForumLink"> |
394 | + <property name="focusPolicy"> |
395 | + <enum>Qt::ClickFocus</enum> |
396 | + </property> |
397 | + <property name="inputMethodHints"> |
398 | + <set>Qt::ImhUrlCharactersOnly</set> |
399 | + </property> |
400 | + <property name="text"> |
401 | + <string>(forum link for preset goes here)</string> |
402 | + </property> |
403 | + <property name="openExternalLinks"> |
404 | + <bool>true</bool> |
405 | + </property> |
406 | + <property name="textInteractionFlags"> |
407 | + <set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set> |
408 | + </property> |
409 | + </widget> |
410 | + </item> |
411 | + <item row="3" column="1" alignment="Qt::AlignRight"> |
412 | + <widget class="QLabel" name="label_3"> |
413 | + <property name="text"> |
414 | + <string>Mixxx Forums:</string> |
415 | + </property> |
416 | + </widget> |
417 | + </item> |
418 | </layout> |
419 | </widget> |
420 | </item> |
421 | - <item row="1" column="0"> |
422 | - <widget class="QLabel" name="labelDeviceCategory"> |
423 | + <item row="6" column="0"> |
424 | + <widget class="QPushButton" name="pushButtonLearning"> |
425 | <property name="enabled"> |
426 | - <bool>true</bool> |
427 | + <bool>false</bool> |
428 | </property> |
429 | <property name="sizePolicy"> |
430 | - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> |
431 | + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> |
432 | <horstretch>0</horstretch> |
433 | <verstretch>0</verstretch> |
434 | </sizepolicy> |
435 | </property> |
436 | + <property name="maximumSize"> |
437 | + <size> |
438 | + <width>300</width> |
439 | + <height>16777215</height> |
440 | + </size> |
441 | + </property> |
442 | + <property name="toolTip"> |
443 | + <string>Click to start the Controller Learning wizard.</string> |
444 | + </property> |
445 | <property name="text"> |
446 | - <string>TextLabel</string> |
447 | + <string>Learning Wizard (MIDI Only)</string> |
448 | </property> |
449 | </widget> |
450 | </item> |
451 | + <item row="6" column="1"> |
452 | + <spacer name="horizontalSpacer"> |
453 | + <property name="orientation"> |
454 | + <enum>Qt::Horizontal</enum> |
455 | + </property> |
456 | + <property name="sizeHint" stdset="0"> |
457 | + <size> |
458 | + <width>40</width> |
459 | + <height>20</height> |
460 | + </size> |
461 | + </property> |
462 | + </spacer> |
463 | + </item> |
464 | </layout> |
465 | </widget> |
466 | <resources/> |