Commit 3e05f174 authored by DonLakeFlyer's avatar DonLakeFlyer

String fixups for localization

parent 2f7b754a
...@@ -196,7 +196,7 @@ void APMSensorsComponentController::_stopCalibration(APMSensorsComponentControll ...@@ -196,7 +196,7 @@ void APMSensorsComponentController::_stopCalibration(APMSensorsComponentControll
default: default:
// Assume failed // Assume failed
_hideAllCalAreas(); _hideAllCalAreas();
qgcApp()->showMessage(QStringLiteral("Calibration failed. Calibration log will be displayed.")); qgcApp()->showMessage(tr("Calibration failed. Calibration log will be displayed."));
break; break;
} }
...@@ -471,9 +471,9 @@ void APMSensorsComponentController::_handleUASTextMessage(int uasId, int compId, ...@@ -471,9 +471,9 @@ void APMSensorsComponentController::_handleUASTextMessage(int uasId, int compId,
} }
if (_calTypeInProgress == CalTypeOffboardCompass) { if (_calTypeInProgress == CalTypeOffboardCompass) {
_orientationCalAreaHelpText->setProperty("text", "Rotate the vehicle continuously as shown in the diagram until marked as Completed"); _orientationCalAreaHelpText->setProperty("text", tr("Rotate the vehicle continuously as shown in the diagram until marked as Completed"));
} else { } else {
_orientationCalAreaHelpText->setProperty("text", "Hold still in the current orientation"); _orientationCalAreaHelpText->setProperty("text", tr("Hold still in the current orientation"));
} }
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
...@@ -511,7 +511,7 @@ void APMSensorsComponentController::_handleUASTextMessage(int uasId, int compId, ...@@ -511,7 +511,7 @@ void APMSensorsComponentController::_handleUASTextMessage(int uasId, int compId,
_orientationCalTailDownSideRotate = false; _orientationCalTailDownSideRotate = false;
} }
_orientationCalAreaHelpText->setProperty("text", "Place you vehicle into one of the orientations shown below and hold it still"); _orientationCalAreaHelpText->setProperty("text", tr("Place you vehicle into one of the orientations shown below and hold it still"));
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
emit orientationCalSidesDoneChanged(); emit orientationCalSidesDoneChanged();
......
...@@ -85,7 +85,7 @@ AirframeComponentController::~AirframeComponentController() ...@@ -85,7 +85,7 @@ AirframeComponentController::~AirframeComponentController()
void AirframeComponentController::changeAutostart(void) void AirframeComponentController::changeAutostart(void)
{ {
if (qgcApp()->toolbox()->multiVehicleManager()->vehicles()->count() > 1) { if (qgcApp()->toolbox()->multiVehicleManager()->vehicles()->count() > 1) {
qgcApp()->showMessage("You cannot change airframe configuration while connected to multiple vehicles."); qgcApp()->showMessage(tr("You cannot change airframe configuration while connected to multiple vehicles."));
return; return;
} }
......
...@@ -154,7 +154,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void) ...@@ -154,7 +154,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void)
if (map < 0 || map > _channelCount) { if (map < 0 || map > _channelCount) {
_validConfiguration = false; _validConfiguration = false;
_configurationErrors += QString("%1 is set to %2. Mapping must between 0 and %3 (inclusive).\n").arg(switchParams[i]).arg(map).arg(_channelCount); _configurationErrors += tr("%1 is set to %2. Mapping must between 0 and %3 (inclusive).\n").arg(switchParams[i]).arg(map).arg(_channelCount);
} }
} }
...@@ -170,7 +170,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void) ...@@ -170,7 +170,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void)
for (int j=0; j<switchParams.count(); j++) { for (int j=0; j<switchParams.count(); j++) {
if (map != 0 && map == switchMappings[j]) { if (map != 0 && map == switchMappings[j]) {
_validConfiguration = false; _validConfiguration = false;
_configurationErrors += QString("%1 is set to same channel as %2.\n").arg(switchParams[j]).arg(attitudeParams[i]); _configurationErrors += tr("%1 is set to same channel as %2.\n").arg(switchParams[j]).arg(attitudeParams[i]);
} }
} }
} }
...@@ -185,7 +185,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void) ...@@ -185,7 +185,7 @@ void PX4AdvancedFlightModesController::_validateConfiguration(void)
float threshold = getParameterFact(-1, thresholdParam)->rawValue().toFloat(); float threshold = getParameterFact(-1, thresholdParam)->rawValue().toFloat();
if (threshold < 0.0f || threshold > 1.0f) { if (threshold < 0.0f || threshold > 1.0f) {
_validConfiguration = false; _validConfiguration = false;
_configurationErrors += QString("%1 is set to %2. Threshold must between 0.0 and 1.0 (inclusive).\n").arg(thresholdParam).arg(threshold); _configurationErrors += tr("%1 is set to %2. Threshold must between 0.0 and 1.0 (inclusive).\n").arg(thresholdParam).arg(threshold);
} }
} }
} }
......
...@@ -140,8 +140,8 @@ void PX4AutoPilotPlugin::parametersReadyPreChecks(void) ...@@ -140,8 +140,8 @@ void PX4AutoPilotPlugin::parametersReadyPreChecks(void)
if (_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, "SENS_GYRO_XOFF") || if (_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, "SENS_GYRO_XOFF") ||
_vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, "COM_DL_LOSS_EN")) { _vehicle->parameterManager()->parameterExists(FactSystem::defaultComponentId, "COM_DL_LOSS_EN")) {
_incorrectParameterVersion = true; _incorrectParameterVersion = true;
qgcApp()->showMessage("This version of GroundControl can only perform vehicle setup on a newer version of firmware. " qgcApp()->showMessage(tr("This version of GroundControl can only perform vehicle setup on a newer version of firmware. "
"Please perform a Firmware Upgrade if you wish to use Vehicle Setup."); "Please perform a Firmware Upgrade if you wish to use Vehicle Setup."));
} }
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
PX4TuningComponent::PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent) PX4TuningComponent::PX4TuningComponent(Vehicle* vehicle, AutoPilotPlugin* autopilot, QObject* parent)
: VehicleComponent(vehicle, autopilot, parent) : VehicleComponent(vehicle, autopilot, parent)
, _name("Tuning") , _name(tr("Tuning"))
{ {
} }
......
...@@ -164,7 +164,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St ...@@ -164,7 +164,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St
switch (code) { switch (code) {
case StopCalibrationSuccess: case StopCalibrationSuccess:
_orientationCalAreaHelpText->setProperty("text", "Calibration complete"); _orientationCalAreaHelpText->setProperty("text", tr("Calibration complete"));
emit resetStatusTextArea(); emit resetStatusTextArea();
if (_magCalInProgress) { if (_magCalInProgress) {
emit setCompassRotations(); emit setCompassRotations();
...@@ -179,7 +179,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St ...@@ -179,7 +179,7 @@ void SensorsComponentController::_stopCalibration(SensorsComponentController::St
default: default:
// Assume failed // Assume failed
_hideAllCalAreas(); _hideAllCalAreas();
qgcApp()->showMessage("Calibration failed. Calibration log will be displayed."); qgcApp()->showMessage(tr("Calibration failed. Calibration log will be displayed."));
break; break;
} }
...@@ -264,7 +264,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -264,7 +264,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
QStringList parts = text.split(" "); QStringList parts = text.split(" ");
if (parts.count() != 2 && parts[0].toInt() != _supportedFirmwareCalVersion) { if (parts.count() != 2 && parts[0].toInt() != _supportedFirmwareCalVersion) {
_unknownFirmwareVersion = true; _unknownFirmwareVersion = true;
QString msg = "Unsupported calibration firmware version, using log"; QString msg = tr("Unsupported calibration firmware version, using log");
_appendStatusLog(msg); _appendStatusLog(msg);
qDebug() << msg; qDebug() << msg;
return; return;
...@@ -296,7 +296,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -296,7 +296,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
_orientationCalTailDownSideVisible = false; _orientationCalTailDownSideVisible = false;
_orientationCalNoseDownSideVisible = false; _orientationCalNoseDownSideVisible = false;
_orientationCalAreaHelpText->setProperty("text", "Place your vehicle into one of the Incomplete orientations shown below and hold it still"); _orientationCalAreaHelpText->setProperty("text", tr("Place your vehicle into one of the Incomplete orientations shown below and hold it still"));
if (text == "accel") { if (text == "accel") {
_accelCalInProgress = true; _accelCalInProgress = true;
...@@ -377,9 +377,9 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -377,9 +377,9 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
} }
if (_magCalInProgress) { if (_magCalInProgress) {
_orientationCalAreaHelpText->setProperty("text", "Rotate the vehicle continuously as shown in the diagram until marked as Completed"); _orientationCalAreaHelpText->setProperty("text", tr("Rotate the vehicle continuously as shown in the diagram until marked as Completed"));
} else { } else {
_orientationCalAreaHelpText->setProperty("text", "Hold still in the current orientation"); _orientationCalAreaHelpText->setProperty("text", tr("Hold still in the current orientation"));
} }
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
...@@ -417,7 +417,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -417,7 +417,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
_orientationCalTailDownSideRotate = false; _orientationCalTailDownSideRotate = false;
} }
_orientationCalAreaHelpText->setProperty("text", "Place you vehicle into one of the orientations shown below and hold it still"); _orientationCalAreaHelpText->setProperty("text", tr("Place you vehicle into one of the orientations shown below and hold it still"));
emit orientationCalSidesInProgressChanged(); emit orientationCalSidesInProgressChanged();
emit orientationCalSidesDoneChanged(); emit orientationCalSidesDoneChanged();
...@@ -426,7 +426,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in ...@@ -426,7 +426,7 @@ void SensorsComponentController::_handleUASTextMessage(int uasId, int compId, in
} }
if (text.endsWith("side already completed")) { if (text.endsWith("side already completed")) {
_orientationCalAreaHelpText->setProperty("text", "Orientation already completed, place you vehicle into one of the incomplete orientations shown below and hold it still"); _orientationCalAreaHelpText->setProperty("text", tr("Orientation already completed, place you vehicle into one of the incomplete orientations shown below and hold it still"));
return; return;
} }
......
...@@ -208,7 +208,7 @@ int Fact::enumIndex(void) ...@@ -208,7 +208,7 @@ int Fact::enumIndex(void)
index ++; index ++;
} }
// Current value is not in list, add it manually // Current value is not in list, add it manually
_metaData->addEnumInfo(QString("Unknown: %1").arg(rawValue().toString()), rawValue()); _metaData->addEnumInfo(tr("Unknown: %1").arg(rawValue().toString()), rawValue());
emit enumsChanged(); emit enumsChanged();
return index; return index;
} }
......
...@@ -116,7 +116,7 @@ bool FactPanelController::_allParametersExists(int componentId, QStringList name ...@@ -116,7 +116,7 @@ bool FactPanelController::_allParametersExists(int componentId, QStringList name
void FactPanelController::_checkForMissingFactPanel(void) void FactPanelController::_checkForMissingFactPanel(void)
{ {
if (!_factPanel) { if (!_factPanel) {
_showInternalError("Incorrect FactPanel Qml implementation. FactPanelController used without passing in factPanel."); _showInternalError(tr("Incorrect FactPanel Qml implementation. FactPanelController used without passing in factPanel."));
} }
} }
...@@ -141,7 +141,7 @@ bool FactPanelController::parameterExists(int componentId, const QString& name) ...@@ -141,7 +141,7 @@ bool FactPanelController::parameterExists(int componentId, const QString& name)
void FactPanelController::_showInternalError(const QString& errorMsg) void FactPanelController::_showInternalError(const QString& errorMsg)
{ {
_notifyPanelErrorMsg(QString("Internal Error: %1").arg(errorMsg)); _notifyPanelErrorMsg(tr("Internal Error: %1").arg(errorMsg));
qCWarning(FactPanelControllerLog) << "Internal Error" << errorMsg; qCWarning(FactPanelControllerLog) << "Internal Error" << errorMsg;
qgcApp()->showMessage(errorMsg); qgcApp()->showMessage(errorMsg);
} }
...@@ -294,7 +294,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO ...@@ -294,7 +294,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
typedValue = QVariant(rawValue.toInt(&convertOk)); typedValue = QVariant(rawValue.toInt(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) { if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt());
} }
} }
break; break;
...@@ -304,7 +304,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO ...@@ -304,7 +304,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
typedValue = QVariant(rawValue.toUInt(&convertOk)); typedValue = QVariant(rawValue.toUInt(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) { if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt());
} }
} }
break; break;
...@@ -312,7 +312,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO ...@@ -312,7 +312,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
typedValue = QVariant(rawValue.toFloat(&convertOk)); typedValue = QVariant(rawValue.toFloat(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) { if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toFloat()).arg(cookedMax().toFloat()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toFloat()).arg(cookedMax().toFloat());
} }
} }
break; break;
...@@ -321,7 +321,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO ...@@ -321,7 +321,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
typedValue = QVariant(rawValue.toDouble(&convertOk)); typedValue = QVariant(rawValue.toDouble(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (typedValue < rawMin() || typedValue > rawMax()) { if (typedValue < rawMin() || typedValue > rawMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toDouble()).arg(cookedMax().toDouble()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toDouble()).arg(cookedMax().toDouble());
} }
} }
break; break;
...@@ -340,7 +340,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO ...@@ -340,7 +340,7 @@ bool FactMetaData::convertAndValidateRaw(const QVariant& rawValue, bool convertO
} }
if (!convertOk) { if (!convertOk) {
errorString += "Invalid number"; errorString += tr("Invalid number");
} }
return convertOk && errorString.isEmpty(); return convertOk && errorString.isEmpty();
...@@ -359,7 +359,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co ...@@ -359,7 +359,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
typedValue = QVariant(cookedValue.toInt(&convertOk)); typedValue = QVariant(cookedValue.toInt(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) { if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toInt()).arg(cookedMax().toInt());
} }
} }
break; break;
...@@ -369,7 +369,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co ...@@ -369,7 +369,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
typedValue = QVariant(cookedValue.toUInt(&convertOk)); typedValue = QVariant(cookedValue.toUInt(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) { if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toUInt()).arg(cookedMax().toUInt());
} }
} }
break; break;
...@@ -377,7 +377,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co ...@@ -377,7 +377,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
typedValue = QVariant(cookedValue.toFloat(&convertOk)); typedValue = QVariant(cookedValue.toFloat(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) { if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toFloat()).arg(cookedMax().toFloat()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toFloat()).arg(cookedMax().toFloat());
} }
} }
break; break;
...@@ -386,7 +386,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co ...@@ -386,7 +386,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
typedValue = QVariant(cookedValue.toDouble(&convertOk)); typedValue = QVariant(cookedValue.toDouble(&convertOk));
if (!convertOnly && convertOk) { if (!convertOnly && convertOk) {
if (cookedMin() > typedValue || typedValue > cookedMax()) { if (cookedMin() > typedValue || typedValue > cookedMax()) {
errorString = QString("Value must be within %1 and %2").arg(cookedMin().toDouble()).arg(cookedMax().toDouble()); errorString = tr("Value must be within %1 and %2").arg(cookedMin().toDouble()).arg(cookedMax().toDouble());
} }
} }
break; break;
...@@ -405,7 +405,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co ...@@ -405,7 +405,7 @@ bool FactMetaData::convertAndValidateCooked(const QVariant& cookedValue, bool co
} }
if (!convertOk) { if (!convertOk) {
errorString += "Invalid number"; errorString += tr("Invalid number");
} }
return convertOk && errorString.isEmpty(); return convertOk && errorString.isEmpty();
......
...@@ -383,7 +383,7 @@ void ParameterManager::_valueUpdated(const QVariant& value) ...@@ -383,7 +383,7 @@ void ParameterManager::_valueUpdated(const QVariant& value)
qCDebug(ParameterManagerLog) << _logVehiclePrefix(componentId) << "Set parameter - name:" << name << value << "(_waitingParamTimeoutTimer started)"; qCDebug(ParameterManagerLog) << _logVehiclePrefix(componentId) << "Set parameter - name:" << name << value << "(_waitingParamTimeoutTimer started)";
if (fact->rebootRequired() && !qgcApp()->runningUnitTests()) { if (fact->rebootRequired() && !qgcApp()->runningUnitTests()) {
qgcApp()->showMessage(QStringLiteral("Change of parameter %1 requires a Vehicle reboot to take effect").arg(name)); qgcApp()->showMessage(tr("Change of parameter %1 requires a Vehicle reboot to take effect").arg(name));
} }
} }
......
...@@ -376,7 +376,7 @@ bool APMFirmwarePlugin::_handleIncomingStatusText(Vehicle* vehicle, mavlink_mess ...@@ -376,7 +376,7 @@ bool APMFirmwarePlugin::_handleIncomingStatusText(Vehicle* vehicle, mavlink_mess
if (supportedMajorNumber != -1) { if (supportedMajorNumber != -1) {
if (firmwareVersion.majorNumber() < supportedMajorNumber || firmwareVersion.minorNumber() < supportedMinorNumber) { if (firmwareVersion.majorNumber() < supportedMajorNumber || firmwareVersion.minorNumber() < supportedMinorNumber) {
qgcApp()->showMessage(QString("QGroundControl fully supports Version %1.%2 and above. You are using a version prior to that. This combination is untested, you may run into unpredictable results.").arg(supportedMajorNumber).arg(supportedMinorNumber)); qgcApp()->showMessage(tr("QGroundControl fully supports Version %1.%2 and above. You are using a version prior to that. This combination is untested, you may run into unpredictable results.").arg(supportedMajorNumber).arg(supportedMinorNumber));
} }
} }
} }
...@@ -858,7 +858,7 @@ void APMFirmwarePlugin::guidedModeRTL(Vehicle* vehicle) ...@@ -858,7 +858,7 @@ void APMFirmwarePlugin::guidedModeRTL(Vehicle* vehicle)
void APMFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange) void APMFirmwarePlugin::guidedModeChangeAltitude(Vehicle* vehicle, double altitudeChange)
{ {
if (qIsNaN(vehicle->altitudeRelative()->rawValue().toDouble())) { if (qIsNaN(vehicle->altitudeRelative()->rawValue().toDouble())) {
qgcApp()->showMessage(QStringLiteral("Unable to change altitude, vehicle altitude not known.")); qgcApp()->showMessage(tr("Unable to change altitude, vehicle altitude not known."));
return; return;
} }
...@@ -965,7 +965,7 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle) ...@@ -965,7 +965,7 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle)
} }
if (!didTakeoff) { if (!didTakeoff) {
qgcApp()->showMessage(QStringLiteral("Unable to start mission. Vehicle takeoff failed.")); qgcApp()->showMessage(tr("Unable to start mission. Vehicle takeoff failed."));
return; return;
} }
} else { } else {
...@@ -974,7 +974,7 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle) ...@@ -974,7 +974,7 @@ void APMFirmwarePlugin::startMission(Vehicle* vehicle)
} }
if (!_setFlightModeAndValidate(vehicle, missionFlightMode())) { if (!_setFlightModeAndValidate(vehicle, missionFlightMode())) {
qgcApp()->showMessage(QStringLiteral("Unable to start mission. Vehicle failed to change to auto.")); qgcApp()->showMessage(tr("Unable to start mission. Vehicle failed to change to auto."));
return; return;
} }
} }
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
static FirmwarePluginFactoryRegister* _instance = NULL; static FirmwarePluginFactoryRegister* _instance = NULL;
const char* guided_mode_not_supported_by_vehicle = "Guided mode not supported by Vehicle."; const QString guided_mode_not_supported_by_vehicle = QObject::tr("Guided mode not supported by Vehicle.");
QVariantList FirmwarePlugin::_cameraList; QVariantList FirmwarePlugin::_cameraList;
const char* FirmwarePlugin::px4FollowMeFlightMode = "Follow Me"; const QString FirmwarePlugin::px4FollowMeFlightMode(QObject::tr("Follow Me"));
FirmwarePluginFactory::FirmwarePluginFactory(void) FirmwarePluginFactory::FirmwarePluginFactory(void)
{ {
......
...@@ -296,7 +296,7 @@ public: ...@@ -296,7 +296,7 @@ public:
virtual bool isVtol(const Vehicle* vehicle) const; virtual bool isVtol(const Vehicle* vehicle) const;
// FIXME: Hack workaround for non pluginize FollowMe support // FIXME: Hack workaround for non pluginize FollowMe support
static const char* px4FollowMeFlightMode; static const QString px4FollowMeFlightMode;
protected: protected:
// Arms the vehicle with validation and retries // Arms the vehicle with validation and retries
......
...@@ -534,7 +534,7 @@ void PX4FirmwarePlugin::_handleAutopilotVersion(Vehicle* vehicle, mavlink_messag ...@@ -534,7 +534,7 @@ void PX4FirmwarePlugin::_handleAutopilotVersion(Vehicle* vehicle, mavlink_messag
if (notifyUser) { if (notifyUser) {
instanceData->versionNotified = true; instanceData->versionNotified = true;
qgcApp()->showMessage(QString("QGroundControl supports PX4 Pro firmware Version %1.%2.%3 and above. You are using a version prior to that which will lead to unpredictable results. Please upgrade your firmware.").arg(supportedMajorVersion).arg(supportedMinorVersion).arg(supportedPatchVersion)); qgcApp()->showMessage(tr("QGroundControl supports PX4 Pro firmware Version %1.%2.%3 and above. You are using a version prior to that which will lead to unpredictable results. Please upgrade your firmware.").arg(supportedMajorVersion).arg(supportedMinorVersion).arg(supportedPatchVersion));
} }
} }
} }
......
...@@ -760,12 +760,12 @@ bool MissionController::_loadTextMissionFile(QTextStream& stream, QmlObjectListM ...@@ -760,12 +760,12 @@ bool MissionController::_loadTextMissionFile(QTextStream& stream, QmlObjectListM
} }
firstItem = false; firstItem = false;
} else { } else {
errorString = QStringLiteral("The mission file is corrupted."); errorString = tr("The mission file is corrupted.");
return false; return false;
} }
} }
} else { } else {
errorString = QStringLiteral("The mission file is not compatible with this version of %1.").arg(qgcApp()->applicationName()); errorString = tr("The mission file is not compatible with this version of %1.").arg(qgcApp()->applicationName());
return false; return false;
} }
......
...@@ -175,27 +175,27 @@ void PlanManager::_ackTimeout(void) ...@@ -175,27 +175,27 @@ void PlanManager::_ackTimeout(void)
switch (_expectedAck) { switch (_expectedAck) {
case AckNone: case AckNone:
qCWarning(PlanManagerLog) << QStringLiteral("_ackTimeout %1 timeout with AckNone").arg(_planTypeString()); qCWarning(PlanManagerLog) << QStringLiteral("_ackTimeout %1 timeout with AckNone").arg(_planTypeString());
_sendError(InternalError, "Internal error occurred during Mission Item communication: _ackTimeOut:_expectedAck == AckNone"); _sendError(InternalError, tr("Internal error occurred during Mission Item communication: _ackTimeOut:_expectedAck == AckNone"));
break; break;
case AckMissionCount: case AckMissionCount:
// MISSION_COUNT message expected // MISSION_COUNT message expected
if (_retryCount > _maxRetryCount) { if (_retryCount > _maxRetryCount) {
_sendError(VehicleError, QStringLiteral("Mission request list failed, maximum retries exceeded.")); _sendError(VehicleError, tr("Mission request list failed, maximum retries exceeded."));
_finishTransaction(false); _finishTransaction(false);
} else { } else {
_retryCount++; _retryCount++;
qCDebug(PlanManagerLog) << QStringLiteral("Retrying %1 REQUEST_LIST retry Count").arg(_planTypeString()) << _retryCount; qCDebug(PlanManagerLog) << tr("Retrying %1 REQUEST_LIST retry Count").arg(_planTypeString()) << _retryCount;
_requestList(); _requestList();
} }
break; break;
case AckMissionItem: case AckMissionItem:
// MISSION_ITEM expected // MISSION_ITEM expected
if (_retryCount > _maxRetryCount) { if (_retryCount > _maxRetryCount) {
_sendError(VehicleError, QStringLiteral("Mission read failed, maximum retries exceeded.")); _sendError(VehicleError, tr("Mission read failed, maximum retries exceeded."));
_finishTransaction(false); _finishTransaction(false);
} else { } else {
_retryCount++; _retryCount++;
qCDebug(PlanManagerLog) << QStringLiteral("Retrying %1 MISSION_REQUEST retry Count").arg(_planTypeString()) << _retryCount; qCDebug(PlanManagerLog) << tr("Retrying %1 MISSION_REQUEST retry Count").arg(_planTypeString()) << _retryCount;
_requestNextMissionItem(); _requestNextMissionItem();
} }
break; break;
...@@ -203,12 +203,12 @@ void PlanManager::_ackTimeout(void) ...@@ -203,12 +203,12 @@ void PlanManager::_ackTimeout(void)
// MISSION_REQUEST is expected, or MISSION_ACK to end sequence // MISSION_REQUEST is expected, or MISSION_ACK to end sequence
if (_itemIndicesToWrite.count() == 0) { if (_itemIndicesToWrite.count() == 0) {
// Vehicle did not send final MISSION_ACK at end of sequence // Vehicle did not send final MISSION_ACK at end of sequence
_sendError(VehicleError, QStringLiteral("Mission write failed, vehicle failed to send final ack.")); _sendError(VehicleError, tr("Mission write failed, vehicle failed to send final ack."));
_finishTransaction(false); _finishTransaction(false);
} else if (_itemIndicesToWrite[0] == 0) { } else if (_itemIndicesToWrite[0] == 0) {
// Vehicle did not respond to MISSION_COUNT, try again // Vehicle did not respond to MISSION_COUNT, try again
if (_retryCount > _maxRetryCount) { if (_retryCount > _maxRetryCount) {
_sendError(VehicleError, QStringLiteral("Mission write mission count failed, maximum retries exceeded.")); _sendError(VehicleError, tr("Mission write mission count failed, maximum retries exceeded."));
_finishTransaction(false); _finishTransaction(false);
} else { } else {
_retryCount++; _retryCount++;
...@@ -217,7 +217,7 @@ void PlanManager::_ackTimeout(void) ...@@ -217,7 +217,7 @@ void PlanManager::_ackTimeout(void)
} }
} else { } else {
// Vehicle did not request all items from ground station // Vehicle did not request all items from ground station
_sendError(AckTimeoutError, QString("Vehicle did not request all items from ground station: %1").arg(_ackTypeToString(_expectedAck))); _sendError(AckTimeoutError, tr("Vehicle did not request all items from ground station: %1").arg(_ackTypeToString(_expectedAck)));
_expectedAck = AckNone; _expectedAck = AckNone;
_finishTransaction(false); _finishTransaction(false);
} }
...@@ -225,18 +225,18 @@ void PlanManager::_ackTimeout(void) ...@@ -225,18 +225,18 @@ void PlanManager::_ackTimeout(void)
case AckMissionClearAll: case AckMissionClearAll:
// MISSION_ACK expected // MISSION_ACK expected
if (_retryCount > _maxRetryCount) { if (_retryCount > _maxRetryCount) {
_sendError(VehicleError, QStringLiteral("Mission remove all, maximum retries exceeded.")); _sendError(VehicleError, tr("Mission remove all, maximum retries exceeded."));
_finishTransaction(false); _finishTransaction(false);
} else { } else {
_retryCount++; _retryCount++;
qCDebug(PlanManagerLog) << QStringLiteral("Retrying %1 MISSION_CLEAR_ALL retry Count").arg(_planTypeString()) << _retryCount; qCDebug(PlanManagerLog) << tr("Retrying %1 MISSION_CLEAR_ALL retry Count").arg(_planTypeString()) << _retryCount;
_removeAllWorker(); _removeAllWorker();
} }
break; break;
case AckGuidedItem: case AckGuidedItem:
// MISSION_REQUEST is expected, or MISSION_ACK to end sequence // MISSION_REQUEST is expected, or MISSION_ACK to end sequence
default: default:
_sendError(AckTimeoutError, QString("Vehicle did not respond to mission item communication: %1").arg(_ackTypeToString(_expectedAck))); _sendError(AckTimeoutError, tr("Vehicle did not respond to mission item communication: %1").arg(_ackTypeToString(_expectedAck)));
_expectedAck = AckNone; _expectedAck = AckNone;
_finishTransaction(false); _finishTransaction(false);
} }
...@@ -496,7 +496,7 @@ void PlanManager::_handleMissionRequest(const mavlink_message_t& message, bool m ...@@ -496,7 +496,7 @@ void PlanManager::_handleMissionRequest(const mavlink_message_t& message, bool m
qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionRequest %1 sequenceNumber").arg(_planTypeString()) << missionRequest.seq; qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionRequest %1 sequenceNumber").arg(_planTypeString()) << missionRequest.seq;
if (missionRequest.seq > _writeMissionItems.count() - 1) { if (missionRequest.seq > _writeMissionItems.count() - 1) {
_sendError(RequestRangeError, QString("Vehicle requested item outside range, count:request %1:%2. Send to Vehicle failed.").arg(_writeMissionItems.count()).arg(missionRequest.seq)); _sendError(RequestRangeError, tr("Vehicle requested item outside range, count:request %1:%2. Send to Vehicle failed.").arg(_writeMissionItems.count()).arg(missionRequest.seq));
_finishTransaction(false); _finishTransaction(false);
return; return;
} }
...@@ -588,16 +588,16 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message) ...@@ -588,16 +588,16 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message)
switch (savedExpectedAck) { switch (savedExpectedAck) {
case AckNone: case AckNone:
// State machine is idle. Vehicle is confused. // State machine is idle. Vehicle is confused.
_sendError(VehicleError, QString("Vehicle sent unexpected MISSION_ACK message, error: %1").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle sent unexpected MISSION_ACK message, error: %1").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
break; break;
case AckMissionCount: case AckMissionCount:
// MISSION_COUNT message expected // MISSION_COUNT message expected
_sendError(VehicleError, QString("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
_finishTransaction(false); _finishTransaction(false);
break; break;
case AckMissionItem: case AckMissionItem:
// MISSION_ITEM expected // MISSION_ITEM expected
_sendError(VehicleError, QString("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
_finishTransaction(false); _finishTransaction(false);
break; break;
case AckMissionRequest: case AckMissionRequest:
...@@ -607,18 +607,18 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message) ...@@ -607,18 +607,18 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message)
qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionAck write sequence complete").arg(_planTypeString()); qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionAck write sequence complete").arg(_planTypeString());
_finishTransaction(true); _finishTransaction(true);
} else { } else {
_sendError(MissingRequestsError, QString("Vehicle did not request all items during write sequence, missed count %1.").arg(_itemIndicesToWrite.count())); _sendError(MissingRequestsError, tr("Vehicle did not request all items during write sequence, missed count %1.").arg(_itemIndicesToWrite.count()));
_finishTransaction(false); _finishTransaction(false);
} }
} else { } else {
_sendError(VehicleError, QString("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle returned error: %1.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
_finishTransaction(false); _finishTransaction(false);
} }
break; break;
case AckMissionClearAll: case AckMissionClearAll:
// MISSION_ACK expected // MISSION_ACK expected
if (missionAck.type != MAV_MISSION_ACCEPTED) { if (missionAck.type != MAV_MISSION_ACCEPTED) {
_sendError(VehicleError, QString("Vehicle returned error: %1. Vehicle remove all failed.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle returned error: %1. Vehicle remove all failed.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
} }
_finishTransaction(missionAck.type == MAV_MISSION_ACCEPTED); _finishTransaction(missionAck.type == MAV_MISSION_ACCEPTED);
break; break;
...@@ -628,7 +628,7 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message) ...@@ -628,7 +628,7 @@ void PlanManager::_handleMissionAck(const mavlink_message_t& message)
qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionAck %1 guided mode item accepted").arg(_planTypeString()); qCDebug(PlanManagerLog) << QStringLiteral("_handleMissionAck %1 guided mode item accepted").arg(_planTypeString());
_finishTransaction(true); _finishTransaction(true);
} else { } else {
_sendError(VehicleError, QString("Vehicle returned error: %1. %2Vehicle did not accept guided item.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type))); _sendError(VehicleError, tr("Vehicle returned error: %1. %2Vehicle did not accept guided item.").arg(_missionResultToString((MAV_MISSION_RESULT)missionAck.type)));
_finishTransaction(false); _finishTransaction(false);
} }
break; break;
...@@ -748,53 +748,53 @@ QString PlanManager::_missionResultToString(MAV_MISSION_RESULT result) ...@@ -748,53 +748,53 @@ QString PlanManager::_missionResultToString(MAV_MISSION_RESULT result)
switch (result) { switch (result) {
case MAV_MISSION_ACCEPTED: case MAV_MISSION_ACCEPTED:
resultString = QString("Mission accepted (MAV_MISSION_ACCEPTED)"); resultString = tr("Mission accepted (MAV_MISSION_ACCEPTED)");
break; break;
case MAV_MISSION_ERROR: case MAV_MISSION_ERROR:
resultString = QString("Unspecified error (MAV_MISSION_ERROR)"); resultString = tr("Unspecified error (MAV_MISSION_ERROR)");
break; break;
case MAV_MISSION_UNSUPPORTED_FRAME: case MAV_MISSION_UNSUPPORTED_FRAME:
resultString = QString("Coordinate frame is not supported (MAV_MISSION_UNSUPPORTED_FRAME)"); resultString = tr("Coordinate frame is not supported (MAV_MISSION_UNSUPPORTED_FRAME)");
break; break;
case MAV_MISSION_UNSUPPORTED: case MAV_MISSION_UNSUPPORTED:
resultString = QString("Command is not supported (MAV_MISSION_UNSUPPORTED)"); resultString = tr("Command is not supported (MAV_MISSION_UNSUPPORTED)");
break; break;
case MAV_MISSION_NO_SPACE: case MAV_MISSION_NO_SPACE:
resultString = QString("Mission item exceeds storage space (MAV_MISSION_NO_SPACE)"); resultString = tr("Mission item exceeds storage space (MAV_MISSION_NO_SPACE)");
break; break;
case MAV_MISSION_INVALID: case MAV_MISSION_INVALID:
resultString = QString("One of the parameters has an invalid value (MAV_MISSION_INVALID)"); resultString = tr("One of the parameters has an invalid value (MAV_MISSION_INVALID)");
break; break;
case MAV_MISSION_INVALID_PARAM1: case MAV_MISSION_INVALID_PARAM1:
resultString = QString("Param1 has an invalid value (MAV_MISSION_INVALID_PARAM1)"); resultString = tr("Param1 has an invalid value (MAV_MISSION_INVALID_PARAM1)");
break; break;
case MAV_MISSION_INVALID_PARAM2: case MAV_MISSION_INVALID_PARAM2:
resultString = QString("Param2 has an invalid value (MAV_MISSION_INVALID_PARAM2)"); resultString = tr("Param2 has an invalid value (MAV_MISSION_INVALID_PARAM2)");
break; break;
case MAV_MISSION_INVALID_PARAM3: case MAV_MISSION_INVALID_PARAM3:
resultString = QString("Param3 has an invalid value (MAV_MISSION_INVALID_PARAM3)"); resultString = tr("Param3 has an invalid value (MAV_MISSION_INVALID_PARAM3)");
break; break;
case MAV_MISSION_INVALID_PARAM4: case MAV_MISSION_INVALID_PARAM4:
resultString = QString("Param4 has an invalid value (MAV_MISSION_INVALID_PARAM4)"); resultString = tr("Param4 has an invalid value (MAV_MISSION_INVALID_PARAM4)");
break; break;
case MAV_MISSION_INVALID_PARAM5_X: case MAV_MISSION_INVALID_PARAM5_X:
resultString = QString("X/Param5 has an invalid value (MAV_MISSION_INVALID_PARAM5_X)"); resultString = tr("X/Param5 has an invalid value (MAV_MISSION_INVALID_PARAM5_X)");
break; break;
case MAV_MISSION_INVALID_PARAM6_Y: case MAV_MISSION_INVALID_PARAM6_Y:
resultString = QString("Y/Param6 has an invalid value (MAV_MISSION_INVALID_PARAM6_Y)"); resultString = tr("Y/Param6 has an invalid value (MAV_MISSION_INVALID_PARAM6_Y)");
break; break;
case MAV_MISSION_INVALID_PARAM7: case MAV_MISSION_INVALID_PARAM7:
resultString = QString("Param7 has an invalid value (MAV_MISSION_INVALID_PARAM7)"); resultString = tr("Param7 has an invalid value (MAV_MISSION_INVALID_PARAM7)");
break; break;
case MAV_MISSION_INVALID_SEQUENCE: case MAV_MISSION_INVALID_SEQUENCE:
resultString = QString("Received mission item out of sequence (MAV_MISSION_INVALID_SEQUENCE)"); resultString = tr("Received mission item out of sequence (MAV_MISSION_INVALID_SEQUENCE)");
break; break;
case MAV_MISSION_DENIED: case MAV_MISSION_DENIED:
resultString = QString("Not accepting any mission commands (MAV_MISSION_DENIED)"); resultString = tr("Not accepting any mission commands (MAV_MISSION_DENIED)");
break; break;
default: default:
qWarning(PlanManagerLog) << QStringLiteral("Fell off end of switch statement %1").arg(_planTypeString()); qWarning(PlanManagerLog) << QStringLiteral("Fell off end of switch statement %1").arg(_planTypeString());
resultString = QString("QGC Internal Error"); resultString = tr("QGC Internal Error");
} }
return resultString + lastRequestString; return resultString + lastRequestString;
......
...@@ -417,16 +417,16 @@ bool QGCApplication::_initForNormalAppBoot(void) ...@@ -417,16 +417,16 @@ bool QGCApplication::_initForNormalAppBoot(void)
toolbox()->joystickManager()->init(); toolbox()->joystickManager()->init();
if (_settingsUpgraded) { if (_settingsUpgraded) {
showMessage("The format for QGroundControl saved settings has been modified. " showMessage(tr("The format for QGroundControl saved settings has been modified. "
"Your saved settings have been reset to defaults."); "Your saved settings have been reset to defaults."));
} }
// Connect links with flag AutoconnectLink // Connect links with flag AutoconnectLink
toolbox()->linkManager()->startAutoConnectedLinks(); toolbox()->linkManager()->startAutoConnectedLinks();
if (getQGCMapEngine()->wasCacheReset()) { if (getQGCMapEngine()->wasCacheReset()) {
showMessage("The Offline Map Cache database has been upgraded. " showMessage(tr("The Offline Map Cache database has been upgraded. "
"Your old map cache sets have been reset."); "Your old map cache sets have been reset."));
} }
settings.sync(); settings.sync();
...@@ -615,7 +615,7 @@ void QGCApplication::_missingParamsDisplay(void) ...@@ -615,7 +615,7 @@ void QGCApplication::_missingParamsDisplay(void)
} }
_missingParams.clear(); _missingParams.clear();
showMessage(QString("Parameters are missing from firmware. You may be running a version of firmware QGC does not work correctly with or your firmware has a bug in it. Missing params: %1").arg(params)); showMessage(tr("Parameters are missing from firmware. You may be running a version of firmware QGC does not work correctly with or your firmware has a bug in it. Missing params: %1").arg(params));
} }
} }
......
...@@ -115,7 +115,7 @@ void QGCFileDownload::_downloadFinished(void) ...@@ -115,7 +115,7 @@ void QGCFileDownload::_downloadFinished(void)
// Store downloaded file in download location // Store downloaded file in download location
QFile file(downloadFilename); QFile file(downloadFilename);
if (!file.open(QIODevice::WriteOnly)) { if (!file.open(QIODevice::WriteOnly)) {
emit error(QString("Could not save downloaded file to %1. Error: %2").arg(downloadFilename).arg(file.errorString())); emit error(tr("Could not save downloaded file to %1. Error: %2").arg(downloadFilename).arg(file.errorString()));
return; return;
} }
...@@ -136,13 +136,13 @@ void QGCFileDownload::_downloadError(QNetworkReply::NetworkError code) ...@@ -136,13 +136,13 @@ void QGCFileDownload::_downloadError(QNetworkReply::NetworkError code)
QString errorMsg; QString errorMsg;
if (code == QNetworkReply::OperationCanceledError) { if (code == QNetworkReply::OperationCanceledError) {
errorMsg = "Download cancelled"; errorMsg = tr("Download cancelled");
} else if (code == QNetworkReply::ContentNotFoundError) { } else if (code == QNetworkReply::ContentNotFoundError) {
errorMsg = "Error: File Not Found"; errorMsg = tr("Error: File Not Found");
} else { } else {
errorMsg = QString("Error during download. Error: %1").arg(code); errorMsg = tr("Error during download. Error: %1").arg(code);
} }
emit error(errorMsg); emit error(errorMsg);
......
...@@ -50,7 +50,7 @@ bool QGCQuickWidget::setSource(const QUrl& qmlUrl) ...@@ -50,7 +50,7 @@ bool QGCQuickWidget::setSource(const QUrl& qmlUrl)
errorList += error.toString(); errorList += error.toString();
errorList += "\n"; errorList += "\n";
} }
qgcApp()->showMessage(QString("Source not ready: Status(%1)\nErrors:\n%2").arg(status()).arg(errorList)); qgcApp()->showMessage(tr("Source not ready: Status(%1)\nErrors:\n%2").arg(status()).arg(errorList));
return false; return false;
} }
......
...@@ -100,7 +100,7 @@ void ParameterEditorController::saveToFile(const QString& filename) ...@@ -100,7 +100,7 @@ void ParameterEditorController::saveToFile(const QString& filename)
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
qgcApp()->showMessage(QString("Unable to create file: %1").arg(filename)); qgcApp()->showMessage(tr("Unable to create file: %1").arg(filename));
return; return;
} }
...@@ -118,7 +118,7 @@ void ParameterEditorController::loadFromFile(const QString& filename) ...@@ -118,7 +118,7 @@ void ParameterEditorController::loadFromFile(const QString& filename)
QFile file(filename); QFile file(filename);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qgcApp()->showMessage(QString("Unable to open file: %1").arg(filename)); qgcApp()->showMessage(tr("Unable to open file: %1").arg(filename));
return; return;
} }
......
...@@ -116,7 +116,7 @@ void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicle ...@@ -116,7 +116,7 @@ void MultiVehicleManager::_vehicleHeartbeatInfo(LinkInterface* link, int vehicle
<< vehicleType; << vehicleType;
if (vehicleId == _mavlinkProtocol->getSystemId()) { if (vehicleId == _mavlinkProtocol->getSystemId()) {
_app->showMessage(QString("Warning: A vehicle is using the same system id as %1: %2").arg(qgcApp()->applicationName()).arg(vehicleId)); _app->showMessage(tr("Warning: A vehicle is using the same system id as %1: %2").arg(qgcApp()->applicationName()).arg(vehicleId));
} }
// QSettings settings; // QSettings settings;
......
...@@ -40,7 +40,7 @@ QGC_LOGGING_CATEGORY(VehicleLog, "VehicleLog") ...@@ -40,7 +40,7 @@ QGC_LOGGING_CATEGORY(VehicleLog, "VehicleLog")
#define DEFAULT_LAT 38.965767f #define DEFAULT_LAT 38.965767f
#define DEFAULT_LON -120.083923f #define DEFAULT_LON -120.083923f
extern const char* guided_mode_not_supported_by_vehicle; const QString guided_mode_not_supported_by_vehicle = QObject::tr("Guided mode not supported by Vehicle.");
const char* Vehicle::_settingsGroup = "Vehicle%1"; // %1 replaced with mavlink system id const char* Vehicle::_settingsGroup = "Vehicle%1"; // %1 replaced with mavlink system id
const char* Vehicle::_joystickModeSettingsKey = "JoystickMode"; const char* Vehicle::_joystickModeSettingsKey = "JoystickMode";
...@@ -1026,7 +1026,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message) ...@@ -1026,7 +1026,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
sysStatus.battery_remaining < _settingsManager->appSettings()->batteryPercentRemainingAnnounce()->rawValue().toInt() && sysStatus.battery_remaining < _settingsManager->appSettings()->batteryPercentRemainingAnnounce()->rawValue().toInt() &&
sysStatus.battery_remaining < _lastAnnouncedLowBatteryPercent) { sysStatus.battery_remaining < _lastAnnouncedLowBatteryPercent) {
_lastAnnouncedLowBatteryPercent = sysStatus.battery_remaining; _lastAnnouncedLowBatteryPercent = sysStatus.battery_remaining;
_say(QString("%1 low battery: %2 percent remaining").arg(_vehicleIdSpeech()).arg(sysStatus.battery_remaining)); _say(tr("%1 low battery: %2 percent remaining").arg(_vehicleIdSpeech()).arg(sysStatus.battery_remaining));
} }
_onboardControlSensorsPresent = sysStatus.onboard_control_sensors_present; _onboardControlSensorsPresent = sysStatus.onboard_control_sensors_present;
...@@ -1826,19 +1826,19 @@ void Vehicle::sendMessageMultiple(mavlink_message_t message) ...@@ -1826,19 +1826,19 @@ void Vehicle::sendMessageMultiple(mavlink_message_t message)
void Vehicle::_missionManagerError(int errorCode, const QString& errorMsg) void Vehicle::_missionManagerError(int errorCode, const QString& errorMsg)
{ {
Q_UNUSED(errorCode); Q_UNUSED(errorCode);
qgcApp()->showMessage(QString("Mission transfer failed. Retry transfer. Error: %1").arg(errorMsg)); qgcApp()->showMessage(tr("Mission transfer failed. Retry transfer. Error: %1").arg(errorMsg));
} }
void Vehicle::_geoFenceManagerError(int errorCode, const QString& errorMsg) void Vehicle::_geoFenceManagerError(int errorCode, const QString& errorMsg)
{ {
Q_UNUSED(errorCode); Q_UNUSED(errorCode);
qgcApp()->showMessage(QString("GeoFence transfer failed. Retry transfer. Error: %1").arg(errorMsg)); qgcApp()->showMessage(tr("GeoFence transfer failed. Retry transfer. Error: %1").arg(errorMsg));
} }
void Vehicle::_rallyPointManagerError(int errorCode, const QString& errorMsg) void Vehicle::_rallyPointManagerError(int errorCode, const QString& errorMsg)
{ {
Q_UNUSED(errorCode); Q_UNUSED(errorCode);
qgcApp()->showMessage(QString("Rally Point transfer failed. Retry transfer. Error: %1").arg(errorMsg)); qgcApp()->showMessage(tr("Rally Point transfer failed. Retry transfer. Error: %1").arg(errorMsg));
} }
void Vehicle::_addNewMapTrajectoryPoint(void) void Vehicle::_addNewMapTrajectoryPoint(void)
......
...@@ -88,7 +88,7 @@ bool Bootloader::_getCommandResponse(QextSerialPort* port, int responseTimeout) ...@@ -88,7 +88,7 @@ bool Bootloader::_getCommandResponse(QextSerialPort* port, int responseTimeout)
uint8_t response[2]; uint8_t response[2];
if (!_read(port, response, 2, responseTimeout)) { if (!_read(port, response, 2, responseTimeout)) {
_errorString.prepend("Get Command Response: "); _errorString.prepend(tr("Get Command Response: "));
return false; return false;
} }
...@@ -134,7 +134,7 @@ bool Bootloader::_getPX4BoardInfo(QextSerialPort* port, uint8_t param, uint32_t& ...@@ -134,7 +134,7 @@ bool Bootloader::_getPX4BoardInfo(QextSerialPort* port, uint8_t param, uint32_t&
return true; return true;
Error: Error:
_errorString.prepend("Get Board Info: "); _errorString.prepend(tr("Get Board Info: "));
return false; return false;
} }
...@@ -156,7 +156,7 @@ bool Bootloader::_sendCommand(QextSerialPort* port, const uint8_t cmd, int respo ...@@ -156,7 +156,7 @@ bool Bootloader::_sendCommand(QextSerialPort* port, const uint8_t cmd, int respo
return true; return true;
Error: Error:
_errorString.prepend("Send Command: "); _errorString.prepend(tr("Send Command: "));
return false; return false;
} }
...@@ -259,7 +259,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image) ...@@ -259,7 +259,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image)
QByteArray bytes; QByteArray bytes;
if (!image->ihxGetBlock(index, flashAddress, bytes)) { if (!image->ihxGetBlock(index, flashAddress, bytes)) {
_errorString = QString("Unable to retrieve block from ihx: index %1").arg(index); _errorString = tr("Unable to retrieve block from ihx: index %1").arg(index);
return false; return false;
} }
...@@ -279,7 +279,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image) ...@@ -279,7 +279,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image)
} }
if (failed) { if (failed) {
_errorString = QString("Unable to set flash start address: 0x%2").arg(flashAddress, 8, 16, QLatin1Char('0')); _errorString = tr("Unable to set flash start address: 0x%2").arg(flashAddress, 8, 16, QLatin1Char('0'));
return false; return false;
} }
...@@ -308,7 +308,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image) ...@@ -308,7 +308,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image)
} }
} }
if (failed) { if (failed) {
_errorString = QString("Flash failed: %1 at address 0x%2").arg(_errorString).arg(flashAddress, 8, 16, QLatin1Char('0')); _errorString = tr("Flash failed: %1 at address 0x%2").arg(_errorString).arg(flashAddress, 8, 16, QLatin1Char('0'));
return false; return false;
} }
...@@ -431,7 +431,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag ...@@ -431,7 +431,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag
QByteArray imageBytes; QByteArray imageBytes;
if (!image->ihxGetBlock(index, readAddress, imageBytes)) { if (!image->ihxGetBlock(index, readAddress, imageBytes)) {
_errorString = QString("Unable to retrieve block from ihx: index %1").arg(index); _errorString = tr("Unable to retrieve block from ihx: index %1").arg(index);
return false; return false;
} }
...@@ -451,7 +451,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag ...@@ -451,7 +451,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag
} }
if (failed) { if (failed) {
_errorString = QString("Unable to set read start address: 0x%2").arg(readAddress, 8, 16, QLatin1Char('0')); _errorString = tr("Unable to set read start address: 0x%2").arg(readAddress, 8, 16, QLatin1Char('0'));
return false; return false;
} }
...@@ -490,7 +490,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag ...@@ -490,7 +490,7 @@ bool Bootloader::_ihxVerifyBytes(QextSerialPort* port, const FirmwareImage* imag
for (int i=0; i<bytesToRead; i++) { for (int i=0; i<bytesToRead; i++) {
if ((uint8_t)imageBytes[bytesIndex + i] != readBuf[i]) { if ((uint8_t)imageBytes[bytesIndex + i] != readBuf[i]) {
_errorString = QString("Compare failed: expected(0x%1) actual(0x%2) at address: 0x%3").arg(imageBytes[bytesIndex + i], 2, 16, QLatin1Char('0')).arg(readBuf[i], 2, 16, QLatin1Char('0')).arg(readAddress + i, 8, 16, QLatin1Char('0')); _errorString = tr("Compare failed: expected(0x%1) actual(0x%2) at address: 0x%3").arg(imageBytes[bytesIndex + i], 2, 16, QLatin1Char('0')).arg(readBuf[i], 2, 16, QLatin1Char('0')).arg(readAddress + i, 8, 16, QLatin1Char('0'));
return false; return false;
} }
} }
...@@ -597,7 +597,7 @@ bool Bootloader::getPX4BoardInfo(QextSerialPort* port, uint32_t& bootloaderVersi ...@@ -597,7 +597,7 @@ bool Bootloader::getPX4BoardInfo(QextSerialPort* port, uint32_t& bootloaderVersi
return true; return true;
Error: Error:
_errorString.prepend("Get Board Info: "); _errorString.prepend(tr("Get Board Info: "));
return false; return false;
} }
...@@ -625,7 +625,7 @@ bool Bootloader::get3DRRadioBoardId(QextSerialPort* port, uint32_t& boardID) ...@@ -625,7 +625,7 @@ bool Bootloader::get3DRRadioBoardId(QextSerialPort* port, uint32_t& boardID)
return true; return true;
Error: Error:
_errorString.prepend("Get Board Id: "); _errorString.prepend(tr("Get Board Id: "));
return false; return false;
} }
......
...@@ -142,12 +142,12 @@ bool FirmwareImage::_ihxLoad(const QString& ihxFilename) ...@@ -142,12 +142,12 @@ bool FirmwareImage::_ihxLoad(const QString& ihxFilename)
!_readByteFromStream(stream, recordType) || !_readByteFromStream(stream, recordType) ||
!_readBytesFromStream(stream, blockByteCount, bytes) || !_readBytesFromStream(stream, blockByteCount, bytes) ||
!_readByteFromStream(stream, crc)) { !_readByteFromStream(stream, crc)) {
emit statusMessage("Incorrectly formatted line in .ihx file, line too short"); emit statusMessage(tr("Incorrectly formatted line in .ihx file, line too short"));
return false; return false;
} }
if (!(recordType == 0 || recordType == 1)) { if (!(recordType == 0 || recordType == 1)) {
emit statusMessage(QString("Unsupported record type in file: %1").arg(recordType)); emit statusMessage(tr("Unsupported record type in file: %1").arg(recordType));
return false; return false;
} }
...@@ -220,7 +220,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -220,7 +220,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
QFile px4File(imageFilename); QFile px4File(imageFilename);
if (!px4File.open(QIODevice::ReadOnly | QIODevice::Text)) { if (!px4File.open(QIODevice::ReadOnly | QIODevice::Text)) {
emit statusMessage(QString("Unable to open firmware file %1, error: %2").arg(imageFilename).arg(px4File.errorString())); emit statusMessage(tr("Unable to open firmware file %1, error: %2").arg(imageFilename).arg(px4File.errorString()));
return false; return false;
} }
...@@ -229,7 +229,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -229,7 +229,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
QJsonDocument doc = QJsonDocument::fromJson(bytes); QJsonDocument doc = QJsonDocument::fromJson(bytes);
if (doc.isNull()) { if (doc.isNull()) {
emit statusMessage("Supplied file is not a valid JSON document"); emit statusMessage(tr("Supplied file is not a valid JSON document"));
return false; return false;
} }
...@@ -240,7 +240,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -240,7 +240,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
QStringList requiredKeys; QStringList requiredKeys;
requiredKeys << _jsonBoardIdKey << _jsonImageKey << _jsonImageSizeKey; requiredKeys << _jsonBoardIdKey << _jsonImageKey << _jsonImageSizeKey;
if (!JsonHelper::validateRequiredKeys(px4Json, requiredKeys, errorString)) { if (!JsonHelper::validateRequiredKeys(px4Json, requiredKeys, errorString)) {
emit statusMessage(QString("Firmware file mission required key: %1").arg(errorString)); emit statusMessage(tr("Firmware file mission required key: %1").arg(errorString));
return false; return false;
} }
...@@ -250,13 +250,13 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -250,13 +250,13 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
keys << _jsonBoardIdKey << _jsonParamXmlSizeKey << _jsonParamXmlKey << _jsonAirframeXmlSizeKey << _jsonAirframeXmlKey << _jsonImageSizeKey << _jsonImageKey << _jsonMavAutopilotKey; keys << _jsonBoardIdKey << _jsonParamXmlSizeKey << _jsonParamXmlKey << _jsonAirframeXmlSizeKey << _jsonAirframeXmlKey << _jsonImageSizeKey << _jsonImageKey << _jsonMavAutopilotKey;
types << QJsonValue::Double << QJsonValue::Double << QJsonValue::String << QJsonValue::Double << QJsonValue::String << QJsonValue::Double << QJsonValue::String << QJsonValue::Double; types << QJsonValue::Double << QJsonValue::Double << QJsonValue::String << QJsonValue::Double << QJsonValue::String << QJsonValue::Double << QJsonValue::String << QJsonValue::Double;
if (!JsonHelper::validateKeyTypes(px4Json, keys, types, errorString)) { if (!JsonHelper::validateKeyTypes(px4Json, keys, types, errorString)) {
emit statusMessage(QString("Firmware file has invalid key: %1").arg(errorString)); emit statusMessage(tr("Firmware file has invalid key: %1").arg(errorString));
return false; return false;
} }
uint32_t firmwareBoardId = (uint32_t)px4Json.value(_jsonBoardIdKey).toInt(); uint32_t firmwareBoardId = (uint32_t)px4Json.value(_jsonBoardIdKey).toInt();
if (!isCompatible(_boardId, firmwareBoardId)) { if (!isCompatible(_boardId, firmwareBoardId)) {
emit statusMessage(QString("Downloaded firmware board id does not match hardware board id: %1 != %2").arg(firmwareBoardId).arg(_boardId)); emit statusMessage(tr("Downloaded firmware board id does not match hardware board id: %1 != %2").arg(firmwareBoardId).arg(_boardId));
return false; return false;
} }
...@@ -282,14 +282,14 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -282,14 +282,14 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
if (parameterFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { if (parameterFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
qint64 bytesWritten = parameterFile.write(decompressedBytes); qint64 bytesWritten = parameterFile.write(decompressedBytes);
if (bytesWritten != decompressedBytes.count()) { if (bytesWritten != decompressedBytes.count()) {
emit statusMessage(QString("Write failed for parameter meta data file, error: %1").arg(parameterFile.errorString())); emit statusMessage(tr("Write failed for parameter meta data file, error: %1").arg(parameterFile.errorString()));
parameterFile.close(); parameterFile.close();
QFile::remove(parameterFilename); QFile::remove(parameterFilename);
} else { } else {
parameterFile.close(); parameterFile.close();
} }
} else { } else {
emit statusMessage(QString("Unable to open parameter meta data file %1 for writing, error: %2").arg(parameterFilename).arg(parameterFile.errorString())); emit statusMessage(tr("Unable to open parameter meta data file %1 for writing, error: %2").arg(parameterFilename).arg(parameterFile.errorString()));
} }
// Cache this file with the system // Cache this file with the system
...@@ -314,14 +314,14 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -314,14 +314,14 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
qint64 bytesWritten = airframeFile.write(decompressedBytes); qint64 bytesWritten = airframeFile.write(decompressedBytes);
if (bytesWritten != decompressedBytes.count()) { if (bytesWritten != decompressedBytes.count()) {
// FIXME: What about these warnings? // FIXME: What about these warnings?
emit statusMessage(QString("Write failed for airframe meta data file, error: %1").arg(airframeFile.errorString())); emit statusMessage(tr("Write failed for airframe meta data file, error: %1").arg(airframeFile.errorString()));
airframeFile.close(); airframeFile.close();
QFile::remove(airframeFilename); QFile::remove(airframeFilename);
} else { } else {
airframeFile.close(); airframeFile.close();
} }
} else { } else {
emit statusMessage(QString("Unable to open airframe meta data file %1 for writing, error: %2").arg(airframeFilename).arg(airframeFile.errorString())); emit statusMessage(tr("Unable to open airframe meta data file %1 for writing, error: %2").arg(airframeFilename).arg(airframeFile.errorString()));
} }
} }
...@@ -347,13 +347,13 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) ...@@ -347,13 +347,13 @@ bool FirmwareImage::_px4Load(const QString& imageFilename)
QFile decompressFile(decompressFilename); QFile decompressFile(decompressFilename);
if (!decompressFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { if (!decompressFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) {
emit statusMessage(QString("Unable to open decompressed file %1 for writing, error: %2").arg(decompressFilename).arg(decompressFile.errorString())); emit statusMessage(tr("Unable to open decompressed file %1 for writing, error: %2").arg(decompressFilename).arg(decompressFile.errorString()));
return false; return false;
} }
qint64 bytesWritten = decompressFile.write(decompressedBytes); qint64 bytesWritten = decompressFile.write(decompressedBytes);
if (bytesWritten != decompressedBytes.count()) { if (bytesWritten != decompressedBytes.count()) {
emit statusMessage(QString("Write failed for decompressed image file, error: %1").arg(decompressFile.errorString())); emit statusMessage(tr("Write failed for decompressed image file, error: %1").arg(decompressFile.errorString()));
return false; return false;
} }
decompressFile.close(); decompressFile.close();
...@@ -377,7 +377,7 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J ...@@ -377,7 +377,7 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
} }
int decompressedSize = jsonObject.value(QString(sizeKey)).toInt(); int decompressedSize = jsonObject.value(QString(sizeKey)).toInt();
if (decompressedSize == 0) { if (decompressedSize == 0) {
emit statusMessage(QString("Firmware file has invalid decompressed size for %1").arg(sizeKey)); emit statusMessage(tr("Firmware file has invalid decompressed size for %1").arg(sizeKey));
return false; return false;
} }
...@@ -389,12 +389,12 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J ...@@ -389,12 +389,12 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
QStringList parts = QString(jsonDocBytes).split(QString("\"%1\": \"").arg(bytesKey)); QStringList parts = QString(jsonDocBytes).split(QString("\"%1\": \"").arg(bytesKey));
if (parts.count() == 1) { if (parts.count() == 1) {
emit statusMessage(QString("Could not find compressed bytes for %1 in Firmware file").arg(bytesKey)); emit statusMessage(tr("Could not find compressed bytes for %1 in Firmware file").arg(bytesKey));
return false; return false;
} }
parts = parts.last().split("\""); parts = parts.last().split("\"");
if (parts.count() == 1) { if (parts.count() == 1) {
emit statusMessage(QString("Incorrectly formed compressed bytes section for %1 in Firmware file").arg(bytesKey)); emit statusMessage(tr("Incorrectly formed compressed bytes section for %1 in Firmware file").arg(bytesKey));
return false; return false;
} }
...@@ -410,15 +410,15 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J ...@@ -410,15 +410,15 @@ bool FirmwareImage::_decompressJsonValue(const QJsonObject& jsonObject, ///< J
decompressedBytes = qUncompress(raw); decompressedBytes = qUncompress(raw);
if (decompressedBytes.count() == 0) { if (decompressedBytes.count() == 0) {
emit statusMessage(QString("Firmware file has 0 length %1").arg(bytesKey)); emit statusMessage(tr("Firmware file has 0 length %1").arg(bytesKey));
return false; return false;
} }
if (decompressedBytes.count() != decompressedSize) { if (decompressedBytes.count() != decompressedSize) {
emit statusMessage(QString("Size for decompressed %1 does not match stored size: Expected(%1) Actual(%2)").arg(decompressedSize).arg(decompressedBytes.count())); emit statusMessage(tr("Size for decompressed %1 does not match stored size: Expected(%1) Actual(%2)").arg(decompressedSize).arg(decompressedBytes.count()));
return false; return false;
} }
emit statusMessage(QString("Successfully decompressed %1").arg(bytesKey)); emit statusMessage(tr("Successfully decompressed %1").arg(bytesKey));
return true; return true;
} }
...@@ -446,7 +446,7 @@ bool FirmwareImage::_binLoad(const QString& imageFilename) ...@@ -446,7 +446,7 @@ bool FirmwareImage::_binLoad(const QString& imageFilename)
{ {
QFile binFile(imageFilename); QFile binFile(imageFilename);
if (!binFile.open(QIODevice::ReadOnly)) { if (!binFile.open(QIODevice::ReadOnly)) {
emit statusMessage(QString("Unabled to open firmware file %1, %2").arg(imageFilename).arg(binFile.errorString())); emit statusMessage(tr("Unabled to open firmware file %1, %2").arg(imageFilename).arg(binFile.errorString()));
return false; return false;
} }
......
...@@ -167,10 +167,10 @@ void FirmwareUpgradeController::_foundBootloader(int bootloaderVersion, int boar ...@@ -167,10 +167,10 @@ void FirmwareUpgradeController::_foundBootloader(int bootloaderVersion, int boar
_bootloaderBoardID = boardID; _bootloaderBoardID = boardID;
_bootloaderBoardFlashSize = flashSize; _bootloaderBoardFlashSize = flashSize;
_appendStatusLog("Connected to bootloader:"); _appendStatusLog(tr("Connected to bootloader:"));
_appendStatusLog(QString(" Version: %1").arg(_bootloaderVersion)); _appendStatusLog(tr(" Version: %1").arg(_bootloaderVersion));
_appendStatusLog(QString(" Board ID: %1").arg(_bootloaderBoardID)); _appendStatusLog(tr(" Board ID: %1").arg(_bootloaderBoardID));
_appendStatusLog(QString(" Flash size: %1").arg(_bootloaderBoardFlashSize)); _appendStatusLog(tr(" Flash size: %1").arg(_bootloaderBoardFlashSize));
if (_startFlashWhenBootloaderFound) { if (_startFlashWhenBootloaderFound) {
flash(_startFlashWhenBootloaderFoundFirmwareIdentity); flash(_startFlashWhenBootloaderFoundFirmwareIdentity);
...@@ -518,26 +518,26 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareId) ...@@ -518,26 +518,26 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareIdentifier firmwareId)
QHash<FirmwareIdentifier, QString>* prgFirmware = _firmwareHashForBoardId(_bootloaderBoardID); QHash<FirmwareIdentifier, QString>* prgFirmware = _firmwareHashForBoardId(_bootloaderBoardID);
if (!prgFirmware && firmwareId.firmwareType != CustomFirmware) { if (!prgFirmware && firmwareId.firmwareType != CustomFirmware) {
_errorCancel("Attempting to flash an unknown board type, you must select 'Custom firmware file'"); _errorCancel(tr("Attempting to flash an unknown board type, you must select 'Custom firmware file'"));
return; return;
} }
if (firmwareId.firmwareType == CustomFirmware) { if (firmwareId.firmwareType == CustomFirmware) {
_firmwareFilename = QGCQFileDialog::getOpenFileName(NULL, // Parent to main window _firmwareFilename = QGCQFileDialog::getOpenFileName(NULL, // Parent to main window
"Select Firmware File", // Dialog Caption tr("Select Firmware File"), // Dialog Caption
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), // Initial directory QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), // Initial directory
"Firmware Files (*.px4 *.bin *.ihx)"); // File filter tr("Firmware Files (*.px4 *.bin *.ihx)")); // File filter
} else { } else {
if (prgFirmware->contains(firmwareId)) { if (prgFirmware->contains(firmwareId)) {
_firmwareFilename = prgFirmware->value(firmwareId); _firmwareFilename = prgFirmware->value(firmwareId);
} else { } else {
_errorCancel("Unable to find specified firmware download location"); _errorCancel(tr("Unable to find specified firmware download location"));
return; return;
} }
} }
if (_firmwareFilename.isEmpty()) { if (_firmwareFilename.isEmpty()) {
_errorCancel("No firmware file selected"); _errorCancel(tr("No firmware file selected"));
} else { } else {
_downloadFirmware(); _downloadFirmware();
} }
...@@ -548,8 +548,8 @@ void FirmwareUpgradeController::_downloadFirmware(void) ...@@ -548,8 +548,8 @@ void FirmwareUpgradeController::_downloadFirmware(void)
{ {
Q_ASSERT(!_firmwareFilename.isEmpty()); Q_ASSERT(!_firmwareFilename.isEmpty());
_appendStatusLog("Downloading firmware..."); _appendStatusLog(tr("Downloading firmware..."));
_appendStatusLog(QString(" From: %1").arg(_firmwareFilename)); _appendStatusLog(tr(" From: %1").arg(_firmwareFilename));
QGCFileDownload* downloader = new QGCFileDownload(this); QGCFileDownload* downloader = new QGCFileDownload(this);
connect(downloader, &QGCFileDownload::downloadFinished, this, &FirmwareUpgradeController::_firmwareDownloadFinished); connect(downloader, &QGCFileDownload::downloadFinished, this, &FirmwareUpgradeController::_firmwareDownloadFinished);
...@@ -572,7 +572,7 @@ void FirmwareUpgradeController::_firmwareDownloadFinished(QString remoteFile, QS ...@@ -572,7 +572,7 @@ void FirmwareUpgradeController::_firmwareDownloadFinished(QString remoteFile, QS
{ {
Q_UNUSED(remoteFile); Q_UNUSED(remoteFile);
_appendStatusLog("Download complete"); _appendStatusLog(tr("Download complete"));
FirmwareImage* image = new FirmwareImage(this); FirmwareImage* image = new FirmwareImage(this);
...@@ -580,18 +580,18 @@ void FirmwareUpgradeController::_firmwareDownloadFinished(QString remoteFile, QS ...@@ -580,18 +580,18 @@ void FirmwareUpgradeController::_firmwareDownloadFinished(QString remoteFile, QS
connect(image, &FirmwareImage::errorMessage, this, &FirmwareUpgradeController::_error); connect(image, &FirmwareImage::errorMessage, this, &FirmwareUpgradeController::_error);
if (!image->load(localFile, _bootloaderBoardID)) { if (!image->load(localFile, _bootloaderBoardID)) {
_errorCancel("Image load failed"); _errorCancel(tr("Image load failed"));
return; return;
} }
// We can't proceed unless we have the bootloader // We can't proceed unless we have the bootloader
if (!_bootloaderFound) { if (!_bootloaderFound) {
_errorCancel("Bootloader not found"); _errorCancel(tr("Bootloader not found"));
return; return;
} }
if (_bootloaderBoardFlashSize != 0 && image->imageSize() > _bootloaderBoardFlashSize) { if (_bootloaderBoardFlashSize != 0 && image->imageSize() > _bootloaderBoardFlashSize) {
_errorCancel(QString("Image size of %1 is too large for board flash size %2").arg(image->imageSize()).arg(_bootloaderBoardFlashSize)); _errorCancel(tr("Image size of %1 is too large for board flash size %2").arg(image->imageSize()).arg(_bootloaderBoardFlashSize));
return; return;
} }
...@@ -626,7 +626,7 @@ void FirmwareUpgradeController::_flashComplete(void) ...@@ -626,7 +626,7 @@ void FirmwareUpgradeController::_flashComplete(void)
delete _image; delete _image;
_image = NULL; _image = NULL;
_appendStatusLog("Upgrade complete", true); _appendStatusLog(tr("Upgrade complete"), true);
_appendStatusLog("------------------------------------------", false); _appendStatusLog("------------------------------------------", false);
emit flashComplete(); emit flashComplete();
qgcApp()->toolbox()->linkManager()->setConnectionsAllowed(); qgcApp()->toolbox()->linkManager()->setConnectionsAllowed();
...@@ -684,7 +684,7 @@ void FirmwareUpgradeController::_appendStatusLog(const QString& text, bool criti ...@@ -684,7 +684,7 @@ void FirmwareUpgradeController::_appendStatusLog(const QString& text, bool criti
void FirmwareUpgradeController::_errorCancel(const QString& msg) void FirmwareUpgradeController::_errorCancel(const QString& msg)
{ {
_appendStatusLog(msg, false); _appendStatusLog(msg, false);
_appendStatusLog("Upgrade cancelled", true); _appendStatusLog(tr("Upgrade cancelled"), true);
_appendStatusLog("------------------------------------------", false); _appendStatusLog("------------------------------------------", false);
emit error(); emit error();
cancel(); cancel();
......
...@@ -169,7 +169,7 @@ void JoystickConfigController::nextButtonClicked(void) ...@@ -169,7 +169,7 @@ void JoystickConfigController::nextButtonClicked(void)
if (_currentStep == -1) { if (_currentStep == -1) {
// Need to have enough channels // Need to have enough channels
if (_axisCount < _axisMinimum) { if (_axisCount < _axisMinimum) {
qgcApp()->showMessage(QString("Detected %1 joystick axes. To operate PX4, you need at least %2 axes.").arg(_axisCount).arg(_axisMinimum)); qgcApp()->showMessage(tr("Detected %1 joystick axes. To operate PX4, you need at least %2 axes.").arg(_axisCount).arg(_axisMinimum));
return; return;
} }
_startCalibration(); _startCalibration();
...@@ -595,7 +595,7 @@ void JoystickConfigController::_stopCalibration(void) ...@@ -595,7 +595,7 @@ void JoystickConfigController::_stopCalibration(void)
_statusText->setProperty("text", ""); _statusText->setProperty("text", "");
_nextButton->setProperty("text", "Calibrate"); _nextButton->setProperty("text", tr("Calibrate"));
_nextButton->setEnabled(true); _nextButton->setEnabled(true);
_cancelButton->setEnabled(false); _cancelButton->setEnabled(false);
_skipButton->setEnabled(false); _skipButton->setEnabled(false);
...@@ -619,8 +619,8 @@ void JoystickConfigController::_calSave(void) ...@@ -619,8 +619,8 @@ void JoystickConfigController::_calSave(void)
_calState = calStateSave; _calState = calStateSave;
_statusText->setProperty("text", _statusText->setProperty("text",
"The current calibration settings are now displayed for each axis on screen.\n\n" tr("The current calibration settings are now displayed for each axis on screen.\n\n"
"Click the Next button to upload calibration to board. Click Cancel if you don't want to save these values."); "Click the Next button to upload calibration to board. Click Cancel if you don't want to save these values."));
_nextButton->setEnabled(true); _nextButton->setEnabled(true);
_skipButton->setEnabled(false); _skipButton->setEnabled(false);
......
...@@ -154,14 +154,14 @@ void PX4FirmwareUpgradeThreadWorker::_3drRadioForceBootloader(const QGCSerialPor ...@@ -154,14 +154,14 @@ void PX4FirmwareUpgradeThreadWorker::_3drRadioForceBootloader(const QGCSerialPor
port.setBaudRate(QSerialPort::Baud57600); port.setBaudRate(QSerialPort::Baud57600);
emit status("Putting radio into command mode"); emit status(tr("Putting radio into command mode"));
// Wait a little while for the USB port to initialize. 3DR Radio boot is really slow. // Wait a little while for the USB port to initialize. 3DR Radio boot is really slow.
QGC::SLEEP::msleep(2000); QGC::SLEEP::msleep(2000);
port.open(QIODevice::ReadWrite); port.open(QIODevice::ReadWrite);
if (!port.isOpen()) { if (!port.isOpen()) {
emit error(QString("Unable to open port: %1 error: %2").arg(portInfo.systemLocation()).arg(port.errorString())); emit error(tr("Unable to open port: %1 error: %2").arg(portInfo.systemLocation()).arg(port.errorString()));
return; return;
} }
...@@ -169,25 +169,25 @@ void PX4FirmwareUpgradeThreadWorker::_3drRadioForceBootloader(const QGCSerialPor ...@@ -169,25 +169,25 @@ void PX4FirmwareUpgradeThreadWorker::_3drRadioForceBootloader(const QGCSerialPor
QGC::SLEEP::msleep(2000); QGC::SLEEP::msleep(2000);
port.write("+++", 3); port.write("+++", 3);
if (!port.waitForReadyRead(1500)) { if (!port.waitForReadyRead(1500)) {
emit error("Unable to put radio into command mode"); emit error(tr("Unable to put radio into command mode"));
return; return;
} }
QByteArray bytes = port.readAll(); QByteArray bytes = port.readAll();
if (!bytes.contains("OK")) { if (!bytes.contains("OK")) {
qCDebug(FirmwareUpgradeLog) << bytes; qCDebug(FirmwareUpgradeLog) << bytes;
emit error("Unable to put radio into command mode"); emit error(tr("Unable to put radio into command mode"));
return; return;
} }
emit status("Rebooting radio to bootloader"); emit status(tr("Rebooting radio to bootloader"));
port.write("AT&UPDATE\r\n"); port.write("AT&UPDATE\r\n");
if (!port.waitForBytesWritten(1500)) { if (!port.waitForBytesWritten(1500)) {
emit error("Unable to reboot radio (bytes written)"); emit error(tr("Unable to reboot radio (bytes written)"));
return; return;
} }
if (!port.waitForReadyRead(1500)) { if (!port.waitForReadyRead(1500)) {
emit error("Unable to reboot radio (ready read)"); emit error(tr("Unable to reboot radio (ready read)"));
return; return;
} }
port.close(); port.close();
...@@ -278,7 +278,7 @@ void PX4FirmwareUpgradeThreadWorker::_flash(void) ...@@ -278,7 +278,7 @@ void PX4FirmwareUpgradeThreadWorker::_flash(void)
qCDebug(FirmwareUpgradeLog) << "PX4FirmwareUpgradeThreadWorker::_flash"; qCDebug(FirmwareUpgradeLog) << "PX4FirmwareUpgradeThreadWorker::_flash";
if (_erase()) { if (_erase()) {
emit status("Programming new version..."); emit status(tr("Programming new version..."));
if (_bootloader->program(_bootloaderPort, _controller->image())) { if (_bootloader->program(_bootloaderPort, _controller->image())) {
qCDebug(FirmwareUpgradeLog) << "Program complete"; qCDebug(FirmwareUpgradeLog) << "Program complete";
...@@ -291,11 +291,11 @@ void PX4FirmwareUpgradeThreadWorker::_flash(void) ...@@ -291,11 +291,11 @@ void PX4FirmwareUpgradeThreadWorker::_flash(void)
return; return;
} }
emit status("Verifying program..."); emit status(tr("Verifying program..."));
if (_bootloader->verify(_bootloaderPort, _controller->image())) { if (_bootloader->verify(_bootloaderPort, _controller->image())) {
qCDebug(FirmwareUpgradeLog) << "Verify complete"; qCDebug(FirmwareUpgradeLog) << "Verify complete";
emit status("Verify complete"); emit status(tr("Verify complete"));
} else { } else {
qCDebug(FirmwareUpgradeLog) << "Verify failed:" << _bootloader->errorString(); qCDebug(FirmwareUpgradeLog) << "Verify failed:" << _bootloader->errorString();
emit error(_bootloader->errorString()); emit error(_bootloader->errorString());
...@@ -313,11 +313,11 @@ bool PX4FirmwareUpgradeThreadWorker::_erase(void) ...@@ -313,11 +313,11 @@ bool PX4FirmwareUpgradeThreadWorker::_erase(void)
qCDebug(FirmwareUpgradeLog) << "PX4FirmwareUpgradeThreadWorker::_erase"; qCDebug(FirmwareUpgradeLog) << "PX4FirmwareUpgradeThreadWorker::_erase";
emit eraseStarted(); emit eraseStarted();
emit status("Erasing previous program..."); emit status(tr("Erasing previous program..."));
if (_bootloader->erase(_bootloaderPort)) { if (_bootloader->erase(_bootloaderPort)) {
qCDebug(FirmwareUpgradeLog) << "Erase complete"; qCDebug(FirmwareUpgradeLog) << "Erase complete";
emit status("Erase complete"); emit status(tr("Erase complete"));
emit eraseComplete(); emit eraseComplete();
return true; return true;
} else { } else {
......
...@@ -53,7 +53,7 @@ void CustomCommandWidgetController::_activeVehicleChanged(Vehicle* activeVehicle ...@@ -53,7 +53,7 @@ void CustomCommandWidgetController::_activeVehicleChanged(Vehicle* activeVehicle
void CustomCommandWidgetController::selectQmlFile(void) void CustomCommandWidgetController::selectQmlFile(void)
{ {
QSettings settings; QSettings settings;
QString qmlFile = QGCQFileDialog::getOpenFileName(NULL, "Select custom Qml file", QString(), "Qml files (*.qml)"); QString qmlFile = QGCQFileDialog::getOpenFileName(NULL, tr("Select custom Qml file"), QString(), tr("Qml files (*.qml)"));
if (qmlFile.isEmpty()) { if (qmlFile.isEmpty()) {
_customQmlFile.clear(); _customQmlFile.clear();
settings.remove(_settingsKey); settings.remove(_settingsKey);
......
...@@ -213,7 +213,7 @@ void BluetoothLink::deviceError(QBluetoothSocket::SocketError error) ...@@ -213,7 +213,7 @@ void BluetoothLink::deviceError(QBluetoothSocket::SocketError error)
{ {
_connectState = false; _connectState = false;
qWarning() << "Bluetooth error" << error; qWarning() << "Bluetooth error" << error;
emit communicationError("Bluetooth Link Error", _targetSocket->errorString()); emit communicationError(tr("Bluetooth Link Error"), _targetSocket->errorString());
} }
bool BluetoothLink::isConnected() const bool BluetoothLink::isConnected() const
......
...@@ -284,7 +284,7 @@ SharedLinkInterfacePointer LinkManager::sharedLinkInterfacePointerForLink(LinkIn ...@@ -284,7 +284,7 @@ SharedLinkInterfacePointer LinkManager::sharedLinkInterfacePointerForLink(LinkIn
bool LinkManager::_connectionsSuspendedMsg(void) bool LinkManager::_connectionsSuspendedMsg(void)
{ {
if (_connectionsSuspended) { if (_connectionsSuspended) {
qgcApp()->showMessage(QString("Connect not allowed: %1").arg(_connectionsSuspendedReason)); qgcApp()->showMessage(tr("Connect not allowed: %1").arg(_connectionsSuspendedReason));
return true; return true;
} else { } else {
return false; return false;
...@@ -625,7 +625,7 @@ void LinkManager::_updateAutoConnectLinks(void) ...@@ -625,7 +625,7 @@ void LinkManager::_updateAutoConnectLinks(void)
void LinkManager::shutdown(void) void LinkManager::shutdown(void)
{ {
setConnectionsSuspended("Shutdown"); setConnectionsSuspended(tr("Shutdown"));
disconnectAll(); disconnectAll();
} }
......
...@@ -17,8 +17,6 @@ ...@@ -17,8 +17,6 @@
const char* LogReplayLinkConfiguration::_logFilenameKey = "logFilename"; const char* LogReplayLinkConfiguration::_logFilenameKey = "logFilename";
const char* LogReplayLink::_errorTitle = "Log Replay Error";
LogReplayLinkConfiguration::LogReplayLinkConfiguration(const QString& name) LogReplayLinkConfiguration::LogReplayLinkConfiguration(const QString& name)
: LinkConfiguration(name) : LinkConfiguration(name)
{ {
...@@ -76,6 +74,8 @@ LogReplayLink::LogReplayLink(SharedLinkConfigurationPointer& config) ...@@ -76,6 +74,8 @@ LogReplayLink::LogReplayLink(SharedLinkConfigurationPointer& config)
if (!_logReplayConfig) { if (!_logReplayConfig) {
qWarning() << "Internal error"; qWarning() << "Internal error";
} }
_errorTitle = tr("Log Replay Error");
_readTickTimer.moveToThread(this); _readTickTimer.moveToThread(this);
...@@ -96,7 +96,7 @@ bool LogReplayLink::_connect(void) ...@@ -96,7 +96,7 @@ bool LogReplayLink::_connect(void)
{ {
// Disallow replay when any links are connected // Disallow replay when any links are connected
if (qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()) { if (qgcApp()->toolbox()->multiVehicleManager()->activeVehicle()) {
emit communicationError(_errorTitle, "You must close all connections prior to replaying a log."); emit communicationError(_errorTitle, tr("You must close all connections prior to replaying a log."));
return false; return false;
} }
...@@ -243,13 +243,13 @@ bool LogReplayLink::_loadLogFile(void) ...@@ -243,13 +243,13 @@ bool LogReplayLink::_loadLogFile(void)
int logDurationSecondsTotal; int logDurationSecondsTotal;
if (_logFile.isOpen()) { if (_logFile.isOpen()) {
errorMsg = "Attempt to load new log while log being played"; errorMsg = tr("Attempt to load new log while log being played");
goto Error; goto Error;
} }
_logFile.setFileName(logFilename); _logFile.setFileName(logFilename);
if (!_logFile.open(QFile::ReadOnly)) { if (!_logFile.open(QFile::ReadOnly)) {
errorMsg = QString("Unable to open log file: '%1', error: %2").arg(logFilename).arg(_logFile.errorString()); errorMsg = tr("Unable to open log file: '%1', error: %2").arg(logFilename).arg(_logFile.errorString());
goto Error; goto Error;
} }
logFileInfo.setFile(logFilename); logFileInfo.setFile(logFilename);
...@@ -279,7 +279,7 @@ bool LogReplayLink::_loadLogFile(void) ...@@ -279,7 +279,7 @@ bool LogReplayLink::_loadLogFile(void)
} }
if (endTimeUSecs == startTimeUSecs) { if (endTimeUSecs == startTimeUSecs) {
errorMsg = QString("The log file '%1' is corrupt. No valid timestamps were found at the end of the file.").arg(logFilename); errorMsg = tr("The log file '%1' is corrupt. No valid timestamps were found at the end of the file.").arg(logFilename);
goto Error; goto Error;
} }
...@@ -466,7 +466,7 @@ void LogReplayLink::movePlayhead(int percentComplete) ...@@ -466,7 +466,7 @@ void LogReplayLink::movePlayhead(int percentComplete)
// Now seek to the appropriate position, failing gracefully if we can't. // Now seek to the appropriate position, failing gracefully if we can't.
if (!_logFile.seek(newFilePos)) { if (!_logFile.seek(newFilePos)) {
_replayError("Unable to seek to new position"); _replayError(tr("Unable to seek to new position"));
return; return;
} }
...@@ -486,7 +486,7 @@ void LogReplayLink::movePlayhead(int percentComplete) ...@@ -486,7 +486,7 @@ void LogReplayLink::movePlayhead(int percentComplete)
// And now jump the necessary number of bytes in the proper direction // And now jump the necessary number of bytes in the proper direction
qint64 offset = (newRelativeTimeUSecs - desiredTimeUSecs) * baudRate; qint64 offset = (newRelativeTimeUSecs - desiredTimeUSecs) * baudRate;
if (!_logFile.seek(_logFile.pos() + offset)) { if (!_logFile.seek(_logFile.pos() + offset)) {
_replayError("Unable to seek to new position"); _replayError(tr("Unable to seek to new position"));
return; return;
} }
...@@ -505,7 +505,7 @@ void LogReplayLink::movePlayhead(int percentComplete) ...@@ -505,7 +505,7 @@ void LogReplayLink::movePlayhead(int percentComplete)
// Now seek to the appropriate position, failing gracefully if we can't. // Now seek to the appropriate position, failing gracefully if we can't.
if (!_logFile.seek(newFilePos)) { if (!_logFile.seek(newFilePos)) {
_replayError("Unable to seek to new position"); _replayError(tr("Unable to seek to new position"));
return; return;
} }
......
...@@ -133,7 +133,7 @@ private: ...@@ -133,7 +133,7 @@ private:
int _mavlinkChannel; int _mavlinkChannel;
QTimer _readTickTimer; ///< Timer which signals a read of next log record QTimer _readTickTimer; ///< Timer which signals a read of next log record
static const char* _errorTitle; ///< Title for communicatorError signals QString _errorTitle; ///< Title for communicatorError signals
quint64 _logCurrentTimeUSecs; ///< The timestamp of the next message in the log file. quint64 _logCurrentTimeUSecs; ///< The timestamp of the next message in the log file.
quint64 _logStartTimeUSecs; ///< The first timestamp in the current log file. quint64 _logStartTimeUSecs; ///< The first timestamp in the current log file.
......
...@@ -142,7 +142,7 @@ bool SerialLink::_connect(void) ...@@ -142,7 +142,7 @@ bool SerialLink::_connect(void)
} }
} }
_emitLinkError(QString("Error connecting: Could not create port. %1").arg(errorString)); _emitLinkError(tr("Error connecting: Could not create port. %1").arg(errorString));
return false; return false;
} }
return true; return true;
...@@ -212,7 +212,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString& ...@@ -212,7 +212,7 @@ bool SerialLink::_hardwareConnect(QSerialPort::SerialPortError& error, QString&
qDebug() << "open failed" << _port->errorString() << _port->error() << getName() << qgcApp()->toolbox()->linkManager()->isAutoconnectLink(this); qDebug() << "open failed" << _port->errorString() << _port->error() << getName() << qgcApp()->toolbox()->linkManager()->isAutoconnectLink(this);
error = _port->error(); error = _port->error();
errorString = _port->errorString(); errorString = _port->errorString();
emit communicationUpdate(getName(),"Error opening port: " + _port->errorString()); emit communicationUpdate(getName(), tr("Error opening port: %1").arg(_port->errorString()));
_port->close(); _port->close();
delete _port; delete _port;
_port = NULL; _port = NULL;
......
...@@ -160,7 +160,7 @@ bool TCPLink::_hardwareConnect() ...@@ -160,7 +160,7 @@ bool TCPLink::_hardwareConnect()
// Whether a failed connection emits an error signal or not is platform specific. // Whether a failed connection emits an error signal or not is platform specific.
// So in cases where it is not emitted, we emit one ourselves. // So in cases where it is not emitted, we emit one ourselves.
if (errorSpy.count() == 0) { if (errorSpy.count() == 0) {
emit communicationError(tr("Link Error"), QString("Error on link %1. Connection failed").arg(getName())); emit communicationError(tr("Link Error"), tr("Error on link %1. Connection failed").arg(getName()));
} }
delete _socket; delete _socket;
_socket = NULL; _socket = NULL;
...@@ -174,7 +174,7 @@ bool TCPLink::_hardwareConnect() ...@@ -174,7 +174,7 @@ bool TCPLink::_hardwareConnect()
void TCPLink::_socketError(QAbstractSocket::SocketError socketError) void TCPLink::_socketError(QAbstractSocket::SocketError socketError)
{ {
Q_UNUSED(socketError); Q_UNUSED(socketError);
emit communicationError(tr("Link Error"), QString("Error on link %1. Error on socket: %2.").arg(getName()).arg(_socket->errorString())); emit communicationError(tr("Link Error"), tr("Error on link %1. Error on socket: %2.").arg(getName()).arg(_socket->errorString()));
} }
/** /**
......
...@@ -307,7 +307,7 @@ void UDPLink::_registerZeroconf(uint16_t port, const std::string &regType) ...@@ -307,7 +307,7 @@ void UDPLink::_registerZeroconf(uint16_t port, const std::string &regType)
NULL); NULL);
if (result != kDNSServiceErr_NoError) if (result != kDNSServiceErr_NoError)
{ {
emit communicationError("UDP Link Error", "Error registering Zeroconf"); emit communicationError(tr("UDP Link Error"), tr("Error registering Zeroconf"));
_dnssServiceRef = NULL; _dnssServiceRef = NULL;
} }
#else #else
......
...@@ -53,7 +53,7 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(const QString& title, QAction* action, ...@@ -53,7 +53,7 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(const QString& title, QAction* action,
void QGCMAVLinkInspector::_vehicleAdded(Vehicle* vehicle) void QGCMAVLinkInspector::_vehicleAdded(Vehicle* vehicle)
{ {
ui->systemComboBox->addItem(QString("Vehicle %1").arg(vehicle->id()), vehicle->id()); ui->systemComboBox->addItem(tr("Vehicle %1").arg(vehicle->id()), vehicle->id());
// Add a tree for a new UAS // Add a tree for a new UAS
addUAStoTree(vehicle->id()); addUAStoTree(vehicle->id());
......
...@@ -55,7 +55,7 @@ void QGCUASFileView::_downloadFile(void) ...@@ -55,7 +55,7 @@ void QGCUASFileView::_downloadFile(void)
_ui.statusText->clear(); _ui.statusText->clear();
QString downloadToHere = QGCQFileDialog::getExistingDirectory(this, QString downloadToHere = QGCQFileDialog::getExistingDirectory(this,
"Download Directory", tr("Download Directory"),
QDir::homePath(), QDir::homePath(),
QGCQFileDialog::ShowDirsOnly | QGCQFileDialog::DontResolveSymlinks); QGCQFileDialog::ShowDirsOnly | QGCQFileDialog::DontResolveSymlinks);
...@@ -81,7 +81,7 @@ void QGCUASFileView::_downloadFile(void) ...@@ -81,7 +81,7 @@ void QGCUASFileView::_downloadFile(void)
_setAllButtonsEnabled(false); _setAllButtonsEnabled(false);
_currentCommand = commandDownload; _currentCommand = commandDownload;
_ui.statusText->setText(QString("Downloading: %1").arg(downloadFilename)); _ui.statusText->setText(tr("Downloading: %1").arg(downloadFilename));
_manager->streamPath(path, QDir(downloadToHere)); _manager->streamPath(path, QDir(downloadToHere));
} }
...@@ -111,9 +111,9 @@ void QGCUASFileView::_uploadFile(void) ...@@ -111,9 +111,9 @@ void QGCUASFileView::_uploadFile(void)
item = item->parent(); item = item->parent();
} while (item); } while (item);
QString uploadFromHere = QGCQFileDialog::getOpenFileName(this, "Upload File", QDir::homePath()); QString uploadFromHere = QGCQFileDialog::getOpenFileName(this, tr("Upload File"), QDir::homePath());
_ui.statusText->setText(QString("Uploading: %1").arg(uploadFromHere)); _ui.statusText->setText(tr("Uploading: %1").arg(uploadFromHere));
qDebug() << "Upload: " << uploadFromHere << "to path" << path; qDebug() << "Upload: " << uploadFromHere << "to path" << path;
...@@ -136,7 +136,7 @@ void QGCUASFileView::_commandError(const QString& msg) ...@@ -136,7 +136,7 @@ void QGCUASFileView::_commandError(const QString& msg)
{ {
_setAllButtonsEnabled(true); _setAllButtonsEnabled(true);
_currentCommand = commandNone; _currentCommand = commandNone;
_ui.statusText->setText(QString("Error: %1").arg(msg)); _ui.statusText->setText(tr("Error: %1").arg(msg));
} }
/// @brief Refreshes the directory list tree. /// @brief Refreshes the directory list tree.
......
...@@ -246,21 +246,21 @@ void LinechartWidget::createLayout() ...@@ -246,21 +246,21 @@ void LinechartWidget::createLayout()
hlayout->addStretch(); hlayout->addStretch();
QLabel *timeScaleLabel = new QLabel("Time axis:"); QLabel *timeScaleLabel = new QLabel(tr("Time axis:"));
hlayout->addWidget(timeScaleLabel); hlayout->addWidget(timeScaleLabel);
timeScaleCmb = new QComboBox(this); timeScaleCmb = new QComboBox(this);
timeScaleCmb->addItem("10 seconds", 10); timeScaleCmb->addItem(tr("10 seconds"), 10);
timeScaleCmb->addItem("20 seconds", 20); timeScaleCmb->addItem(tr("20 seconds"), 20);
timeScaleCmb->addItem("30 seconds", 30); timeScaleCmb->addItem(tr("30 seconds"), 30);
timeScaleCmb->addItem("40 seconds", 40); timeScaleCmb->addItem(tr("40 seconds"), 40);
timeScaleCmb->addItem("50 seconds", 50); timeScaleCmb->addItem(tr("50 seconds"), 50);
timeScaleCmb->addItem("1 minute", 60); timeScaleCmb->addItem(tr("1 minute"), 60);
timeScaleCmb->addItem("2 minutes", 60*2); timeScaleCmb->addItem(tr("2 minutes"), 60*2);
timeScaleCmb->addItem("3 minutes", 60*3); timeScaleCmb->addItem(tr("3 minutes"), 60*3);
timeScaleCmb->addItem("4 minutes", 60*4); timeScaleCmb->addItem(tr("4 minutes"), 60*4);
timeScaleCmb->addItem("5 minutes", 60*5); timeScaleCmb->addItem(tr("5 minutes"), 60*5);
timeScaleCmb->addItem("10 minutes", 60*10); timeScaleCmb->addItem(tr("10 minutes"), 60*10);
//timeScaleCmb->setSizeAdjustPolicy(QComboBox::AdjustToContents); //timeScaleCmb->setSizeAdjustPolicy(QComboBox::AdjustToContents);
timeScaleCmb->setMinimumContentsLength(12); timeScaleCmb->setMinimumContentsLength(12);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment