Skip to content

Commit

Permalink
companion: display LS friendly name in Comboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
shane-droid authored and pfeerick committed Dec 7, 2022
1 parent 3e8b1ab commit a54b5e4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions companion/src/firmwares/logicalswitchdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ QString LogicalSwitchData::nameToString(int index) const
{
return RadioData::getElementName(tr("L"), index + 1, NULL, true);
}
QString LogicalSwitchData::custNameToString() const
{
return custName;
}

void LogicalSwitchData::convert(RadioDataConversionState & cstate)
{
Expand Down
1 change: 1 addition & 0 deletions companion/src/firmwares/logicalswitchdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class LogicalSwitchData {
unsigned int getRangeFlags() const;
QString funcToString() const;
QString nameToString(int index) const;
QString custNameToString() const;
void convert(RadioDataConversionState & cstate);
};

Expand Down
2 changes: 1 addition & 1 deletion companion/src/firmwares/rawswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ QString RawSwitch::toString(Board::Type board, const GeneralSettings * const gen

case SWITCH_TYPE_VIRTUAL:
if (modelData)
return modelData->logicalSw[index].nameToString(index-1);
return modelData->logicalSw[index].nameToString(index-1) + ": " + modelData->logicalSw[index].custNameToString() ;
else
return LogicalSwitchData().nameToString(index-1);

Expand Down
2 changes: 1 addition & 1 deletion companion/src/modeledit/customfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CustomFunctionsPanel : public GenericPanel
QSet<QString> tracksSet;
QSet<QString> scriptsSet;
int mediaPlayerCurrent;
QLineEdit *name[CPN_MAX_SPECIAL_FUNCTIONS];
QLineEdit * name[CPN_MAX_SPECIAL_FUNCTIONS];
QComboBox * fswtchSwtch[CPN_MAX_SPECIAL_FUNCTIONS];
QComboBox * fswtchFunc[CPN_MAX_SPECIAL_FUNCTIONS];
QCheckBox * fswtchParamGV[CPN_MAX_SPECIAL_FUNCTIONS];
Expand Down

0 comments on commit a54b5e4

Please sign in to comment.