diff --git a/ground/gcs/src/app/main.cpp b/ground/gcs/src/app/main.cpp index c8260c953..d6a44f2e6 100644 --- a/ground/gcs/src/app/main.cpp +++ b/ground/gcs/src/app/main.cpp @@ -209,6 +209,11 @@ inline QString msgSendArgumentFailed() "Unable to send command line arguments to the already running instance. It appears to be not responding."); } +inline QString msgLogfileOpenFailed(const QString &fileName) +{ + return QCoreApplication::translate("Application", "Failed to open log file %1").arg(fileName); +} + // Prepare a remote argument: If it is a relative file, add the current directory // since the the central instance might be running in a different directory. inline QString prepareRemoteArgument(const QString &arg) @@ -313,7 +318,7 @@ void logInit(QString fileName) logStream = new QTextStream(file); qInstallMessageHandler(mainMessageOutput); } else { - // TODO error popup + displayError(msgLogfileOpenFailed(fileName)); } } @@ -426,16 +431,19 @@ void loadTranslators(QString language, QTranslator &translator, QTranslator &qtT const QString &creatorTrPath = Utils::GetDataPath() + QLatin1String("translations"); if (translator.load(QLatin1String("gcs_") + language, creatorTrPath)) { + // Install gcs_xx.qm translation file + QCoreApplication::installTranslator(&translator); + const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath); const QString &qtTrFile = QLatin1String("qt_") + language; // Binary installer puts Qt tr files into creatorTrPath if (qtTranslator.load(qtTrFile, qtTrPath) || qtTranslator.load(qtTrFile, creatorTrPath)) { - QCoreApplication::installTranslator(&translator); + // Install main qt_xx.qm translation file QCoreApplication::installTranslator(&qtTranslator); - } else { - // unload() - translator.load(QString()); } + } else { + // unload(), no gcs translation found + translator.load(QString()); } } } // namespace anonymous diff --git a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp index 7fd06a786..5c5f2ecdd 100644 --- a/ground/gcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/gcs/src/plugins/config/configstabilizationwidget.cpp @@ -289,7 +289,7 @@ void ConfigStabilizationWidget::updateThrottleCurveFromObject() field = stabBank->getField("EnableThrustPIDScaling"); Q_ASSERT(field); - bool enabled = field->getValue() == "TRUE"; + bool enabled = field->getValue() == "True"; ui->enableThrustPIDScalingCheckBox->setChecked(enabled); ui->thrustPIDScalingCurve->setEnabled(enabled); setDirty(dirty); @@ -311,7 +311,7 @@ void ConfigStabilizationWidget::updateObjectFromThrottleCurve() field = stabBank->getField("EnableThrustPIDScaling"); Q_ASSERT(field); - field->setValue(ui->enableThrustPIDScalingCheckBox->isChecked() ? "TRUE" : "FALSE"); + field->setValue(ui->enableThrustPIDScalingCheckBox->isChecked() ? "True" : "False"); } void ConfigStabilizationWidget::setupExpoPlot() @@ -385,7 +385,7 @@ void ConfigStabilizationWidget::resetThrottleCurveToDefault() field = defaultStabBank->getField("EnableThrustPIDScaling"); Q_ASSERT(field); - bool enabled = field->getValue() == "TRUE"; + bool enabled = field->getValue() == "True"; ui->enableThrustPIDScalingCheckBox->setChecked(enabled); ui->thrustPIDScalingCurve->setEnabled(enabled); diff --git a/ground/gcs/src/plugins/coreplugin/core.qrc b/ground/gcs/src/plugins/coreplugin/core.qrc index 35744c4dc..0a7e4c4a4 100644 --- a/ground/gcs/src/plugins/coreplugin/core.qrc +++ b/ground/gcs/src/plugins/coreplugin/core.qrc @@ -64,6 +64,5 @@ qml/images/tab.png qml/AboutDialog.qml ../../../../../build/gcs-synthetics/AuthorsModel.qml - images/opie_90x120.gif diff --git a/ground/gcs/src/plugins/coreplugin/images/opie_90x120.gif b/ground/gcs/src/plugins/coreplugin/images/opie_90x120.gif deleted file mode 100644 index 417e4c032..000000000 Binary files a/ground/gcs/src/plugins/coreplugin/images/opie_90x120.gif and /dev/null differ diff --git a/ground/gcs/src/plugins/coreplugin/qml/AboutDialog.qml b/ground/gcs/src/plugins/coreplugin/qml/AboutDialog.qml index 96505f789..495729b82 100644 --- a/ground/gcs/src/plugins/coreplugin/qml/AboutDialog.qml +++ b/ground/gcs/src/plugins/coreplugin/qml/AboutDialog.qml @@ -57,17 +57,6 @@ Rectangle { } } } - AnimatedImage { - id: opie - anchors.left: parent.left - anchors.leftMargin: 10 - anchors.top: logo.bottom - anchors.topMargin: 10 - source: "../images/opie_90x120.gif" - z: 100 - fillMode: Image.PreserveAspectFit - visible: false - } Rectangle { anchors.left: logo.right @@ -87,15 +76,6 @@ Rectangle { Layout.fillWidth: true font.pixelSize: 14 font.bold: true - MouseArea { - id: easter_egg - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: { - opie.visible = !opie.visible - } - } } Text { id: versionLabel diff --git a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 29393684c..566ab24fd 100644 --- a/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/gcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -770,30 +770,30 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch case VehicleConfigurationSource::MULTI_ROTOR_HEXA: case VehicleConfigurationSource::MULTI_ROTOR_HEXA_H: case VehicleConfigurationSource::MULTI_ROTOR_HEXA_X: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); break; case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X: - mSettings->setMixerValueRoll(50); - mSettings->setMixerValuePitch(50); - mSettings->setMixerValueYaw(50); + mSettings->setMixerValueRoll((qint8) 50); + mSettings->setMixerValuePitch((qint8) 50); + mSettings->setMixerValueYaw((qint8) 50); break; case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(50); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 50); break; case VehicleConfigurationSource::MULTI_ROTOR_HEXA_COAX_Y: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(50); - mSettings->setMixerValueYaw(66); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 50); + mSettings->setMixerValueYaw((qint8) 66); break; case VehicleConfigurationSource::MULTI_ROTOR_OCTO: case VehicleConfigurationSource::MULTI_ROTOR_OCTO_X: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); break; case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X: case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS: @@ -805,9 +805,9 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch break; } case VehicleConfigurationSource::VEHICLE_FIXEDWING: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); maxThrottle = 1; break; case VehicleConfigurationSource::VEHICLE_HELI: @@ -816,22 +816,22 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch { switch (m_configSource->getVehicleSubType()) { case VehicleConfigurationSource::GROUNDVEHICLE_MOTORCYCLE: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); maxThrottle = 1; break; case VehicleConfigurationSource::GROUNDVEHICLE_CAR: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); maxThrottle = 1; minThrottle = 0; break; case VehicleConfigurationSource::GROUNDVEHICLE_DIFFERENTIAL: - mSettings->setMixerValueRoll(100); - mSettings->setMixerValuePitch(100); - mSettings->setMixerValueYaw(100); + mSettings->setMixerValueRoll((qint8) 100); + mSettings->setMixerValuePitch((qint8) 100); + mSettings->setMixerValueYaw((qint8) 100); maxThrottle = 0.8; minThrottle = 0; break; diff --git a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp index 57ca3968c..312789479 100644 --- a/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp +++ b/ground/gcs/src/plugins/uavobjectwidgetutils/configtaskwidget.cpp @@ -912,7 +912,7 @@ QVariant ConfigTaskWidget::getVariantFromWidget(QWidget *widget, WidgetBinding * } else if (QSlider * cb = qobject_cast(widget)) { return (double)(cb->value() * scale); } else if (QCheckBox * cb = qobject_cast(widget)) { - return (QString)(cb->isChecked() ? "TRUE" : "FALSE"); + return (QString)(cb->isChecked() ? "True" : "False"); } else if (QLineEdit * cb = qobject_cast(widget)) { QString value = (QString)cb->displayText(); if (binding->units() == "hex") { @@ -955,7 +955,7 @@ bool ConfigTaskWidget::setWidgetFromVariant(QWidget *widget, QVariant value, Wid cb->setValue((int)qRound(value.toDouble() / scale)); return true; } else if (QCheckBox * cb = qobject_cast(widget)) { - bool bvalue = value.toString() == "TRUE"; + bool bvalue = value.toString() == "True"; cb->setChecked(bvalue); return true; } else if (QLineEdit * cb = qobject_cast(widget)) { diff --git a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp index 2ff76a829..fd3933144 100644 --- a/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp +++ b/ground/uavobjgenerator/generators/gcs/uavobjectgeneratorgcs.cpp @@ -614,7 +614,7 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *object) ctxt.object = object; ctxt.registerImpl += ::generate(ctxt, - " qmlRegisterType<:ClassName>(\"%1.:ClassName\", 1, 0, \":ClassName\");\n").arg("UAVTalk"); + " qmlRegisterType<:ClassName>(\"%1.:ClassName\", 1, 0, \":ClassName\");\n").arg("UAVTalk"); for (int n = 0; n < object->fields.length(); ++n) { FieldInfo *field = object->fields[n]; @@ -630,12 +630,18 @@ bool UAVObjectGeneratorGCS::process_object(ObjectInfo *object) fieldCtxt.ucPropName = toPropertyName(field->name); fieldCtxt.propName = toLowerCamelCase(fieldCtxt.ucPropName); fieldCtxt.propType = fieldCtxt.fieldType; - fieldCtxt.propRefType = fieldCtxt.fieldType; - if (field->type == FIELDTYPE_ENUM) { + if (field->type == FIELDTYPE_INT8) { + fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_INT16); + } + else if (field->type == FIELDTYPE_UINT8) { + fieldCtxt.propType = fieldTypeStrCPP(FIELDTYPE_UINT16); + } + else if (field->type == FIELDTYPE_ENUM) { QString enumClassName = object->name + "_" + fieldCtxt.ucPropName; fieldCtxt.propType = enumClassName + "::Enum"; - fieldCtxt.propRefType = fieldCtxt.propType; } + // reference type + fieldCtxt.propRefType = fieldCtxt.propType; // deprecation fieldCtxt.hasDeprecatedProperty = (fieldCtxt.fieldName != fieldCtxt.propName) && DEPRECATED;