Commit 8343b39a authored by Gus Grubba's avatar Gus Grubba

Allow custom plugins to define the use of mobile file dialog regardless of the actual platform.

parent a88e1c45
......@@ -25,7 +25,7 @@ Item {
property bool _openForLoad: true
property real _margins: ScreenTools.defaultFontPixelHeight / 2
property bool _mobile: ScreenTools.isMobile
property bool _mobileDlg: QGroundControl.corePlugin.options.useMobileFileDialog
property var _rgExtensions
Component.onCompleted: {
......@@ -39,7 +39,7 @@ Item {
function openForLoad() {
_openForLoad = true
if (_mobile && folder.length !== 0) {
if (_mobileDlg && folder.length !== 0) {
qgcView.showDialog(mobileFileOpenDialog, title, qgcView.showDialogDefaultWidth, StandardButton.Cancel)
} else {
fullFileDialog.open()
......@@ -48,7 +48,7 @@ Item {
function openForSave() {
_openForLoad = false
if (_mobile && folder.length !== 0) {
if (_mobileDlg && folder.length !== 0) {
qgcView.showDialog(mobileFileSaveDialog, title, qgcView.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} else {
fullFileDialog.open()
......
......@@ -44,6 +44,7 @@ public:
Q_PROPERTY(bool multiVehicleEnabled READ multiVehicleEnabled NOTIFY multiVehicleEnabledChanged)
Q_PROPERTY(bool showOfflineMapExport READ showOfflineMapExport NOTIFY showOfflineMapExportChanged)
Q_PROPERTY(bool showOfflineMapImport READ showOfflineMapImport NOTIFY showOfflineMapImportChanged)
Q_PROPERTY(bool useMobileFileDialog READ useMobileFileDialog CONSTANT)
/// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/// @return true if QGC should consolidate both menus into one.
......@@ -80,9 +81,11 @@ public:
#if defined(__mobile__)
virtual bool showOfflineMapExport () const { return false; }
virtual bool showOfflineMapImport () const { return false; }
virtual bool useMobileFileDialog () const { return true;}
#else
virtual bool showOfflineMapExport () const { return true; }
virtual bool showOfflineMapImport () const { return true; }
virtual bool useMobileFileDialog () const { return false;}
#endif
/// If returned QString in non-empty it means that firmware upgrade will run in a mode which only
......
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