mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-24 00:35:14 +03:00
Add booltostring functions to datahelpers
This commit is contained in:
parent
110e1a5fc7
commit
fe5294c127
4 changed files with 32 additions and 6 deletions
|
@ -20,6 +20,24 @@
|
|||
|
||||
#include "datahelpers.h"
|
||||
|
||||
QString DataHelpers::boolToString(const bool value, const BoolFormat format)
|
||||
{
|
||||
static const char *strings[] = {
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "Disabled"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "Enabled"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "OFF"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "ON"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "False"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "True"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "N"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "Y"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "No"),
|
||||
QT_TRANSLATE_NOOP("DataHelpers", "Yes")
|
||||
};
|
||||
|
||||
return QCoreApplication::translate("DataHelpers", strings[format * 2 + value]);
|
||||
}
|
||||
|
||||
QString DataHelpers::getElementName(const QString & prefix, const unsigned int index, const char * name, const bool padding)
|
||||
{
|
||||
QString result = prefix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue