diff --git a/src/QmlControls/QGCFileDialog.qml b/src/QmlControls/QGCFileDialog.qml index 3ab7fce..256a2c6 100644 --- a/src/QmlControls/QGCFileDialog.qml +++ b/src/QmlControls/QGCFileDialog.qml @@ -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() diff --git a/src/api/QGCOptions.h b/src/api/QGCOptions.h index 2929cfb..ae9fd66 100644 --- a/src/api/QGCOptions.h +++ b/src/api/QGCOptions.h @@ -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