Commit 269aa3bf authored by DoinLakeFlyer's avatar DoinLakeFlyer

parent 9fdc8528
...@@ -139,6 +139,13 @@ MobileBuild { ...@@ -139,6 +139,13 @@ MobileBuild {
DEFINES += __mobile__ DEFINES += __mobile__
} }
StableBuild {
message("Stable Build")
} else {
message("Daily Build")
DEFINES += DAILY_BUILD
}
# set the QGC version from git # set the QGC version from git
exists ($$PWD/.git) { exists ($$PWD/.git) {
......
...@@ -249,13 +249,21 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -249,13 +249,21 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
connect(&_missingParamsDelayedDisplayTimer, &QTimer::timeout, this, &QGCApplication::_missingParamsDisplay); connect(&_missingParamsDelayedDisplayTimer, &QTimer::timeout, this, &QGCApplication::_missingParamsDisplay);
// Set application information // Set application information
QString applicationName;
if (_runningUnitTests) { if (_runningUnitTests) {
// We don't want unit tests to use the same QSettings space as the normal app. So we tweak the app // We don't want unit tests to use the same QSettings space as the normal app. So we tweak the app
// name. Also we want to run unit tests with clean settings every time. // name. Also we want to run unit tests with clean settings every time.
setApplicationName(QString("%1_unittest").arg(QGC_APPLICATION_NAME)); applicationName = QStringLiteral("%1_unittest").arg(QGC_APPLICATION_NAME);
} else { } else {
setApplicationName(QGC_APPLICATION_NAME); #ifdef DAILY_BUILD
// This gives daily builds their own separate settings space. Allowing you to use daily and stable builds
// side by side without daily screwing up your stable settings.
applicationName = QStringLiteral("%1 Daily").arg(QGC_APPLICATION_NAME);
#else
applicationName = QGC_APPLICATION_NAME;
#endif
} }
setApplicationName(applicationName);
setOrganizationName(QGC_ORG_NAME); setOrganizationName(QGC_ORG_NAME);
setOrganizationDomain(QGC_ORG_DOMAIN); setOrganizationDomain(QGC_ORG_DOMAIN);
...@@ -295,10 +303,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) ...@@ -295,10 +303,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
settings.clear(); settings.clear();
_settingsUpgraded = true; _settingsUpgraded = true;
} }
} else if (settings.allKeys().count()) {
// Settings version key is missing and there are settings. This is an upgrade scenario.
settings.clear();
_settingsUpgraded = true;
} }
} }
settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION); settings.setValue(_settingsVersionKey, QGC_SETTINGS_VERSION);
...@@ -740,13 +744,13 @@ void QGCApplication::_missingParamsDisplay(void) ...@@ -740,13 +744,13 @@ void QGCApplication::_missingParamsDisplay(void)
} }
_missingParams.clear(); _missingParams.clear();
showAppMessage(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)); showAppMessage(tr("Parameters are missing from firmware. You may be running a version of firmware which is not fully supported or your firmware has a bug in it. Missing params: %1").arg(params));
} }
} }
QObject* QGCApplication::_rootQmlObject() QObject* QGCApplication::_rootQmlObject()
{ {
if(_qmlAppEngine && _qmlAppEngine->rootObjects().size()) if (_qmlAppEngine && _qmlAppEngine->rootObjects().size())
return _qmlAppEngine->rootObjects()[0]; return _qmlAppEngine->rootObjects()[0];
return nullptr; return nullptr;
} }
...@@ -778,12 +782,26 @@ void QGCApplication::showAppMessage(const QString& message, const QString& title ...@@ -778,12 +782,26 @@ void QGCApplication::showAppMessage(const QString& message, const QString& title
if (rootQmlObject) { if (rootQmlObject) {
QVariant varReturn; QVariant varReturn;
QVariant varMessage = QVariant::fromValue(message); QVariant varMessage = QVariant::fromValue(message);
QMetaObject::invokeMethod(_rootQmlObject(), "showMessageDialog", Q_RETURN_ARG(QVariant, varReturn), Q_ARG(QVariant, dialogTitle) /* No title */, Q_ARG(QVariant, varMessage)); QMetaObject::invokeMethod(_rootQmlObject(), "showMessageDialog", Q_RETURN_ARG(QVariant, varReturn), Q_ARG(QVariant, dialogTitle), Q_ARG(QVariant, varMessage));
} else if (runningUnitTests()) { } else if (runningUnitTests()) {
// Unit tests can run without UI // Unit tests can run without UI
qDebug() << "QGCApplication::showAppMessage unittest" << message << dialogTitle; qDebug() << "QGCApplication::showAppMessage unittest" << message << dialogTitle;
} else { } else {
qWarning() << "Internal error"; // UI isn't ready yet
_delayedAppMessages.append(QPair<QString, QString>(dialogTitle, message));
QTimer::singleShot(200, this, &QGCApplication::_showDelayedAppMessages);
}
}
void QGCApplication::_showDelayedAppMessages(void)
{
if (_rootQmlObject()) {
for (const QPair<QString, QString>& appMsg: _delayedAppMessages) {
showAppMessage(appMsg.second, appMsg.first);
}
_delayedAppMessages.clear();
} else {
QTimer::singleShot(200, this, &QGCApplication::_showDelayedAppMessages);
} }
} }
......
...@@ -156,14 +156,15 @@ public: ...@@ -156,14 +156,15 @@ public:
bool _checkTelemetrySavePath(bool useMessageBox); bool _checkTelemetrySavePath(bool useMessageBox);
private slots: private slots:
void _missingParamsDisplay(void); void _missingParamsDisplay (void);
void _currentVersionDownloadFinished(QString remoteFile, QString localFile); void _currentVersionDownloadFinished(QString remoteFile, QString localFile);
void _currentVersionDownloadError(QString errorMsg); void _currentVersionDownloadError (QString errorMsg);
bool _parseVersionText(const QString& versionString, int& majorVersion, int& minorVersion, int& buildVersion); bool _parseVersionText (const QString& versionString, int& majorVersion, int& minorVersion, int& buildVersion);
void _onGPSConnect(); void _onGPSConnect (void);
void _onGPSDisconnect(); void _onGPSDisconnect (void);
void _gpsSurveyInStatus(float duration, float accuracyMM, double latitude, double longitude, float altitude, bool valid, bool active); void _gpsSurveyInStatus (float duration, float accuracyMM, double latitude, double longitude, float altitude, bool valid, bool active);
void _gpsNumSatellites(int numSatellites); void _gpsNumSatellites (int numSatellites);
void _showDelayedAppMessages (void);
private: private:
QObject* _rootQmlObject (); QObject* _rootQmlObject ();
...@@ -194,6 +195,8 @@ private: ...@@ -194,6 +195,8 @@ private:
bool _error = false; bool _error = false;
QElapsedTimer _msecsElapsedTime; QElapsedTimer _msecsElapsedTime;
QList<QPair<QString /* title */, QString /* message */>> _delayedAppMessages;
static const char* _settingsVersionKey; ///< Settings key which hold settings version static const char* _settingsVersionKey; ///< Settings key which hold settings version
static const char* _deleteAllSettingsKey; ///< If this settings key is set on boot, all settings will be deleted static const char* _deleteAllSettingsKey; ///< If this settings key is set on boot, all settings will be deleted
......
...@@ -176,7 +176,7 @@ void InstrumentValueArea::_checkForDeprecatedSettings(void) ...@@ -176,7 +176,7 @@ void InstrumentValueArea::_checkForDeprecatedSettings(void)
if (settings.childGroups().contains(_deprecatedGroupKey)) { if (settings.childGroups().contains(_deprecatedGroupKey)) {
settings.remove(_deprecatedGroupKey); settings.remove(_deprecatedGroupKey);
qgcApp()->showAppMessage(tr("Instrument Values"), tr("The support for custom instrument values display has changed. Because of this the display will be reset to the new default setup. You will need to modify it again to suit your needs.")); qgcApp()->showAppMessage(tr("The support for custom instrument value display has changed. The display will be reset to the new default setup. You will need to modify it again to suit your needs."), tr("Instrument Values"));
} }
} }
......
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