diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 8522773d4..577608e54 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -40,7 +40,7 @@ const QColor colors[C9X_MAX_CURVES] = { QColor(255,127,0), }; -QString getPhaseName(int val, char * phasename) +QString getPhaseName(int val, const char * phasename) { if (!val) return "---"; if (!phasename) { diff --git a/companion/src/helpers.h b/companion/src/helpers.h index 82a775395..d368c7ae7 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -107,7 +107,7 @@ QString getPhasesStr(unsigned int phases, ModelData & model); void populateGVCB(QComboBox *b, int value); void populateSourceCB(QComboBox *b, const RawSource &source, const ModelData & model, unsigned int flags); void populateCSWCB(QComboBox *b, int value); -QString getPhaseName(int val, char * phasename=NULL); +QString getPhaseName(int val, const char * phasename=NULL); QString getInputStr(ModelData & model, int index); QString image2qstring(QImage image); QImage qstring2image(QString imagestr); diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index cfb94d62f..9077c5697 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -47,7 +47,7 @@ PrintDialog::PrintDialog(QWidget *parent, FirmwareInterface * firmware, GeneralS if (gvars) { te->append(printPhases()+"
"); } - printExpo(); + printInputs(); printMixes(); printLimits(); printCurves(); @@ -208,7 +208,7 @@ QString PrintDialog::printPhases() return(str); } -void PrintDialog::printExpo() +void PrintDialog::printInputs() { QString str = ""); str.append(""; diff --git a/companion/src/printdialog.h b/companion/src/printdialog.h index 2084b7596..b0ec3da41 100644 --- a/companion/src/printdialog.h +++ b/companion/src/printdialog.h @@ -33,7 +33,7 @@ private: void printSetup(); QString printPhases(); - void printExpo(); + void printInputs(); void printMixes(); void printLimits(); void printCurves();

"; str.append(tr("Inputs")); @@ -225,27 +225,25 @@ void PrintDialog::printExpo() lastCHN=ed->chn; str.append(""+getInputStr(*g_model, ed->chn)+""); } - else - str.append(" "); str.append("

"); switch(ed->mode) { case (1): - str += "<- "; + str += "<-"; break; case (2): - str += "-> "; + str += "->"; break; default: - str += "   "; + str += "  "; break; }; - str += tr("Weight(") + QString("%1").arg(getGVarString(ed->weight,true)) + ")"; + str += " " + tr("Weight") + QString("(%1)").arg(getGVarString(ed->weight,true)); if (firmware->getCapability(VirtualInputs)) { - str += " " + tr("Source(%1)").arg(ed->srcRaw.toString()); + str += " " + tr("Source") + QString("(%1)").arg(ed->srcRaw.toString()); if (ed->carryTrim>0) { str += " " + tr("NoTrim"); } @@ -259,33 +257,26 @@ void PrintDialog::printExpo() if(ed->phases) { if (ed->phases!=(unsigned int)(1<getCapability(FlightPhases))-1) { int mask=1; - int first=0; - for (int i=0; igetCapability(FlightPhases);i++) { - if (!(ed->phases & mask)) { - first++; - } - mask <<=1; - } - if (first>1) { - str += " " + tr("Flight modes") + QString("("); - } else { - str += " " + tr("Flight mode") + QString("("); - } - mask=1; - first=1; + bool first = true; + QString strPhases; + bool multiple = false; for (int j=0; jgetCapability(FlightPhases);j++) { if (!(ed->phases & mask)) { - PhaseData *pd = &g_model->phaseData[j]; - if (!first) { - str += QString(", ")+ QString("%1").arg(getPhaseName(j+1, pd->name)); + //PhaseData *pd = &g_model->phaseData[j]; + const char * pdName = g_model->phaseData[j].name; + if (first) { + strPhases += QString("%1").arg(getPhaseName(j+1,pdName)); + first = false; } else { - str += QString("%1").arg(getPhaseName(j+1,pd->name)); - first=0; + strPhases += QString(", %1").arg(getPhaseName(j+1, pdName)); + multiple = true; } } - mask <<=1; + mask <<= 1; + } + if (!strPhases.isEmpty()) { + str += " " + tr(multiple?"Flight modes":"Flight mode") + "(" + strPhases + ")"; } - str += QString(")"); } else { str += tr("DISABLED")+QString(" !!!"); } @@ -294,10 +285,9 @@ void PrintDialog::printExpo() if (ed->swtch.type) str += " " + tr("Switch") + QString("(%1)").arg(ed->swtch.toString()); if (firmware->getCapability(HasExpoNames)) { - QString ExpoName; - ExpoName.append(ed->name); - if (!ExpoName.isEmpty()) { - str+= " " + QString(" [%1]").arg(ExpoName); + QString ExpoName(ed->name); + if (ed->name[0]) { + str += QString(" [%1]").arg(ed->name); } } str += "