diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h index 69180218490dda7bbdcb5a6de89eadafc3d14f48..0065962f1934521a4ee95aeb1b679ab2944c3295 100644 --- a/src/QmlControls/QGroundControlQmlGlobal.h +++ b/src/QmlControls/QGroundControlQmlGlobal.h @@ -111,6 +111,8 @@ public: Q_PROPERTY(QString appSettingsDistanceUnitsString READ appSettingsDistanceUnitsString CONSTANT) Q_PROPERTY(QString appSettingsAreaUnitsString READ appSettingsAreaUnitsString CONSTANT) + Q_PROPERTY(QString qgcVersion READ qgcVersion CONSTANT) + Q_INVOKABLE void saveGlobalSetting (const QString& key, const QString& value); Q_INVOKABLE QString loadGlobalSetting (const QString& key, const QString& defaultValue); Q_INVOKABLE void saveBoolGlobalSetting (const QString& key, bool value); @@ -209,6 +211,8 @@ public: QString missionFileExtension(void) const { return QGCApplication::missionFileExtension; } QString telemetryFileExtension(void) const { return QGCApplication::telemetryFileExtension; } + QString qgcVersion(void) const { return qgcApp()->applicationVersion(); } + // Overrides from QGCTool virtual void setToolbox(QGCToolbox* toolbox); diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 4435feddbe9ed20dd7f5ada60604920ec3f532e7..6cd378e1ffeffb050be3ef7b87325019246a8e49 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -452,28 +452,7 @@ void MainWindow::storeSettings() void MainWindow::configureWindowName() { - QList hostAddresses = QNetworkInterface::allAddresses(); - QString windowname = qApp->applicationName() + " " + qApp->applicationVersion(); - - // XXX we do have UDP MAVLink heartbeat broadcast now in SITL and will have it on the - // WIFI radio, so people should not be in need any more of knowing their IP. - // this can go once we are certain its not needed any more. - #if 0 - bool prevAddr = false; - windowname.append(" (" + QHostInfo::localHostName() + ": "); - for (int i = 0; i < hostAddresses.size(); i++) - { - // Exclude loopback IPv4 and all IPv6 addresses - if (hostAddresses.at(i) != QHostAddress("127.0.0.1") && !hostAddresses.at(i).toString().contains(":")) - { - if(prevAddr) windowname.append("/"); - windowname.append(hostAddresses.at(i).toString()); - prevAddr = true; - } - } - windowname.append(")"); - #endif - setWindowTitle(windowname); + setWindowTitle(qApp->applicationName() + " " + qApp->applicationVersion()); } /** diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml index d3d85307e725597da9f0cfecb88c8ca80b22610e..324c5af6a45138e214a8d3cf4b18f031ffe8eeaa 100644 --- a/src/ui/preferences/GeneralSettings.qml +++ b/src/ui/preferences/GeneralSettings.qml @@ -575,6 +575,11 @@ QGCView { } } } + + QGCLabel { + anchors.horizontalCenter: parent.horizontalCenter + text: qsTr("QGroundControl Version: " + QGroundControl.qgcVersion) + } } // settingsColumn } // QGCFlickable } // QGCViewPanel