Merge pull request #1038 from opentx/projectkk2glider/mixes_and_inputs_display

Projectkk2glider/mixes and inputs display
This commit is contained in:
Bertrand Songis
2014-05-01 10:33:32 +02:00
3 changed files with 11 additions and 4 deletions
+5 -2
View File
@@ -63,8 +63,11 @@ QString getInputStr(ModelData & model, int index)
QString result; QString result;
if (GetCurrentFirmware()->getCapability(VirtualInputs)) { if (GetCurrentFirmware()->getCapability(VirtualInputs)) {
result = model.inputNames[index]; if (strlen(model.inputNames[index]) > 0) {
if (result.isEmpty()) { 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')); result = QObject::tr("Input%1").arg(index+1, 2, 10, QChar('0'));
} }
} }
+2 -2
View File
@@ -144,13 +144,13 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
if ((dest == 0) || (model.expoData[dest-1].chn != md->chn)) { if ((dest == 0) || (model.expoData[dest-1].chn != md->chn)) {
if (new_ch) *new_ch = 1; if (new_ch) *new_ch = 1;
if (firmware->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
str = QString("%1").arg(getInputStr(model, md->chn), -8, ' '); str = QString("%1").arg(getInputStr(model, md->chn), -10, ' ');
else else
str = getInputStr(model, md->chn); str = getInputStr(model, md->chn);
} }
else { else {
if (firmware->getCapability(VirtualInputs)) if (firmware->getCapability(VirtualInputs))
str = " "; str = " ";
else else
str = " "; str = " ";
} }
+4
View File
@@ -170,6 +170,10 @@ QString MixesPanel::getMixerText(int dest, bool * new_ch)
default: str += " "; break; 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 //highlight source if needed
if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) { if ( (md->srcRaw.type == SOURCE_TYPE_CH) && (md->srcRaw.index+1 == (int)highlightedSource) ) {
str += " <b>" + Qt::escape(md->srcRaw.toString()) + "</b>"; str += " <b>" + Qt::escape(md->srcRaw.toString()) + "</b>";