diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc index 87c2c2068ce45023d269e7932cdd4d4f6eddbfc5..9b5fa09712e57d57d67186a0aeeb48186c314545 100644 --- a/src/QGCApplication.cc +++ b/src/QGCApplication.cc @@ -160,6 +160,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) , _runningUnitTests(unitTesting) , _styleIsDark(true) , _pMavManager(NULL) + , _fakeMobile(false) { Q_ASSERT(_app == NULL); _app = this; @@ -177,6 +178,7 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting) CmdLineOpt_t rgCmdLineOptions[] = { { "--clear-settings", &fClearSettingsOptions, QString() }, { "--full-logging", &fullLogging, QString() }, + { "--fake-mobile", &_fakeMobile, QString() }, // Add additional command line option flags here }; diff --git a/src/QGCApplication.h b/src/QGCApplication.h index eabafd4d9ada246362278283be2d7aa9b182a6fd..ae66e7d87cb32cd777373f91bcd30adc0c2178a7 100644 --- a/src/QGCApplication.h +++ b/src/QGCApplication.h @@ -109,6 +109,9 @@ public: /// Show a non-modal message to the user void showToolBarMessage(const QString& message); + + /// @return true: Fake ui into showing mobile interface + bool fakeMobile(void) { return _fakeMobile; } public slots: /// You can connect to this slot to show an information message box from a different thread. @@ -178,6 +181,8 @@ private: QStringList _missingParams; ///< List of missing facts to be displayed MavManager* _pMavManager; + bool _fakeMobile; ///< true: Fake ui into displaying mobile interface + /// Unit Test have access to creating and destroying singletons friend class UnitTest; }; diff --git a/src/QmlControls/ScreenToolsController.h b/src/QmlControls/ScreenToolsController.h index 3647808d0fed98957fa3330b91fa9430e84112ff..aada76ff268cb5a98000dec06ddb0f31247c3455 100644 --- a/src/QmlControls/ScreenToolsController.h +++ b/src/QmlControls/ScreenToolsController.h @@ -110,7 +110,7 @@ public: #else bool isAndroid () { return false; } bool isiOS () { return false; } - bool isMobile () { return false; } + bool isMobile () { return qgcApp()->fakeMobile(); } #endif signals: