Browse Source

Enable/Disable Offline maps import/export.

QGC4.4
Gus Grubba 8 years ago
parent
commit
ac99b3fe6c
  1. 4
      src/QtLocationPlugin/QMLControl/OfflineMap.qml
  2. 12
      src/api/QGCOptions.h
  3. 3
      src/ui/preferences/GeneralSettings.qml

4
src/QtLocationPlugin/QMLControl/OfflineMap.qml

@ -955,7 +955,7 @@ QGCView { @@ -955,7 +955,7 @@ QGCView {
QGCButton {
text: qsTr("Import")
width: _buttonSize
visible: !ScreenTools.isMobile
visible: QGroundControl.corePlugin.options.showOfflineMapImport
onClicked: {
QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone
rootLoader.sourceComponent = importDialog
@ -964,7 +964,7 @@ QGCView { @@ -964,7 +964,7 @@ QGCView {
QGCButton {
text: qsTr("Export")
width: _buttonSize
visible: !ScreenTools.isMobile
visible: QGroundControl.corePlugin.options.showOfflineMapExport
enabled: QGroundControl.mapEngineManager.tileSets.count > 1
onClicked: showExport()
}

12
src/api/QGCOptions.h

@ -42,6 +42,8 @@ public: @@ -42,6 +42,8 @@ public:
Q_PROPERTY(bool guidedBarShowOrbit READ guidedBarShowOrbit NOTIFY guidedBarShowOrbitChanged)
Q_PROPERTY(bool missionWaypointsOnly READ missionWaypointsOnly NOTIFY missionWaypointsOnlyChanged)
Q_PROPERTY(bool multiVehicleEnabled READ multiVehicleEnabled NOTIFY multiVehicleEnabledChanged)
Q_PROPERTY(bool showOfflineMapExport READ showOfflineMapExport NOTIFY showOfflineMapExportChanged)
Q_PROPERTY(bool showOfflineMapImport READ showOfflineMapImport NOTIFY showOfflineMapImportChanged)
/// 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.
@ -75,6 +77,14 @@ public: @@ -75,6 +77,14 @@ public:
virtual bool missionWaypointsOnly () const { return false; } ///< true: Only allow waypoints and complex items in Plan
virtual bool multiVehicleEnabled () const { return true; } ///< false: multi vehicle support is disabled
#if defined(__mobile__)
virtual bool showOfflineMapExport () const { return false; }
virtual bool showOfflineMapImport () const { return false; }
#else
virtual bool showOfflineMapExport () const { return true; }
virtual bool showOfflineMapImport () const { return true; }
#endif
/// If returned QString in non-empty it means that firmware upgrade will run in a mode which only
/// supports downloading a single firmware file from the URL. It also supports custom install through
/// the Advanced options.
@ -91,6 +101,8 @@ signals: @@ -91,6 +101,8 @@ signals:
void guidedBarShowOrbitChanged (bool show);
void missionWaypointsOnlyChanged (bool missionWaypointsOnly);
void multiVehicleEnabledChanged (bool multiVehicleEnabled);
void showOfflineMapExportChanged ();
void showOfflineMapImportChanged ();
private:
CustomInstrumentWidget* _defaultInstrumentWidget;

3
src/ui/preferences/GeneralSettings.qml

@ -294,7 +294,8 @@ QGCView { @@ -294,7 +294,8 @@ QGCView {
//-----------------------------------------------------------------
//-- Battery talker
Row {
spacing: ScreenTools.defaultFontPixelWidth
spacing: ScreenTools.defaultFontPixelWidth
visible: QGroundControl.settingsManager.appSettings.batteryPercentRemainingAnnounce.visible
QGCCheckBox {
id: announcePercentCheckbox
text: qsTr("Announce battery lower than:")

Loading…
Cancel
Save