Browse Source

Merge pull request #5909 from mavlink/customMobileFileDlg

Allow custom plugins to define the use of mobile file dialog
QGC4.4
Gus Grubba 7 years ago committed by GitHub
parent
commit
5922c95360
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/QmlControls/QGCFileDialog.qml
  2. 3
      src/api/QGCOptions.h

6
src/QmlControls/QGCFileDialog.qml

@ -25,7 +25,7 @@ Item { @@ -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 { @@ -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 { @@ -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()

3
src/api/QGCOptions.h

@ -44,6 +44,7 @@ public: @@ -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: @@ -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

Loading…
Cancel
Save