summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorronso0 <ronso0@mixxx.org>2020-12-27 05:44:47 +0100
committerronso0 <ronso0@mixxx.org>2021-01-06 23:47:47 +0100
commit885be4f1568a441568f5f51b3b472706f27f4012 (patch)
tree5d73607c4de1e495bff94536b2f8e86704538231 /src
parent5fe525fe73450039ef4cef2067830705244aed26 (diff)
Effect widgets/EQ preferences: display '---' when no effect is loaded
Diffstat (limited to 'src')
-rw-r--r--src/effects/effectsmanager.cpp2
-rw-r--r--src/effects/effectsmanager.h2
-rw-r--r--src/preferences/dialog/dlgprefeq.cpp14
-rw-r--r--src/widget/weffect.cpp2
-rw-r--r--src/widget/weffectchain.cpp2
-rw-r--r--src/widget/weffectparameterbase.cpp2
-rw-r--r--src/widget/weffectselector.cpp2
7 files changed, 16 insertions, 10 deletions
diff --git a/src/effects/effectsmanager.cpp b/src/effects/effectsmanager.cpp
index 380a19b734..13c20f9ae4 100644
--- a/src/effects/effectsmanager.cpp
+++ b/src/effects/effectsmanager.cpp
@@ -13,6 +13,8 @@
#include "moc_effectsmanager.cpp"
#include "util/assert.h"
+const QString EffectsManager::kNoEffectString = QStringLiteral("---");
+
namespace {
const QString kEffectGroupSeparator = "_";
const QString kGroupClose = "]";
diff --git a/src/effects/effectsmanager.h b/src/effects/effectsmanager.h
index cccb756e18..8f85a8d30a 100644
--- a/src/effects/effectsmanager.h
+++ b/src/effects/effectsmanager.h
@@ -23,6 +23,8 @@ class EffectsBackend;
class EffectsManager : public QObject {
Q_OBJECT
public:
+ static const QString kNoEffectString;
+
typedef bool (*EffectManifestFilterFnc)(EffectManifest* pManifest);
EffectsManager(QObject* pParent,
diff --git a/src/preferences/dialog/dlgprefeq.cpp b/src/preferences/dialog/dlgprefeq.cpp
index 3c4110f04d..ee8b0fd825 100644
--- a/src/preferences/dialog/dlgprefeq.cpp
+++ b/src/preferences/dialog/dlgprefeq.cpp
@@ -226,9 +226,10 @@ void DlgPrefEQ::slotPopulateDeckEffectSelectors() {
}
}
//: Displayed when no effect is selected
- box->addItem(tr("None"), QVariant(QString("")));
+ box->addItem(EffectsManager::kNoEffectString);
+
if (selectedEffectId.isEmpty()) {
- currentIndex = availableEQEffects.size(); // selects "None"
+ currentIndex = availableEQEffects.size(); // Discards the current selection
} else if (currentIndex < 0 && !selectedEffectName.isEmpty() ) {
// current selection is not part of the new list
// So we need to add it
@@ -255,9 +256,10 @@ void DlgPrefEQ::slotPopulateDeckEffectSelectors() {
}
}
//: Displayed when no effect is selected
- box->addItem(tr("None"), QVariant(QString("")));
+ box->addItem(EffectsManager::kNoEffectString);
+
if (selectedEffectId.isEmpty()) {
- currentIndex = availableQuickEffects.size(); // selects "None"
+ currentIndex = availableQuickEffects.size(); // Discards the current selection
} else if (currentIndex < 0 && !selectedEffectName.isEmpty()) {
// current selection is not part of the new list
// So we need to add it
@@ -672,11 +674,11 @@ void DlgPrefEQ::setUpMasterEQ() {
comboBoxMasterEq->addItem(pManifest->name(), QVariant(pManifest->id()));
}
//: Displayed when no effect is selected
- comboBoxMasterEq->addItem(tr("None"), QVariant());
+ comboBoxMasterEq->addItem(EffectsManager::kNoEffectString);
int masterEqIndex = comboBoxMasterEq->findData(configuredEffect);
if (masterEqIndex < 0) {
- masterEqIndex = availableMasterEQEffects.size(); // selects "None"
+ masterEqIndex = availableMasterEQEffects.size(); // Discards the current selection
}
comboBoxMasterEq->setCurrentIndex(masterEqIndex);
diff --git a/src/widget/weffect.cpp b/src/widget/weffect.cpp
index f9141d3a52..97132dd65d 100644
--- a/src/widget/weffect.cpp
+++ b/src/widget/weffect.cpp
@@ -49,7 +49,7 @@ void WEffect::effectUpdated() {
description = tr("%1: %2").arg(pManifest->name(), pManifest->description());
}
} else {
- name = tr("None");
+ name = EffectsManager::kNoEffectString;
description = tr("No effect loaded.");
}
setText(name);
diff --git a/src/widget/weffectchain.cpp b/src/widget/weffectchain.cpp
index 66211e1368..c2580266c7 100644
--- a/src/widget/weffectchain.cpp
+++ b/src/widget/weffectchain.cpp
@@ -39,7 +39,7 @@ void WEffectChain::setEffectChainSlot(EffectChainSlotPointer pEffectChainSlot) {
}
void WEffectChain::chainUpdated() {
- QString name = tr("None");
+ QString name = EffectsManager::kNoEffectString;
QString description = tr("No effect chain loaded.");
if (m_pEffectChainSlot) {
EffectChainPointer pChain = m_pEffectChainSlot->getEffectChain();
diff --git a/src/widget/weffectparameterbase.cpp b/src/widget/weffectparameterbase.cpp
index 22191ee58b..27d047bacc 100644
--- a/src/widget/weffectparameterbase.cpp
+++ b/src/widget/weffectparameterbase.cpp
@@ -34,7 +34,7 @@ void WEffectParameterBase::parameterUpdated() {
m_pEffectParameterSlot->name(),
m_pEffectParameterSlot->description()));
} else {
- setText(tr("None"));
+ setText(EffectsManager::kNoEffectString);
setBaseTooltip(tr("No effect loaded."));
}
}
diff --git a/src/widget/weffectselector.cpp b/src/widget/weffectselector.cpp
index 02c9c3f230..99c9f0a441 100644
--- a/src/widget/weffectselector.cpp
+++ b/src/widget/weffectselector.cpp
@@ -73,7 +73,7 @@ void WEffectSelector::populate() {
}
//: Displayed when no effect is loaded
- addItem(tr("None"), QVariant());
+ addItem(EffectsManager::kNoEffectString);
setItemData(visibleEffectManifests.size(), QVariant(tr("No effect loaded.")),
Qt::ToolTipRole);