diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index bbbf47efe4d35d55b1afdfca1fd1362174aec8d0..1381ea905ac7700437896ad634bc7b0e3fff4fe4 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -66,6 +66,7 @@ src/FlightMap/Images/ZoomPlus.svg src/FlightMap/Images/ZoomMinus.svg src/FlightMap/Images/TrashDelete.svg + src/FlightMap/Images/XDelete.svg src/FlightMap/Images/Help.svg diff --git a/src/FlightMap/FlightMapSettings.cc b/src/FlightMap/FlightMapSettings.cc index fb7c79582a191464672a984baae714fc01cb9d50..5d2b33f4ea5de6527d01137f06d282790cc5562f 100644 --- a/src/FlightMap/FlightMapSettings.cc +++ b/src/FlightMap/FlightMapSettings.cc @@ -138,3 +138,21 @@ QString FlightMapSettings::loadMapSetting (const QString &mapName, const QString settings.beginGroup(mapName); return settings.value(key, defaultValue).toString(); } + +void FlightMapSettings::saveBoolMapSetting (const QString &mapName, const QString& key, bool value) +{ + QSettings settings; + + settings.beginGroup(_settingsGroup); + settings.beginGroup(mapName); + settings.setValue(key, value); +} + +bool FlightMapSettings::loadBoolMapSetting (const QString &mapName, const QString& key, bool defaultValue) +{ + QSettings settings; + + settings.beginGroup(_settingsGroup); + settings.beginGroup(mapName); + return settings.value(key, defaultValue).toBool(); +} diff --git a/src/FlightMap/FlightMapSettings.h b/src/FlightMap/FlightMapSettings.h index 8de843e7cc2a80c86df5cbf0db14ab8884caab43..375e68c6430496722950d5cf19c2234db5760811 100644 --- a/src/FlightMap/FlightMapSettings.h +++ b/src/FlightMap/FlightMapSettings.h @@ -46,7 +46,9 @@ public: Q_INVOKABLE void saveMapSetting (const QString &mapName, const QString& key, const QString& value); Q_INVOKABLE QString loadMapSetting (const QString &mapName, const QString& key, const QString& defaultValue); - + Q_INVOKABLE void saveBoolMapSetting (const QString &mapName, const QString& key, bool value); + Q_INVOKABLE bool loadBoolMapSetting (const QString &mapName, const QString& key, bool defaultValue); + // Property accessors QString mapProvider(void); diff --git a/src/MissionEditor/MissionEditor.qml b/src/MissionEditor/MissionEditor.qml index 2aeb0a99e449e93abdeaefd0ec87874706a4eb1f..39a82e86ca3692c66773aafae13412f80b5bbdc0 100644 --- a/src/MissionEditor/MissionEditor.qml +++ b/src/MissionEditor/MissionEditor.qml @@ -52,6 +52,7 @@ QGCView { readonly property real _rightPanelOpacity: 0.8 readonly property int _toolButtonCount: 6 readonly property string _autoSyncKey: "AutoSync" + readonly property string _showHelpKey: "ShowHelp" readonly property int _addMissionItemsButtonAutoOffTimeout: 10000 property var _missionItems: controller.missionItems @@ -67,6 +68,8 @@ QGCView { property bool _syncNeeded: controller.missionItems.dirty property bool _syncInProgress: _activeVehicle ? _activeVehicle.missionManager.inProgress : false + property bool _showHelp: QGroundControl.flightMapSettings.loadBoolMapSetting(editorMap.mapName, _showHelpKey, true) + MissionEditorController { id: controller /* @@ -239,7 +242,7 @@ QGCView { anchors.bottom: parent.bottom anchors.right: parent.right width: _rightPanelWidth - visible: !helpButton.checked && !homePositionManagerButton.checked && _missionItems.count > 1 + visible: !homePositionManagerButton.checked && _missionItems.count > 1 opacity: _rightPanelOpacity z: editorMap.zOrderTopMost @@ -554,15 +557,36 @@ QGCView { // Help Panel Rectangle { - id: helpPanel - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.right: parent.right - width: _rightPanelWidth - visible: !homePositionManagerButton.checked && (_missionItems.count == 1 || helpButton.checked) - color: qgcPal.window - opacity: _rightPanelOpacity - z: editorMap.zOrderTopMost + id: helpPanel + anchors.margins: margins + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width - (margins * 2) - _rightPanelWidth + visible: helpButton.checked + color: qgcPal.window + opacity: _rightPanelOpacity + radius: ScreenTools.defaultFontPixelHeight + z: editorMap.zOrderTopMost + + readonly property real margins: ScreenTools.defaultFontPixelHeight * 4 + + Image { + anchors.margins: ScreenTools.defaultFontPixelHeight + anchors.top: parent.top + anchors.right: parent.right + width: ScreenTools.defaultFontPixelHeight * 1.5 + height: ScreenTools.defaultFontPixelHeight * 1.5 + source: "/qmlimages/XDelete.svg" + fillMode: Image.PreserveAspectFit + mipmap: true + smooth: true + + MouseArea { + anchors.fill: parent + onClicked: helpButton.checked = false + } + } Item { anchors.margins: _margin @@ -606,13 +630,35 @@ QGCView { } Image { - id: homePositionManagerHelpIcon + id: deleteHelpIcon anchors.topMargin: ScreenTools.defaultFontPixelHeight anchors.top: addMissionItemsHelpText.bottom width: ScreenTools.defaultFontPixelHeight * 3 fillMode: Image.PreserveAspectFit mipmap: true smooth: true + source: "/qmlimages/TrashDelete.svg" + } + + QGCLabel { + id: deleteHelpText + anchors.leftMargin: ScreenTools.defaultFontPixelHeight + anchors.left: mapTypeHelpIcon.right + anchors.right: parent.right + anchors.top: deleteHelpIcon.top + wrapMode: Text.WordWrap + text: "Delete Mission Item
" + + "Delete the currently selected mission item." + } + + Image { + id: homePositionManagerHelpIcon + anchors.topMargin: ScreenTools.defaultFontPixelHeight + anchors.top: deleteHelpText.bottom + width: ScreenTools.defaultFontPixelHeight * 3 + fillMode: Image.PreserveAspectFit + mipmap: true + smooth: true source: "/qmlimages/MapHome.svg" } @@ -693,6 +739,15 @@ QGCView { text: "Map Type
" + "Map type options." } + + QGCCheckBox { + anchors.left: parent.left + anchors.bottom: parent.bottom + checked: !_showHelp + text: "Don't show me again" + + onClicked: QGroundControl.flightMapSettings.saveBoolMapSetting(editorMap.mapName, _showHelpKey, !checked) + } } // Item - margin } // Item - Help Panel @@ -853,6 +908,7 @@ QGCView { buttonImage: "/qmlimages/Help.svg" exclusiveGroup: _dropButtonsExclusiveGroup z: editorMap.zOrderWidgets + checked: _showHelp } } // FlightMap } // Item - split view container