From 118dde2fa1e5b53bc9f68bc91785677ba69c6ac1 Mon Sep 17 00:00:00 2001 From: lm Date: Mon, 10 Jan 2011 08:27:17 +0100 Subject: [PATCH] Added application version check --- src/Core.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Core.cc b/src/Core.cc index 9dcc7ba8d..bc0e3aaae 100644 --- a/src/Core.cc +++ b/src/Core.cc @@ -80,14 +80,20 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) // clear them if they mismatch // QGC then falls back to default QSettings settings; + + // Show user an upgrade message if QGC got upgraded + bool upgraded = false; + QString lastApplicationVersion(""); if (settings.contains("QGC_APPLICATION_VERSION")) { QString qgcVersion = settings.value("QGC_APPLICATION_VERSION").toString(); if (qgcVersion != QGC_APPLICATION_VERSION) { + lastApplicationVersion = qgcVersion; settings.clear(); // Write current application version settings.setValue("QGC_APPLICATION_VERSION", QGC_APPLICATION_VERSION); + upgraded = true; } } else @@ -156,9 +162,12 @@ Core::Core(int &argc, char* argv[]) : QApplication(argc, argv) //mainWindow->addLink(simulationLink); mainWindow = MainWindow::instance(); - // Remove splash screen + + // Remove splash screen splashScreen->finish(mainWindow); + if (upgraded) mainWindow->showInfoMessage(tr("Default Settings Loaded"), tr("QGroundControl has been upgraded from version %1 to version %2. Some of your user preferences have been reset to defaults for safety reasons. Please adjust them where needed.").arg(lastApplicationVersion).arg(QGC_APPLICATION_VERSION)); + // Check if link could be connected if (!udpLink->connect()) { -- 2.22.0