[Companion] Qualify all translation strings (#5557)

* [Companion] Qualify all remaining QObject translations with proper class/object names; Centralize some common strings into constants.h.

* [Companion] Replace all instances of some common strings with macros from constants.h.

* [Companion] Fix translation warnings from lupdate.
This commit is contained in:
Max Paperno
2017-12-25 13:36:34 +01:00
committed by Bertrand Songis
parent ad0f727880
commit f018425e12
50 changed files with 331 additions and 303 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ LimitsGroup::LimitsGroup(Firmware * firmware, TableLayout * tableLayout, int row
spinbox->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
QHBoxLayout * horizontalLayout = new QHBoxLayout();
QCheckBox * gv = new QCheckBox(QObject::tr("GV"));
QCheckBox * gv = new QCheckBox(tr("GV"));
gv->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
horizontalLayout->addWidget(gv);
QComboBox * cb = new QComboBox();
+5 -1
View File
@@ -24,10 +24,14 @@
#include "helpers.h"
#include "modeledit.h"
#include <QtCore>
class GVarGroup;
class LimitsGroup
{
Q_DECLARE_TR_FUNCTIONS(LimitsGroup)
public:
LimitsGroup(Firmware * firmware, TableLayout *tableLayout, int row, int col, int & value, const ModelData & model, int min, int max, int deflt, ModelPanel * panel=NULL);
~LimitsGroup();
@@ -49,7 +53,7 @@ class Channels : public ModelPanel
public:
Channels(QWidget *parent, ModelData & model, GeneralSettings & generalSettings, Firmware * firmware);
~Channels();
private:
QVector<LimitsGroup *> limitsGroups;
+8 -8
View File
@@ -35,14 +35,14 @@ RepeatComboBox::RepeatComboBox(QWidget *parent, int & repeatParam):
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed);
if (step == 1) {
addItem(QObject::tr("Played once, not during startup"), -1);
addItem(tr("Played once, not during startup"), -1);
value++;
}
addItem(QObject::tr("No repeat"), 0);
addItem(tr("No repeat"), 0);
for (unsigned int i=step; i<=60; i+=step) {
addItem(QObject::tr("%1s").arg(i), i);
addItem(tr("%1s").arg(i), i);
}
setCurrentIndex(value);
@@ -306,7 +306,7 @@ void CustomFunctionsPanel::playMusic()
}
QFile file(track);
if (!file.exists()) {
QMessageBox::critical(this, tr("Error"), tr("Unable to find sound file %1!").arg(track));
QMessageBox::critical(this, CPN_STR_TTL_ERROR, tr("Unable to find sound file %1!").arg(track));
return;
}
@@ -696,10 +696,10 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
void CustomFunctionsPanel::populateGVmodeCB(QComboBox *b, unsigned int value)
{
b->clear();
b->addItem(QObject::tr("Value"));
b->addItem(QObject::tr("Source"));
b->addItem(QObject::tr("GVAR"));
b->addItem(QObject::tr("Increment"));
b->addItem(tr("Value"));
b->addItem(tr("Source"));
b->addItem(tr("GVAR"));
b->addItem(tr("Increment"));
b->setCurrentIndex(value);
}
+11 -9
View File
@@ -100,16 +100,16 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
QComboBox * cb = trimsUse[i];
cb->setProperty("index", i);
if (IS_HORUS_OR_TARANIS(board)) {
cb->addItem(QObject::tr("Trim disabled"), -1);
cb->addItem(tr("Trim disabled"), -1);
}
for (int m=0; m<modesCount; m++) {
if (m == phaseIdx) {
cb->addItem(QObject::tr("Own Trim"), m*2);
cb->addItem(tr("Own Trim"), m*2);
}
else if (phaseIdx > 0) {
cb->addItem(QObject::tr("Use Trim from Flight mode %1").arg(m), m*2);
cb->addItem(tr("Use Trim from Flight mode %1").arg(m), m*2);
if (IS_HORUS_OR_TARANIS(board)) {
cb->addItem(QObject::tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
cb->addItem(tr("Use Trim from Flight mode %1 + Own Trim as an offset").arg(m), m*2+1);
}
}
}
@@ -358,18 +358,20 @@ void FlightModePanel::setGVSB(QDoubleSpinBox * sb, int min, int max, int val)
sb->setValue(val * mul);
}
// TODO: pull units from GVarData
void FlightModePanel::populateGvarUnitCB(QComboBox * cb)
{
cb->clear();
cb->addItem(QObject::tr(""));
cb->addItem(QObject::tr("%"));
cb->addItem("");
cb->addItem("%");
}
// TODO: pull precision string from GVarData
void FlightModePanel::populateGvarPrecCB(QComboBox * cb)
{
cb->clear();
cb->addItem(QObject::tr("0._"));
cb->addItem(QObject::tr("0.0"));
cb->addItem(tr("0._"));
cb->addItem(tr("0.0"));
}
void FlightModePanel::phaseName_editingFinished()
@@ -650,7 +652,7 @@ void FlightModePanel::name_customContextMenuRequested(const QPoint & pos)
void FlightModePanel::fmClear()
{
int res = QMessageBox::question(this, "Companion", tr("Clear all current Flight Mode properties?"), QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, CPN_STR_APP_NAME, tr("Clear all current Flight Mode properties?"), QMessageBox::Yes | QMessageBox::No);
if (res == QMessageBox::Yes) {
phase.clear(phaseIdx);
if (phaseIdx == 0) {
+1 -1
View File
@@ -177,7 +177,7 @@ QString InputsPanel::getInputText(int dest, bool * new_ch)
bool InputsPanel::gm_insertExpo(int idx)
{
if (idx<0 || idx>=CPN_MAX_EXPOS || model->expoData[CPN_MAX_EXPOS-1].mode > 0) {
QMessageBox::information(this, "Companion", tr("Not enough available inputs!"));
QMessageBox::information(this, CPN_STR_APP_NAME, tr("Not enough available inputs!"));
return false;
}
+1 -1
View File
@@ -1161,7 +1161,7 @@ void SetupPanel::populateThrottleSourceCB()
Board::Type board = firmware->getBoard();
lock = true;
ui->throttleSource->clear();
ui->throttleSource->addItem(QObject::tr("THR"));
ui->throttleSource->addItem(tr("THR"));
for (int i=0; i<getBoardCapability(board, Board::Pots)+getBoardCapability(board, Board::Sliders); i++) {
ui->throttleSource->addItem(firmware->getAnalogInputName(4+i), i);
}
+1 -1
View File
@@ -719,7 +719,7 @@ void populateTelemetrySourcesComboBox(AutoComboBox * cb, const ModelData * model
if (negative) {
for (int i=-CPN_MAX_SENSORS; i<0; ++i) {
if (model->sensorData[-i-1].isAvailable())
cb->addItem(QObject::tr("-%1").arg(model->sensorData[-i-1].label), i);
cb->addItem(QString("-%1").arg(model->sensorData[-i-1].label), i);
}
}
cb->addItem("---", 0);