diff options
author | ronso0 <ronso0@mixxx.org> | 2021-01-11 00:08:57 +0100 |
---|---|---|
committer | ronso0 <ronso0@mixxx.org> | 2021-01-11 00:08:57 +0100 |
commit | 59fa3138113bc690c36e762c72c4a54a0e19b349 (patch) | |
tree | 09f1a8a7a05c042b6c28432a822607a7388a5ec3 /src | |
parent | 2de8ce0bce506fa19ac6596e591ec56939008139 (diff) | |
parent | e79f2273d5229416f28101d5cea6b5c4d0e8df04 (diff) |
Merge remote-tracking branch 'mixxx/2.3' into pref-icon-color
# Conflicts:
# res/mixxx.qrc
# src/preferences/dialog/dlgpreferencepage.h
# src/preferences/dialog/dlgpreferences.cpp
Diffstat (limited to 'src')
96 files changed, 1868 insertions, 977 deletions
diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index b8df99f45e..4e753c3c1e 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -415,6 +415,43 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) hotcueMainMenu->addMenu(hotcueMoreMenu); } + // Intro/outro range markers + QMenu* introOutroMenu = addSubmenu(tr("Intro / Outro Markers")); + const QStringList markerTitles = { + tr("Intro Start Marker"), + tr("Intro End Marker"), + tr("Outro Start Marker"), + tr("Outro End Marker")}; + const QStringList markerNames = { + tr("intro start marker"), + tr("intro end marker"), + tr("outro start marker"), + tr("outro end marker")}; + const QStringList markerCOs = { + "intro_start", + "intro_end", + "outro_start", + "outro_end"}; + + for (int i = 0; i < markerTitles.size(); ++i) { + QMenu* tempMenu = addSubmenu(markerTitles[i], introOutroMenu); + addDeckAndSamplerAndPreviewDeckControl( + QString("%1_activate").arg(markerCOs[i]), + tr("Activate %1", "[intro/outro marker").arg(markerTitles[i]), + tr("Jump to or set the %1", "[intro/outro marker").arg(markerNames[i]), + tempMenu); + addDeckAndSamplerAndPreviewDeckControl( + QString("%1_set").arg(markerCOs[i]), + tr("Set %1", "[intro/outro marker").arg(markerTitles[i]), + tr("Set or jump to the %1", "[intro/outro marker").arg(markerNames[i]), + tempMenu); + addDeckAndSamplerAndPreviewDeckControl( + QString("%1_clear").arg(markerCOs[i]), + tr("Clear %1", "[intro/outro marker").arg(markerTitles[i]), + tr("Clear the %1", "[intro/outro marker").arg(markerNames[i]), + tempMenu); + } + // Loops QMenu* loopMenu = addSubmenu(tr("Looping")); // add beatloop_activate and beatlooproll_activate to both the diff --git a/src/controllers/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index 0a9810dbe9..073636b670 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -39,6 +39,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); @@ -62,7 +64,7 @@ DlgPrefController::DlgPrefController(QWidget* parent, // When the user picks a preset, load it. connect(m_ui.comboBoxPreset, - QOverload<int>::of(&QComboBox::activated), + QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DlgPrefController::slotPresetSelected); @@ -235,40 +237,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( @@ -280,20 +288,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(")"); @@ -442,7 +450,7 @@ void DlgPrefController::slotApply() { } m_ui.chkEnabledDevice->setChecked(bEnabled); - // The shouldn't be dirty at this pint because we already tried to save + // The shouldn't be dirty at this point because we already tried to save // it. If that failed, don't apply the preset. if (m_pPreset && m_pPreset->isDirty()) { return; @@ -656,35 +664,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 cdadd661d8..78885bd0b5 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 0c12cad8c1..803059890e 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -19,6 +19,8 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences, m_pControllerManager(pControllerManager), m_pControllersRootItem(pControllersRootItem) { setupUi(this); + // Create text color for the cue mode link "?" to the manual + createLinkColor(); setupControllerWidgets(); const QString presetsPath = userPresetsPath(m_pConfig); @@ -32,6 +34,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_ |