diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2021-01-06 01:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 01:46:28 +0100 |
commit | d688a25873c3432a9cf47cba66543e7176c9e10f (patch) | |
tree | 258dae248cdd5e67bdefa9603375685390a6ca18 /src | |
parent | 3ebc02c78a1d368a0c8dc6650f920018f8d06534 (diff) | |
parent | 678df3f9fdc7a268ee6f7eede57b8cea38f3f5f8 (diff) |
Merge pull request #3464 from ronso0/pref-link-color
Preferences/About: draw links with a more readable color, improve defs_urls usage
Diffstat (limited to 'src')
23 files changed, 260 insertions, 145 deletions
diff --git a/src/controllers/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index dcfc38d0f9..f6ca3580e3 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -38,6 +38,8 @@ DlgPrefController::DlgPrefController(QWidget* parent, m_pOutputProxyModel(nullptr), m_bDirty(false) { m_ui.setupUi(this); + // Create text color for the file and wiki links + createLinkColor(); initTableView(m_ui.m_pInputMappingTableView); initTableView(m_ui.m_pOutputMappingTableView); @@ -234,40 +236,46 @@ QString DlgPrefController::presetAuthor( return tr("No Author"); } -QString DlgPrefController::presetForumLink( +QString DlgPrefController::presetSupportLinks( const ControllerPresetPointer pPreset) const { - QString url; - if (pPreset) { - QString link = pPreset->forumlink(); - if (link.length() > 0) { - url = "<a href=\"" + link + "\">Mixxx Forums</a>"; - } + if (!pPreset) { + return QString(); } - return url; -} -QString DlgPrefController::presetWikiLink( - const ControllerPresetPointer pPreset) const { - QString url; - if (pPreset) { - QString link = pPreset->wikilink(); - if (link.length() > 0) { - url = "<a href=\"" + link + "\">Mixxx Wiki</a>"; - } + QStringList linkList; + + QString forumLink = pPreset->forumlink(); + if (!forumLink.isEmpty()) { + linkList << coloredLinkString( + m_pLinkColor, + "Mixxx Forums", + forumLink); } - return url; -} -QString DlgPrefController::presetManualLink( - const ControllerPresetPointer pPreset) const { - QString url; - if (pPreset) { - QString link = pPreset->manualLink(); - if (!link.isEmpty()) { - url = "<a href=\"" + link + "\">Manual</a>"; - } + QString wikiLink = pPreset->wikilink(); + if (!wikiLink.isEmpty()) { + linkList << coloredLinkString( + m_pLinkColor, + "Mixxx Wiki", + wikiLink); + } + + QString manualLink = pPreset->manualLink(); + if (!manualLink.isEmpty()) { + linkList << coloredLinkString( + m_pLinkColor, + "Mixxx Manual", + manualLink); } - return url; + + // There is always at least one support link. + // TODO(rryan): This is a horrible general support link for MIDI! + linkList << coloredLinkString( + m_pLinkColor, + tr("Troubleshooting"), + MIXXX_WIKI_MIDI_SCRIPTING_URL); + + return QString(linkList.join(" ")); } QString DlgPrefController::presetFileLinks( @@ -279,20 +287,20 @@ QString DlgPrefController::presetFileLinks( const QString builtinFileSuffix = QStringLiteral(" (") + tr("built-in") + QStringLiteral(")"); QString systemPresetPath = resourcePresetsPath(m_pConfig); QStringList linkList; - QString xmlFileName = QFileInfo(pPreset->filePath()).fileName(); - QString xmlFileLink = QStringLiteral("<a href=\"") + - pPreset->filePath() + QStringLiteral("\">") + - xmlFileName + QStringLiteral("</a>"); + QString xmlFileLink = coloredLinkString( + m_pLinkColor, + QFileInfo(pPreset->filePath()).fileName(), + pPreset->filePath()); if (pPreset->filePath().startsWith(systemPresetPath)) { xmlFileLink += builtinFileSuffix; } linkList << xmlFileLink; for (const auto& script : pPreset->getScriptFiles()) { - QString scriptFileLink = QStringLiteral("<a href=\"") + - script.file.absoluteFilePath() + QStringLiteral("\">") + - script.name + QStringLiteral("</a>"); - + QString scriptFileLink = coloredLinkString( + m_pLinkColor, + script.name, + script.file.absoluteFilePath()); if (!script.file.exists()) { scriptFileLink += QStringLiteral(" (") + tr("missing") + QStringLiteral(")"); @@ -647,35 +655,8 @@ void DlgPrefController::slotShowPreset(ControllerPresetPointer preset) { m_ui.labelLoadedPreset->setText(presetName(preset)); m_ui.labelLoadedPresetDescription->setText(presetDescription(preset)); m_ui.labelLoadedPresetAuthor->setText(presetAuthor(preset)); - QStringList supportLinks; - - QString forumLink = presetForumLink(preset); - if (forumLink.length() > 0) { - supportLinks << forumLink; - } - - QString manualLink = presetManualLink(preset); - if (manualLink.length() > 0) { - supportLinks << manualLink; - } - - QString wikiLink = presetWikiLink(preset); - if (wikiLink.length() > 0) { - supportLinks << wikiLink; - } - - // There is always at least one support link. - // TODO(rryan): This is a horrible general support link for MIDI! - QString troubleShooting = QString( - "<a href=\"http://mixxx.org/wiki/doku.php/midi_scripting\">%1</a>") - .arg(tr("Troubleshooting")); - supportLinks << troubleShooting; - - QString support = supportLinks.join(" "); - m_ui.labelLoadedPresetSupportLinks->setText(support); - - QString mappingFileLinks = presetFileLinks(preset); - m_ui.labelLoadedPresetScriptFileLinks->setText(mappingFileLinks); + m_ui.labelLoadedPresetSupportLinks->setText(presetSupportLinks(preset)); + m_ui.labelLoadedPresetScriptFileLinks->setText(presetFileLinks(preset)); // We mutate this preset so keep a reference to it while we are using it. // TODO(rryan): Clone it? Technically a waste since nothing else uses this diff --git a/src/controllers/dlgprefcontroller.h b/src/controllers/dlgprefcontroller.h index 8b114d9719..75407f616a 100644 --- a/src/controllers/dlgprefcontroller.h +++ b/src/controllers/dlgprefcontroller.h @@ -66,9 +66,7 @@ class DlgPrefController : public DlgPreferencePage { QString presetName(const ControllerPresetPointer pPreset) const; QString presetAuthor(const ControllerPresetPointer pPreset) const; QString presetDescription(const ControllerPresetPointer pPreset) const; - QString presetForumLink(const ControllerPresetPointer pPreset) const; - QString presetManualLink(const ControllerPresetPointer pPreset) const; - QString presetWikiLink(const ControllerPresetPointer pPreset) const; + QString presetSupportLinks(const ControllerPresetPointer pPreset) const; QString presetFileLinks(const ControllerPresetPointer pPreset) const; void applyPresetChanges(); void savePreset(); diff --git a/src/controllers/dlgprefcontrollers.cpp b/src/controllers/dlgprefcontrollers.cpp index c734944bad..9adef3a00c 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -19,6 +19,8 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences, m_pControllerManager(pControllerManager), m_pControllerTreeItem(pControllerTreeItem) { setupUi(this); + // Create text color for the cue mode link "?" to the manual + createLinkColor(); setupControllerWidgets(); const QString presetsPath = userPresetsPath(m_pConfig); @@ -30,6 +32,42 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences, &ControllerManager::devicesChanged, this, &DlgPrefControllers::rescanControllers); + + // Setting the description text here instead of in the ui file allows to paste + // a formatted link (text color is a more readable blend of text color and original link color). + txtPresetsOverview->setText(tr( + "Mixxx uses \"mappings\" to connect messages from your controller to " + "controls in Mixxx. If you do not see a mapping for your controller " + "in the \"Load Mapping\" menu when you click on your controller on the " + "left sidebar, you may be able to download one online from the %1. " + "Place the XML (.xml) and Javascript (.js) file(s) in the \"User Mapping " + "Folder\" then restart Mixxx. If you download a mapping in a ZIP file, " + "extract the XML and Javascript file(s) from the ZIP file to your " + "\"User Mapping Folder\" then restart Mixxx.") + .arg(coloredLinkString( + m_pLinkColor, + QStringLiteral("Mixxx Controller Forums"), + MIXXX_CONTROLLER_FORUMS_URL))); + + txtHardwareCompatibility->setText(coloredLinkString( + m_pLinkColor, + tr("Mixxx DJ Hardware Guide"), + MIXXX_WIKI_HARDWARE_COMPATIBILITY_URL)); + + txtControllerForums->setText(coloredLinkString( + m_pLinkColor, + tr("MIDI Mapping File Format"), + MIXXX_WIKI_CONTROLLER_PRESET_FORMAT_URL)); + + txtControllerPresetFormat->setText(coloredLinkString( + m_pLinkColor, + QStringLiteral("Mixxx Controller Forums"), + MIXXX_CONTROLLER_FORUMS_URL)); + + txtControllerScripting->setText(coloredLinkString( + m_pLinkColor, + tr("MIDI Scripting with Javascript"), + MIXXX_WIKI_MIDI_SCRIPTING_URL)); } DlgPrefControllers::~DlgPrefControllers() { diff --git a/src/controllers/dlgprefcontrollersdlg.ui b/src/controllers/dlgprefcontrollersdlg.ui index 45894afc14..5f1aa4e8eb 100644 --- a/src/controllers/dlgprefcontrollersdlg.ui +++ b/src/controllers/dlgprefcontrollersdlg.ui @@ -87,9 +87,6 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="text"> - <string>Mixxx uses "mappings" to connect messages from your controller to controls in Mixxx. If you do not see a mapping for your controller in the "Load Mapping" menu when you click on your controller on the left sidebar, you may be able to download one online from the <a href="https://mixxx.discourse.group/c/controller-mappings/10">Mixxx Forum</a>. Place the XML (.xml) and Javascript (.js) file(s) in the "User Mapping Folder" then restart Mixxx. If you download a mapping in a ZIP file, extract the XML and Javascript file(s) from the ZIP file to your "User Mapping Folder" then restart Mixxx:</string> - </property> <property name="wordWrap"> <bool>true</bool> </property> @@ -138,9 +135,6 @@ <layout class="QGridLayout" name="gridLayout_2"> <item row="0" column="0"> <widget class="QLabel" name="txtHardwareCompatibility"> - <property name="text"> - <string><a href="https://github.com/mixxxdj/mixxx/wiki/Hardware%20compatibility">Mixxx DJ Hardware Guide</a></string> - </property> <property name="openExternalLinks"> <bool>true</bool> </property> @@ -148,9 +142,6 @@ </item> <item row="0" column="1"> <widget class="QLabel" name="txtControllerForums"> - <property name="text"> - <string><a href="https://mixxx.discourse.group/c/controller-mappings/10">Mixxx Controller Forums</a></string> - </property> <property name="openExternalLinks"> <bool>true</bool> </property> @@ -158,9 +149,6 @@ </item> <item row="1" column="0"> <widget class="QLabel" name="txtControllerPresetFormat"> - <property name="text"> - <string><a href="https://github.com/mixxxdj/mixxx/wiki/Midi-Controller-Mapping-File-Format">MIDI Mapping File Format</a></string> - </property> <property name="openExternalLinks"> <bool>true</bool> </property> @@ -168,9 +156,6 @@ </item> <item row="1" column="1"> <widget class="QLabel" name="txtControllerScripting"> - <property name="text"> - <string><a href="https://github.com/mixxxdj/mixxx/wiki/midi%20scripting">MIDI Scripting with Javascript</a></string> - </property> <property name="openExternalLinks"> <bool>true</bool> </property> diff --git a/src/controllers/midi/midicontroller.cpp b/src/controllers/midi/midicontroller.cpp index fd88cf8390..430141fe8e 100644 --- a/src/controllers/midi/midicontroller.cpp +++ b/src/controllers/midi/midicontroller.cpp @@ -4,6 +4,7 @@ #include "controllers/controllerdebug.h" #include "controllers/defs_controllers.h" #include "controllers/midi/midiutils.h" +#include "defs_urls.h" #include "errordialoghandler.h" #include "mixer/playermanager.h" #include "moc_midicontroller.cpp" @@ -131,9 +132,10 @@ void MidiController::createOutputHandlers() { QString detailsText = tr("* Check to see that the MixxxControl " "names are spelled correctly in the mapping " "file (.xml)\n"); - detailsText += tr("* Make sure the MixxxControls in question actually exist." - " Visit this wiki page for a complete list: "); - detailsText += "http://mixxx.org/wiki/doku.php/mixxxcontrols\n\n"; + detailsText += tr( + "* Make sure the MixxxControls in question actually exist." + " Visit the manual for a complete list: "); + detailsText += MIXXX_MANUAL_CONTROLS_URL + QStringLiteral("\n\n"); detailsText += failures.join("\n"); props->setDetails(detailsText); ErrorDialogHandler::instance()->requestErrorDialog(props); diff --git a/src/defs_urls.h b/src/defs_urls.h index 4e96c42afe..59b1bf4147 100644 --- a/src/defs_urls.h +++ b/src/defs_urls.h @@ -1,23 +1,42 @@ #pragma once #define MIXXX_WEBSITE_URL "https://www.mixxx.org" +#define MIXXX_WEBSITE_SHORT_URL "www.mixxx.org" #define MIXXX_SUPPORT_URL "https://www.mixxx.org/support/" #define MIXXX_TRANSLATION_URL "https://www.transifex.com/projects/p/mixxxdj/" #define MIXXX_FEEDBACK_URL "https://goo.gl/forms/IHf3JK7Q9DXmExXc2" + +#define MIXXX_CONTROLLER_FORUMS_URL \ + "https://mixxx.discourse.group/c/controller-mappings/10" + +#define MIXXX_WIKI_URL "https://github.com/mixxxdj/mixxx/wiki" +#define MIXXX_WIKI_TROUBLESHOOTING_SOUND_URL \ + MIXXX_WIKI_URL "/troubleshooting#i-cant-select-my-sound-card-in-the-sound-hardware-preferences" +#define MIXXX_WIKI_HARDWARE_COMPATIBILITY_URL \ + MIXXX_WIKI_URL "/Hardware-Compatibility" +#define MIXXX_WIKI_AUDIO_LATENCY_URL \ + MIXXX_WIKI_URL "/Adjusting-Audio-Latency" +#define MIXXX_WIKI_CONTROLLER_PRESET_FORMAT_URL \ + MIXXX_WIKI_URL "/Midi-Controller-Mapping-File-Format" +#define MIXXX_WIKI_MIDI_SCRIPTING_URL \ + MIXXX_WIKI_URL "/Midi-Scripting" + #define MIXXX_MANUAL_URL "https://manual.mixxx.org/2.3" #define MIXXX_MANUAL_SHORTCUTS_URL \ MIXXX_MANUAL_URL "/chapters/controlling_mixxx.html#using-a-keyboard" #define MIXXX_MANUAL_CONTROLLERS_URL \ - MIXXX_MANUAL_URL \ - "/chapters/controlling_mixxx.html#using-midi-hid-controllers" + MIXXX_MANUAL_URL "/chapters/controlling_mixxx.html#using-midi-hid-controllers" #define MIXXX_MANUAL_CONTROLLERMANUAL_PREFIX \ - MIXXX_MANUAL_URL \ - "/hardware/controllers/" + MIXXX_MANUAL_URL "/hardware/controllers/" #define MIXXX_MANUAL_CONTROLLERMANUAL_SUFFIX ".html" +#define MIXXX_MANUAL_CONTROLS_URL \ + MIXXX_MANUAL_URL "/chapters/advanced_topics.html#mixxx-controls" #define MIXXX_MANUAL_SOUND_URL \ MIXXX_MANUAL_URL "/chapters/preferences.html#sound-hardware" #define MIXXX_MANUAL_LIBRARY_URL \ MIXXX_MANUAL_URL "/chapters/preferences.html#library" +#define MIXXX_MANUAL_CUE_MODES_URL \ + MIXXX_MANUAL_URL "/chapters/user_interface.html#using-cue-modes" #define MIXXX_MANUAL_BEATS_URL \ MIXXX_MANUAL_URL "/chapters/preferences.html#beat-detection" #define MIXXX_MANUAL_KEY_URL \ @@ -28,4 +47,6 @@ MIXXX_MANUAL_URL "/chapters/livebroadcasting.html#configuring-mixxx" #define MIXXX_MANUAL_VINYL_URL \ MIXXX_MANUAL_URL "/chapters/vinyl_control.html#configuring-vinyl-control" +#define MIXXX_MANUAL_VINYL_TROUBLESHOOTING_URL \ + MIXXX_MANUAL_URL "/chapters/vinyl_control.html#troubleshooting" #define MIXXX_MANUAL_FILENAME "Mixxx-Manual.pdf" diff --git a/src/dialog/dlgabout.cpp b/src/dialog/dlgabout.cpp index 1b91eb9b2f..3029b9b3be 100644 --- a/src/dialog/dlgabout.cpp +++ b/src/dialog/dlgabout.cpp @@ -2,7 +2,9 @@ #include <QFile> +#include "defs_urls.h" #include "moc_dlgabout.cpp" +#include "util/color/color.h" #include "util/version.h" DlgAbout::DlgAbout(QWidget* parent) : QDialog(parent), Ui::DlgAboutDlg() { @@ -337,6 +339,14 @@ DlgAbout::DlgAbout(QWidget* parent) : QDialog(parent), Ui::DlgAboutDlg() { specialThanks.join("<br>")); textBrowser->setHtml(sections.join("")); + textWebsiteLink->setText( + QString("<a style=\"color:%1;\" href=\"%2\">%3</a>") + .arg(Color::blendColors(palette().link().color(), + palette().text().color()) + .name(), + MIXXX_WEBSITE_URL, + tr("Official Website"))); + connect(buttonBox, &QDialogButtonBox::accepted, this, &DlgAbout::accept); connect(buttonBox, &QDialogButtonBox::rejected, this, &DlgAbout::reject); } diff --git a/src/dialog/dlgaboutdlg.ui b/src/dialog/dlgaboutdlg.ui index 5b506e53e3..9d6d6deda7 100644 --- a/src/dialog/dlgaboutdlg.ui +++ b/src/dialog/dlgaboutdlg.ui @@ -171,10 +171,7 @@ p, li { white-space: pre-wrap; } <item> <layout class="QHBoxLayout" name="horizontalLayout_2"> <item> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string><a href="http://mixxx.org/">Official Website</a></string> - </property> + <widget class="QLabel" name="textWebsiteLink"> <property name="openExternalLinks"> <bool>true</bool> </property> diff --git a/src/mixxx.cpp b/src/mixxx.cpp index 7de872cd88..3de77c1b8a 100644 --- a/src/mixxx.cpp +++ b/src/mixxx.cpp @@ -29,6 +29,7 @@ #include <QUrl> #include <QtDebug> +#include "defs_urls.h" #include "dialog/dlgabout.h" #include "dialog/dlgdevelopertools.h" #include "effects/builtin/builtinbackend.h" @@ -1005,9 +1006,7 @@ QDialog::DialogCode MixxxMainWindow::soundDeviceErrorDlg( *retryClicked = true; return QDialog::Accepted; } else if (msgBox.clickedButton() == wikiButton) { - QDesktopServices::openUrl(QUrl( - "http://mixxx.org/wiki/doku.php/troubleshooting" - "#i_can_t_select_my_sound_card_in_the_sound_hardware_preferences")); + QDesktopServices::openUrl(QUrl(MIXXX_WIKI_TROUBLESHOOTING_SOUND_URL)); wikiButton->setEnabled(false); } else if (msgBox.clickedButton() == reconfigureButton) { msgBox.hide(); diff --git a/src/preferences/dialog/dlgprefdeck.cpp b/src/preferences/dialog/dlgprefdeck.cpp index 0cfae01a2a..23fb53a23f 100644 --- a/src/preferences/dialog/dlgprefdeck.cpp +++ b/src/preferences/dialog/dlgprefdeck.cpp @@ -50,6 +50,8 @@ DlgPrefDeck::DlgPrefDeck(QWidget* parent, m_iNumConfiguredDecks(0), m_iNumConfiguredSamplers(0) { setupUi(this); + // Create text color for the cue mode link "?" to the manual + createLinkColor(); m_pNumDecks->connectValueChanged(this, [=](double value){slotNumDecksChanged(value);}); slotNumDecksChanged(m_pNumDecks->get(), true); @@ -333,11 +335,11 @@ DlgPrefDeck::DlgPrefDeck(QWidget* parent, // // Add "(?)" with a manual link to the label - labelCueMode->setText( - labelCueMode->text() + - " <a href=\"" + - MIXXX_MANUAL_URL + - "/chapters/user_interface.html#using-cue-modes\">(?)</a>"); + labelCueMode->setText(labelCueMode->text() + QStringLiteral(" ") + + coloredLinkString( + m_pLinkColor, + QStringLiteral("(?)"), + MIXXX_MANUAL_CUE_MODES_URL)); // // Ramping Temporary Rate Change configuration diff --git a/src/preferences/dialog/dlgpreferences.cpp b/src/preferences/dialog/dlgpreferences.cpp index 8297f500d4..e0b48a3384 100644 --- a/src/preferences/dialog/dlgpreferences.cpp +++ b/src/preferences/dialog/dlgpreferences.cpp @@ -171,20 +171,27 @@ DlgPreferences::~DlgPreferences() { } void DlgPreferences::createIcons() { + QString iconSetPath(":/images/preferences/"); + // If the text of the OS theme is bright let's also pick a bright icon set. + QString iconSetColor = QStringLiteral("dark/"); + if (!Color::isDimColor(palette().text().color())) { + iconSetColor = QStringLiteral("light/"); + } + iconSetPath += iconSetColor; m_pSoundButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pSoundButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_soundhardware.svg")); + m_pSoundButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_soundhardware.svg")); m_pSoundButton->setText(0, tr("Sound Hardware")); m_pSoundButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pSoundButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pLibraryButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pLibraryButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_library.svg")); + m_pLibraryButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_library.svg")); m_pLibraryButton->setText(0, tr("Library")); m_pLibraryButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pLibraryButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pControllerTreeItem = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pControllerTreeItem->setIcon(0, QIcon(":/images/preferences/ic_preferences_controllers.svg")); + m_pControllerTreeItem->setIcon(0, QIcon(iconSetPath + "ic_preferences_controllers.svg")); m_pControllerTreeItem->setText(0, tr("Controllers")); m_pControllerTreeItem->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pControllerTreeItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); @@ -193,7 +200,7 @@ void DlgPreferences::createIcons() { m_pVinylControlButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); //QT screws up my nice vinyl svg for some reason, so we'll use a PNG version //instead... - m_pVinylControlButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_vinyl.svg")); + m_pVinylControlButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_vinyl.svg")); m_pVinylControlButton->setText(0, tr("Vinyl Control")); m_pVinylControlButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pVinylControlButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); @@ -201,103 +208,103 @@ void DlgPreferences::createIcons() { m_pVinylControlButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); //QT screws up my nice vinyl svg for some reason, so we'll use a PNG version //instead... - m_pVinylControlButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_vinyl.svg")); + m_pVinylControlButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_vinyl.svg")); m_pVinylControlButton->setText(0, tr("Vinyl Control")); m_pVinylControlButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pVinylControlButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #endif m_pInterfaceButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pInterfaceButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_interface.svg")); + m_pInterfaceButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_interface.svg")); m_pInterfaceButton->setText(0, tr("Interface")); m_pInterfaceButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pInterfaceButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pWaveformButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pWaveformButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_waveforms.svg")); + m_pWaveformButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_waveforms.svg")); m_pWaveformButton->setText(0, tr("Waveforms")); m_pWaveformButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pWaveformButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pDecksButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pDecksButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_decks.svg")); + m_pDecksButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_decks.svg")); m_pDecksButton->setText(0, tr("Decks")); m_pDecksButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pDecksButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pColorsButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pColorsButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_colors.svg")); + m_pColorsButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_colors.svg")); m_pColorsButton->setText(0, tr("Colors")); m_pColorsButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pColorsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pEqButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pEqButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_equalizers.svg")); + m_pEqButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_equalizers.svg")); m_pEqButton->setText(0, tr("Equalizers")); m_pEqButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pEqButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pCrossfaderButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pCrossfaderButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_crossfader.svg")); + m_pCrossfaderButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_crossfader.svg")); m_pCrossfaderButton->setText(0, tr("Crossfader")); m_pCrossfaderButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pCrossfaderButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pEffectsButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pEffectsButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_effects.svg")); + m_pEffectsButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_effects.svg")); m_pEffectsButton->setText(0, tr("Effects")); m_pEffectsButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pEffectsButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #ifdef __LILV__ m_pLV2Button = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pLV2Button->setIcon(0, QIcon(":/images/preferences/ic_preferences_lv2.svg")); + m_pLV2Button->setIcon(0, QIcon(iconSetPath + "ic_preferences_lv2.svg")); m_pLV2Button->setText(0, tr("LV2 Plugins")); m_pLV2Button->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pLV2Button->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #endif /* __LILV__ */ m_pAutoDJButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pAutoDJButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_autodj.svg")); + m_pAutoDJButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_autodj.svg")); m_pAutoDJButton->setText(0, tr("Auto DJ")); m_pAutoDJButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pAutoDJButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #ifdef __BROADCAST__ m_pBroadcastButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pBroadcastButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_broadcast.svg")); + m_pBroadcastButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_broadcast.svg")); m_pBroadcastButton->setText(0, tr("Live Broadcasting")); m_pBroadcastButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pBroadcastButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #endif m_pRecordingButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pRecordingButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_recording.svg")); + m_pRecordingButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_recording.svg")); m_pRecordingButton->setText(0, tr("Recording")); m_pRecordingButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pRecordingButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pBeatDetectionButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pBeatDetectionButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_bpmdetect.svg")); + m_pBeatDetectionButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_bpmdetect.svg")); m_pBeatDetectionButton->setText(0, tr("Beat Detection")); m_pBeatDetectionButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pBeatDetectionButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pKeyDetectionButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pKeyDetectionButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_keydetect.svg")); + m_pKeyDetectionButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_keydetect.svg")); m_pKeyDetectionButton->setText(0, tr("Key Detection")); m_pKeyDetectionButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pKeyDetectionButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); m_pReplayGainButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pReplayGainButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_replaygain.svg")); + m_pReplayGainButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_replaygain.svg")); m_pReplayGainButton->setText(0, tr("Normalization")); m_pReplayGainButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pReplayGainButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); #ifdef __MODPLUG__ m_pModplugButton = new QTreeWidgetItem(contentsTreeWidget, QTreeWidgetItem::Type); - m_pModplugButton->setIcon(0, QIcon(":/images/preferences/ic_preferences_modplug.svg")); + m_pModplugButton->setIcon(0, QIcon(iconSetPath + "ic_preferences_modplug.svg")); m_pModplugButton->setText(0, tr("Modplug Decoder")); m_pModplugButton->setTextAlignment(0, Qt::AlignLeft | Qt::AlignVCenter); m_pModplugButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); diff --git a/src/preferences/dialog/dlgprefmodplug.cpp b/src/preferences/dialog/dlgprefmodplug.cpp index 3fac78ee81..1cd86c8822 100644 --- a/src/preferences/dialog/dlgprefmodplug.cpp +++ b/src/preferences/dialog/dlgprefmodplug.cpp @@ -2,6 +2,7 @@ #include <QtDebug> +#include "defs_urls.h" #include "moc_dlgprefmodplug.cpp" #include "preferences/dialog/ui_dlgprefmodplugdlg.h" #include "preferences/usersettings.h" @@ -15,6 +16,8 @@ DlgPrefModplug::DlgPrefModplug(QWidget *parent, m_pUi(new Ui::DlgPrefModplug), m_pConfig(_config) { m_pUi->setupUi(this); + // Create text color for the |