From 1a6906bbb3ce5919a2fb152a106247a3af7c7f04 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Wed, 30 Apr 2014 22:58:54 +0200 Subject: [PATCH 1/2] Input name missing from mixer sources --- companion/src/modeledit/mixes.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 56bf98c47..7b01d83e6 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -170,6 +170,10 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch) default: str += " "; break; }; + //set mixer src model if it is unset (srcRaw needs this to generate proper toString() for input source type) + if (md->srcRaw.model == 0) + md->srcRaw.model = &model; + //highlight source if needed if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) { str += " " + Qt::escape(md->srcRaw.toString()) + ""; From 88e7ad4b8cb820f0fc80f2b6390faf13e2afa8c3 Mon Sep 17 00:00:00 2001 From: Damjan Adamic Date: Wed, 30 Apr 2014 23:16:49 +0200 Subject: [PATCH 2/2] Better display of inputs with assigned name --- companion/src/helpers.cpp | 7 +++++-- companion/src/modeledit/inputs.cpp | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index cc9dc5740..836dee391 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -63,8 +63,11 @@ QString getInputStr(ModelData & model, int index) QString result; if (GetCurrentFirmware()->getCapability(VirtualInputs)) { - result = model.inputNames[index]; - if (result.isEmpty()) { + if (strlen(model.inputNames[index]) > 0) { + result = QObject::tr("[I%1]").arg(index+1); + result += QString(model.inputNames[index]); + } + else { result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0')); } } diff --git a/companion/src/modeledit/inputs.cpp b/companion/src/modeledit/inputs.cpp index 3852264c7..9c7d8d5f3 100644 --- a/companion/src/modeledit/inputs.cpp +++ b/companion/src/modeledit/inputs.cpp @@ -144,13 +144,13 @@ QString InputsPanel::getInputText(int dest, bool * new_ch) if ((dest == 0) || (model.expoData[dest-1].chn != md->chn)) { if (new_ch) *new_ch = 1; if (firmware->getCapability(VirtualInputs)) - str = QString("%1").arg(getInputStr(model, md->chn), -8, ' '); + str = QString("%1").arg(getInputStr(model, md->chn), -10, ' '); else str = getInputStr(model, md->chn); } else { if (firmware->getCapability(VirtualInputs)) - str = " "; + str = " "; else str = " "; }