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