[Companion] Radio data translation/strings (#5554)
* [Companion] Add Qt tr() functions to all radio data classes instead of using generic QObject type. (no functional changes) * Small fix for gcc. * Move more element name string generation to individual classes; settle on nameToString as function name. * Also put firmware build options translations into Firmware scope.
This commit is contained in:
committed by
Bertrand Songis
parent
7806c2096d
commit
a951292f27
@@ -20,15 +20,17 @@
|
||||
|
||||
#include "gvardata.h"
|
||||
|
||||
#include "radiodata.h"
|
||||
|
||||
QString GVarData::unitToString() const
|
||||
{
|
||||
switch (unit) {
|
||||
case GVAR_UNIT_NUMBER:
|
||||
return QObject::tr("");
|
||||
return tr("");
|
||||
case GVAR_UNIT_PERCENT:
|
||||
return QObject::tr("%");
|
||||
return tr("%");
|
||||
default:
|
||||
return QObject::tr("?"); // highlight unknown value
|
||||
return tr("?"); // highlight unknown value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,14 +38,19 @@ QString GVarData::precToString() const
|
||||
{
|
||||
switch (prec) {
|
||||
case GVAR_PREC_MUL10:
|
||||
return QObject::tr("0._");
|
||||
return tr("0._");
|
||||
case GVAR_PREC_MUL1:
|
||||
return QObject::tr("0.0");
|
||||
return tr("0.0");
|
||||
default:
|
||||
return QObject::tr("?.?"); // highlight unknown value
|
||||
return tr("?.?"); // highlight unknown value
|
||||
}
|
||||
}
|
||||
|
||||
QString GVarData::nameToString(int index) const
|
||||
{
|
||||
return RadioData::getElementName(tr("GV"), index + 1, name);
|
||||
}
|
||||
|
||||
int GVarData::multiplierSet()
|
||||
{
|
||||
return (prec == 0 ? 1 : 10);
|
||||
|
||||
Reference in New Issue
Block a user