From 29091cf8b35e86d782beca33ad6c0f9a540ad798 Mon Sep 17 00:00:00 2001
From: Don Gagne <don@thegagnes.com>
Date: Sun, 23 Aug 2015 20:53:03 -0700
Subject: [PATCH] --fake-mobile command line support

---
 src/QGCApplication.cc                   | 2 ++
 src/QGCApplication.h                    | 5 +++++
 src/QmlControls/ScreenToolsController.h | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc
index 87c2c20..9b5fa09 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 eabafd4..ae66e7d 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 3647808..aada76f 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: