[Companion] Input names formatting (#4888)

* [Companion] Re-format Inputs list to format input name consistently with rest of UI; Add leading zeros to RawSource numbers in names; Show custom channel name in MixerDialog.

* [Companion] Remove colon separator between input number and custom name.

* Fix segfault when no model pointer is passed to RawSource::toString() (problem was only on this branch).
This commit is contained in:
Max Paperno
2017-05-11 07:37:13 +02:00
committed by Bertrand Songis
parent 6e0bec9db4
commit f7b6d95910
5 changed files with 21 additions and 32 deletions
+2 -14
View File
@@ -328,20 +328,8 @@ QString ModelPrinter::printRotaryEncoder(int flightModeIndex, int reIndex)
QString ModelPrinter::printInputName(int idx)
{
QString result;
if (firmware->getCapability(VirtualInputs)) {
if (strlen(model.inputNames[idx]) > 0) {
result = tr("[I%1]").arg(idx+1);
result += QString(model.inputNames[idx]);
}
else {
result = tr("Input%1").arg(idx+1, 2, 10, QChar('0'));
}
}
else {
result = RawSource(SOURCE_TYPE_STICK, idx).toString(&model, &generalSettings);
}
return result.toHtmlEscaped();
RawSourceType srcType = (firmware->getCapability(VirtualInputs) ? SOURCE_TYPE_VIRTUAL_INPUT : SOURCE_TYPE_STICK);
return RawSource(srcType, idx).toString(&model, &generalSettings).toHtmlEscaped();
}
QString ModelPrinter::printInputLine(int idx)