diff --git a/qgcimages.qrc b/qgcimages.qrc index ffb1b4cffdb0ea7a5bd91319823b67b6e423ee59..e0e6be14833fcebeb03ca4c7f8a2d0e5d12c004a 100644 --- a/qgcimages.qrc +++ b/qgcimages.qrc @@ -127,7 +127,7 @@ src/FlightMap/Images/pipHide.svg src/FlightMap/Images/pipResize.svg src/ui/toolbar/Images/Plan.svg - src/MissionManager/CustomPlanCreator.png + src/MissionManager/BlankPlanCreator.png src/MissionManager/CorridorScanPlanCreator.png src/MissionManager/StructureScanPlanCreator.png src/MissionManager/SurveyPlanCreator.png diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 536f6155be31199ef81d01b6efae9b574d77842c..74ff318dbdd9b4c5409b07bc5250c2c6e17557e1 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -592,7 +592,7 @@ HEADERS += \ src/MissionManager/ComplexMissionItem.h \ src/MissionManager/CorridorScanComplexItem.h \ src/MissionManager/CorridorScanPlanCreator.h \ - src/MissionManager/CustomPlanCreator.h \ + src/MissionManager/BlankPlanCreator.h \ src/MissionManager/FixedWingLandingComplexItem.h \ src/MissionManager/GeoFenceController.h \ src/MissionManager/GeoFenceManager.h \ @@ -823,7 +823,7 @@ SOURCES += \ src/MissionManager/ComplexMissionItem.cc \ src/MissionManager/CorridorScanComplexItem.cc \ src/MissionManager/CorridorScanPlanCreator.cc \ - src/MissionManager/CustomPlanCreator.cc \ + src/MissionManager/BlankPlanCreator.cc \ src/MissionManager/FixedWingLandingComplexItem.cc \ src/MissionManager/GeoFenceController.cc \ src/MissionManager/GeoFenceManager.cc \ diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 99908ea6b068c45618a3bcfc558df8129086c1ee..fb2a636586da75ea2b0e38636b630e257f343181 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -102,7 +102,6 @@ src/QmlControls/ParameterEditorDialog.qml src/QmlControls/PIDTuning.qml src/PlanView/PlanEditToolbar.qml - src/PlanView/PlanStartOverlay.qml src/QmlControls/PreFlightCheckButton.qml src/QmlControls/PreFlightCheckGroup.qml src/QmlControls/PreFlightCheckModel.qml diff --git a/src/MissionManager/BlankPlanCreator.cc b/src/MissionManager/BlankPlanCreator.cc new file mode 100644 index 0000000000000000000000000000000000000000..abd4562f90926c3c387a09d4775ba2c708a76bff --- /dev/null +++ b/src/MissionManager/BlankPlanCreator.cc @@ -0,0 +1,24 @@ +/**************************************************************************** + * + * (c) 2009-2016 QGROUNDCONTROL PROJECT + * + * QGroundControl is licensed according to the terms in the file + * COPYING.md in the root of the source code directory. + * + ****************************************************************************/ + +#include "BlankPlanCreator.h" +#include "PlanMasterController.h" +#include "MissionSettingsItem.h" +#include "FixedWingLandingComplexItem.h" + +BlankPlanCreator::BlankPlanCreator(PlanMasterController* planMasterController, QObject* parent) + : PlanCreator(planMasterController, tr("Blank"), QStringLiteral("/qmlimages/PlanCreator/BlankPlanCreator.png"), parent) +{ + +} + +void BlankPlanCreator::createPlan(const QGeoCoordinate& /*mapCenterCoord*/) +{ + _planMasterController->removeAll(); +} diff --git a/src/MissionManager/CustomPlanCreator.h b/src/MissionManager/BlankPlanCreator.h similarity index 78% rename from src/MissionManager/CustomPlanCreator.h rename to src/MissionManager/BlankPlanCreator.h index 56b0900686cb24b36263f19ec74fa76b637590ea..b11c7190c67464e1599feb7117344304b821f90c 100644 --- a/src/MissionManager/CustomPlanCreator.h +++ b/src/MissionManager/BlankPlanCreator.h @@ -11,12 +11,12 @@ #include "PlanCreator.h" -class CustomPlanCreator : public PlanCreator +class BlankPlanCreator : public PlanCreator { Q_OBJECT public: - CustomPlanCreator(PlanMasterController* planMasterController, QObject* parent = nullptr); + BlankPlanCreator(PlanMasterController* planMasterController, QObject* parent = nullptr); Q_INVOKABLE void createPlan(const QGeoCoordinate& mapCenterCoord) final; }; diff --git a/src/MissionManager/BlankPlanCreator.png b/src/MissionManager/BlankPlanCreator.png new file mode 100644 index 0000000000000000000000000000000000000000..7951383a98c6f7de98d1fb7812c4db69b6b748d1 Binary files /dev/null and b/src/MissionManager/BlankPlanCreator.png differ diff --git a/src/MissionManager/CorridorScanPlanCreator.png b/src/MissionManager/CorridorScanPlanCreator.png index d50b0a273749a2bde7b278f7662092cbd6e1125f..3889f6c89a2a1a043bf34dc03bc23d2fbb6f2b46 100644 Binary files a/src/MissionManager/CorridorScanPlanCreator.png and b/src/MissionManager/CorridorScanPlanCreator.png differ diff --git a/src/MissionManager/CustomPlanCreator.cc b/src/MissionManager/CustomPlanCreator.cc deleted file mode 100644 index 8900f86331d689530502bce4a7c78d9b11ea5dd0..0000000000000000000000000000000000000000 --- a/src/MissionManager/CustomPlanCreator.cc +++ /dev/null @@ -1,38 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2016 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -#include "CustomPlanCreator.h" -#include "PlanMasterController.h" -#include "MissionSettingsItem.h" -#include "FixedWingLandingComplexItem.h" - -CustomPlanCreator::CustomPlanCreator(PlanMasterController* planMasterController, QObject* parent) - : PlanCreator(planMasterController, tr("Custom"), QStringLiteral("/qmlimages/PlanCreator/CustomPlanCreator.png"), parent) -{ - -} - -void CustomPlanCreator::createPlan(const QGeoCoordinate& mapCenterCoord) -{ - _planMasterController->removeAll(); - VisualMissionItem* takeoffItem = _missionController->insertSimpleMissionItem(mapCenterCoord, -1); - takeoffItem->setWizardMode(true); - _missionController->insertSimpleMissionItem(mapCenterCoord.atDistanceAndAzimuth(50, 135), -1); - _missionController->insertSimpleMissionItem(mapCenterCoord.atDistanceAndAzimuth(50, -135),-1); - if (_planMasterController->managerVehicle()->fixedWing()) { - FixedWingLandingComplexItem* landingItem = qobject_cast(_missionController->insertComplexMissionItem(MissionController::patternFWLandingName, mapCenterCoord, -1)); - landingItem->setWizardMode(true); - landingItem->setLoiterDragAngleOnly(true); - } else { - MissionSettingsItem* settingsItem = _missionController->visualItems()->value(0); - settingsItem->setMissionEndRTL(true); - } - _missionController->setCurrentPlanViewIndex(takeoffItem->sequenceNumber(), true); - -} diff --git a/src/MissionManager/CustomPlanCreator.png b/src/MissionManager/CustomPlanCreator.png deleted file mode 100644 index ca0eb9860c55af3bc53b93d04da0eff290598f88..0000000000000000000000000000000000000000 Binary files a/src/MissionManager/CustomPlanCreator.png and /dev/null differ diff --git a/src/MissionManager/PlanMasterController.cc b/src/MissionManager/PlanMasterController.cc index db2dd88f935592c6a8f27475a0ea27d789ae8ba9..de6d94f60cc830c2f4aee64d879821b315c7719e 100644 --- a/src/MissionManager/PlanMasterController.cc +++ b/src/MissionManager/PlanMasterController.cc @@ -19,7 +19,7 @@ #include "SurveyPlanCreator.h" #include "StructureScanPlanCreator.h" #include "CorridorScanPlanCreator.h" -#include "CustomPlanCreator.h" +#include "BlankPlanCreator.h" #if defined(QGC_AIRMAP_ENABLED) #include "AirspaceFlightPlanProvider.h" #endif @@ -601,19 +601,19 @@ void PlanMasterController::_updatePlanCreatorsList(void) if (!_flyView) { if (!_planCreators) { _planCreators = new QmlObjectListModel(this); + _planCreators->append(new BlankPlanCreator(this, this)); _planCreators->append(new SurveyPlanCreator(this, this)); _planCreators->append(new CorridorScanPlanCreator(this, this)); - _planCreators->append(new CustomPlanCreator(this, this)); emit planCreatorsChanged(_planCreators); } if (_managerVehicle->fixedWing()) { if (_planCreators->count() == 4) { - _planCreators->removeAt(_planCreators->count() - 2); + _planCreators->removeAt(_planCreators->count() - 1); } } else { if (_planCreators->count() != 4) { - _planCreators->insert(_planCreators->count() - 1, new StructureScanPlanCreator(this, this)); + _planCreators->append(new StructureScanPlanCreator(this, this)); } } } diff --git a/src/MissionManager/StructureScanPlanCreator.png b/src/MissionManager/StructureScanPlanCreator.png index ac9f1bf5c26dd091a0f6112c1a69da6381bdb944..e43c41600cd3d312d946145cdd6ffd195fe70929 100644 Binary files a/src/MissionManager/StructureScanPlanCreator.png and b/src/MissionManager/StructureScanPlanCreator.png differ diff --git a/src/MissionManager/SurveyPlanCreator.png b/src/MissionManager/SurveyPlanCreator.png index 5ca4e15b193bd42d7f2e0dfafeb2cab80a3f2069..e2163ea43243f52cde4296d242874dddf3f676f2 100644 Binary files a/src/MissionManager/SurveyPlanCreator.png and b/src/MissionManager/SurveyPlanCreator.png differ diff --git a/src/PlanView/CameraSection.qml b/src/PlanView/CameraSection.qml index 0a01e62e09489081785e110d83f2f4ca54c582c2..fc588b18a0830297018c662ae854a12ef722ded0 100644 --- a/src/PlanView/CameraSection.qml +++ b/src/PlanView/CameraSection.qml @@ -24,6 +24,8 @@ Column { SectionHeader { id: cameraSectionHeader + anchors.left: parent.left + anchors.right: parent.right text: qsTr("Camera") checked: false } diff --git a/src/PlanView/CorridorScanEditor.qml b/src/PlanView/CorridorScanEditor.qml index 86058e936df4b4d78d7eee3403c6a6184598fba1..3ccfe084bc2d9d708ecd20d1a51b0ddb1c593a83 100644 --- a/src/PlanView/CorridorScanEditor.qml +++ b/src/PlanView/CorridorScanEditor.qml @@ -124,8 +124,10 @@ Rectangle { } SectionHeader { - id: corridorHeader - text: qsTr("Corridor") + id: corridorHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Corridor") } GridLayout { @@ -182,9 +184,11 @@ Rectangle { } SectionHeader { - id: terrainHeader - text: qsTr("Terrain") - checked: missionItem.followTerrain + id: terrainHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Terrain") + checked: missionItem.followTerrain } ColumnLayout { @@ -228,8 +232,10 @@ Rectangle { } SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } TransectStyleComplexItemStats { } diff --git a/src/PlanView/FWLandingPatternEditor.qml b/src/PlanView/FWLandingPatternEditor.qml index 4098468e6472d4e6e304a890dcee4a9295095aef..c5434397fe52880ae222a4d1b35f4fbe1f97544c 100644 --- a/src/PlanView/FWLandingPatternEditor.qml +++ b/src/PlanView/FWLandingPatternEditor.qml @@ -52,8 +52,10 @@ Rectangle { visible: !editorColumnNeedLandingPoint.visible SectionHeader { - id: loiterPointSection - text: qsTr("Loiter point") + id: loiterPointSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Loiter point") } Column { @@ -101,8 +103,10 @@ Rectangle { } SectionHeader { - id: landingPointSection - text: qsTr("Landing point") + id: landingPointSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Landing point") } Column { @@ -181,9 +185,11 @@ Rectangle { } SectionHeader { - id: cameraSection - text: qsTr("Camera") - visible: _showCameraSection + id: cameraSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Camera") + visible: _showCameraSection } Column { diff --git a/src/PlanView/GeoFenceEditor.qml b/src/PlanView/GeoFenceEditor.qml index 40bfa0e62d1f1b0b9fa996e5ebcc6867579f47fe..667b6d37d84d99a21bdf9698550d9d96e7c8c751 100644 --- a/src/PlanView/GeoFenceEditor.qml +++ b/src/PlanView/GeoFenceEditor.qml @@ -110,8 +110,10 @@ QGCFlickable { } SectionHeader { - id: insertSection - text: qsTr("Insert GeoFence") + id: insertSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Insert GeoFence") } QGCButton { @@ -139,8 +141,10 @@ QGCFlickable { } SectionHeader { - id: polygonSection - text: qsTr("Polygon Fences") + id: polygonSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Polygon Fences") } QGCLabel { @@ -212,8 +216,10 @@ QGCFlickable { } // GridLayout SectionHeader { - id: circleSection - text: qsTr("Circular Fences") + id: circleSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Circular Fences") } QGCLabel { @@ -302,8 +308,10 @@ QGCFlickable { } // GridLayout SectionHeader { - id: breachReturnSection - text: qsTr("Breach Return Point") + id: breachReturnSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Breach Return Point") } QGCButton { diff --git a/src/PlanView/MissionSettingsEditor.qml b/src/PlanView/MissionSettingsEditor.qml index 3efe77fc971de78d972708421a9a15df36394812..4c6f5095aaa5299f69d65bc40b51fb666873a731 100644 --- a/src/PlanView/MissionSettingsEditor.qml +++ b/src/PlanView/MissionSettingsEditor.qml @@ -108,9 +108,11 @@ Rectangle { } SectionHeader { - id: missionEndHeader - text: qsTr("Mission End") - checked: true + id: missionEndHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Mission End") + checked: true } Column { @@ -128,10 +130,12 @@ Rectangle { SectionHeader { - id: vehicleInfoSectionHeader - text: qsTr("Vehicle Info") - visible: _offlineEditing && !_waypointsOnlyMode - checked: false + id: vehicleInfoSectionHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Vehicle Info") + visible: _offlineEditing && !_waypointsOnlyMode + checked: false } GridLayout { @@ -192,10 +196,12 @@ Rectangle { } // GridLayout SectionHeader { - id: plannedHomePositionSection - text: qsTr("Planned Home Position") - visible: !_vehicleHasHomePosition - checked: false + id: plannedHomePositionSection + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Planned Home Position") + visible: !_vehicleHasHomePosition + checked: false } Column { diff --git a/src/PlanView/PlanStartOverlay.qml b/src/PlanView/PlanStartOverlay.qml deleted file mode 100644 index 6475f5ad5370e87bf14021c159b1aedd8b22d898..0000000000000000000000000000000000000000 --- a/src/PlanView/PlanStartOverlay.qml +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - * - * (c) 2009-2016 QGROUNDCONTROL PROJECT - * - * QGroundControl is licensed according to the terms in the file - * COPYING.md in the root of the source code directory. - * - ****************************************************************************/ - -import QtQuick 2.3 -import QtQuick.Controls 2.4 -import QtQuick.Layouts 1.2 - -import QGroundControl 1.0 -import QGroundControl.ScreenTools 1.0 -import QGroundControl.Controls 1.0 -import QGroundControl.Palette 1.0 - -Item { - id: _root - - property var planMasterController - property var mapControl - - property real _radius: ScreenTools.defaultFontPixelWidth / 2 - property real _margins: ScreenTools.defaultFontPixelWidth - - function _mapCenter() { - var centerPoint = Qt.point(mapControl.centerViewport.left + (mapControl.centerViewport.width / 2), mapControl.centerViewport.top + (mapControl.centerViewport.height / 2)) - return mapControl.toCoordinate(centerPoint, false /* clipToViewPort */) - } - - QGCPalette { id: qgcPal; colorGroupEnabled: enabled } - - Rectangle { - anchors.fill: parent - radius: _radius - color: "white" - opacity: 0.75 - } - - // Close Icon - QGCColoredImage { - anchors.margins: ScreenTools.defaultFontPixelWidth / 2 - anchors.top: parent.top - anchors.right: parent.right - width: ScreenTools.defaultFontPixelHeight - height: width - sourceSize.height: width - source: "/res/XDelete.svg" - fillMode: Image.PreserveAspectFit - mipmap: true - smooth: true - color: "black" - QGCMouseArea { - fillItem: parent - onClicked: _root.visible = false - } - } - - QGCLabel { - id: title - anchors.left: parent.left - anchors.right: parent.right - horizontalAlignment: Text.AlignHCenter - text: qsTr("Create Plan") - color: "black" - } - - QGCFlickable { - id: flickable - anchors.margins: _margins - anchors.top: title.bottom - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - contentHeight: creatorFlow.height - contentWidth: creatorFlow.width - - Flow { - id: creatorFlow - width: flickable.width - spacing: _margins - - Repeater { - model: _planMasterController.planCreators - - Rectangle { - id: button - width: ScreenTools.defaultFontPixelHeight * 10 - height: width - color: button.pressed || button.highlighted ? qgcPal.buttonHighlight : qgcPal.button - - property bool highlighted: mouseArea.containsMouse - property bool pressed: mouseArea.pressed - - Image { - anchors.margins: _margins - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - source: object.imageResource - fillMode: Image.PreserveAspectFit - mipmap: true - } - - QGCLabel { - anchors.margins: _margins - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - horizontalAlignment: Text.AlignHCenter - text: object.name - color: button.pressed || button.highlighted ? qgcPal.buttonHighlightText : qgcPal.buttonText - } - - QGCMouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - preventStealing: true - onClicked: { object.createPlan(_mapCenter()); _root.visible = false } - } - } - } - } - } -} diff --git a/src/PlanView/PlanView.qml b/src/PlanView/PlanView.qml index 19acdbfecd834680de6512a5dd10fcc9519e851c..d5f8ea0391f96d4dcbd69730cef31cfcb931a849 100644 --- a/src/PlanView/PlanView.qml +++ b/src/PlanView/PlanView.qml @@ -28,6 +28,7 @@ import QGroundControl.Airspace 1.0 import QGroundControl.Airmap 1.0 Item { + id: _root property bool planControlColapsed: false @@ -110,6 +111,12 @@ Item { } } + onVisibleChanged: { + if (visible && !_planMasterController.containsItems) { + toolStrip.simulateClick(toolStrip.fileButtonIndex) + } + } + Connections { target: _appSettings ? _appSettings.defaultMissionItemAltitude : null onRawValueChanged: { @@ -330,7 +337,7 @@ Item { if (retList[0] == ShapeFileHelper.Error) { mainWindow.showMessageDialog("Error", retList[1]) } else if (retList[0] == ShapeFileHelper.Polygon) { - var editVehicle = activeVehicle ? activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle + var editVehicle = activeVehicle ? activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle if (editVehicle.fixedWing) { insertComplexMissionItemFromKMLOrSHP(_missionController.surveyComplexItemName, file, -1) } else { @@ -476,18 +483,6 @@ Item { } } - PlanStartOverlay { - id: startOverlay - x: editorMap.centerViewport.left - y: editorMap.centerViewport.top - width: editorMap.centerViewport.width - height: editorMap.centerViewport.height - z: QGroundControl.zOrderMapItems + 2 - visible: !_planMasterController.containsItems - planMasterController: _planMasterController - mapControl: editorMap - } - // Add the mission item visuals to the map Repeater { model: _editingLayer == _layerMission ? _missionController.visualItems : undefined @@ -609,6 +604,8 @@ Item { z: QGroundControl.zOrderWidgets maxHeight: mapScale.y - toolStrip.y + property int fileButtonIndex: 1 + property bool _isRally: _editingLayer == _layerRallyPoints model: [ @@ -939,19 +936,14 @@ Item { } } + property var createPlanRemoveAllPromptDialogMapCenter + property var createPlanRemoveAllPromptDialogPlanCreator Component { - id: removeAllPromptDialog + id: createPlanRemoveAllPromptDialog QGCViewMessage { - message: qsTr("Are you sure you want to remove all items and create a new plan? ") + - (_planMasterController.offline ? "" : qsTr("This will also remove all items from the vehicle.")) + message: qsTr("Are you sure you want to remove current plan and create a new plan? ") function accept() { - if (_planMasterController.offline) { - _planMasterController.removeAll() - } else { - _planMasterController.removeAllFromVehicle() - } - _missionController.setCurrentPlanViewIndex(0, true) - startOverlay.visible = true + createPlanRemoveAllPromptDialogPlanCreator.createPlan(createPlanRemoveAllPromptDialogMapCenter) hideDialog() } } @@ -964,7 +956,6 @@ Item { function accept() { _planMasterController.removeAllFromVehicle() _missionController.setCurrentPlanViewIndex(0, true) - startOverlay.visible = true hideDialog() } } @@ -1027,42 +1018,115 @@ Item { Component { id: syncDropPanel - Column { + ColumnLayout { id: columnHolder spacing: _margin property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite")) QGCLabel { - width: sendSaveGrid.width - wrapMode: Text.WordWrap - text: _planMasterController.dirty ? - (activeVehicle ? - qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file:") : - qsTr("You have unsaved changes.") - ) : - qsTr("Plan File:") + id: unsavedChangedLabel + Layout.fillWidth: true + wrapMode: Text.WordWrap + text: activeVehicle ? + qsTr("You have unsaved changes. You should upload to your vehicle, or save to a file.") : + qsTr("You have unsaved changes.") + visible: _planMasterController.dirty + } + + SectionHeader { + id: createSection + Layout.fillWidth: true + text: qsTr("Create Plan") + showSpacer: false } GridLayout { - id: sendSaveGrid columns: 2 - anchors.margins: _margin + columnSpacing: _margin + rowSpacing: _margin + Layout.fillWidth: true + visible: createSection.visible + + Repeater { + model: _planMasterController.planCreators + + Rectangle { + id: button + width: ScreenTools.defaultFontPixelHeight * 7 + height: planCreatorNameLabel.y + planCreatorNameLabel.height + color: button.pressed || button.highlighted ? qgcPal.buttonHighlight : qgcPal.button + + property bool highlighted: mouseArea.containsMouse + property bool pressed: mouseArea.pressed + + Image { + id: planCreatorImage + anchors.left: parent.left + anchors.right: parent.right + source: object.imageResource + sourceSize.width: width + fillMode: Image.PreserveAspectFit + mipmap: true + } + + QGCLabel { + id: planCreatorNameLabel + anchors.top: planCreatorImage.bottom + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: Text.AlignHCenter + text: object.name + color: button.pressed || button.highlighted ? qgcPal.buttonHighlightText : qgcPal.buttonText + } + + QGCMouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + preventStealing: true + onClicked: { + if (_planMasterController.containsItems) { + createPlanRemoveAllPromptDialogMapCenter = _mapCenter() + createPlanRemoveAllPromptDialogPlanCreator = object + mainWindow.showComponentDialog(createPlanRemoveAllPromptDialog, qsTr("Create Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) + } else { + object.createPlan(_mapCenter()) + } + dropPanel.hide() + } + + function _mapCenter() { + var centerPoint = Qt.point(editorMap.centerViewport.left + (editorMap.centerViewport.width / 2), editorMap.centerViewport.top + (editorMap.centerViewport.height / 2)) + return editorMap.toCoordinate(centerPoint, false /* clipToViewPort */) + } + } + } + } + } + + SectionHeader { + id: storageSection + Layout.fillWidth: true + text: qsTr("Storage") + } + + GridLayout { + columns: 3 rowSpacing: _margin columnSpacing: ScreenTools.defaultFontPixelWidth + visible: storageSection.visible - QGCButton { + /*QGCButton { text: qsTr("New...") Layout.fillWidth: true onClicked: { dropPanel.hide() if (_planMasterController.containsItems) { mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) - } else { - startOverlay.visible = true } } - } + }*/ QGCButton { text: qsTr("Open...") @@ -1103,8 +1167,9 @@ Item { } QGCButton { + Layout.columnSpan: 3 + Layout.fillWidth: true text: qsTr("Save Mission Waypoints As KML...") - Layout.columnSpan: 2 enabled: !_planMasterController.syncInProgress && _visualItems.count > 1 onClicked: { // First point does not count @@ -1116,16 +1181,18 @@ Item { _planMasterController.saveKmlToSelectedFile() } } + } - Rectangle { - width: parent.width * 0.8 - height: 1 - color: qgcPal.text - opacity: 0.5 - visible: !QGroundControl.corePlugin.options.disableVehicleConnection - Layout.fillWidth: true - Layout.columnSpan: 2 - } + SectionHeader { + id: vehicleSection + Layout.fillWidth: true + text: qsTr("Vehicle") + } + + RowLayout { + Layout.fillWidth: true + spacing: _margin + visible: vehicleSection.visible QGCButton { text: qsTr("Upload") @@ -1154,7 +1221,7 @@ Item { } QGCButton { - text: qsTr("Clear Vehicle Mission") + text: qsTr("Clear") Layout.fillWidth: true Layout.columnSpan: 2 enabled: !_planMasterController.offline && !_planMasterController.syncInProgress @@ -1164,8 +1231,9 @@ Item { mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } } - } + + } } } diff --git a/src/PlanView/StructureScanEditor.qml b/src/PlanView/StructureScanEditor.qml index 31e307ef69f47cae28e5518651a3445c97f75d6d..c8a8611477410cf7129e0ab4f8aea33bd9820599 100644 --- a/src/PlanView/StructureScanEditor.qml +++ b/src/PlanView/StructureScanEditor.qml @@ -130,8 +130,10 @@ Rectangle { } SectionHeader { - id: scanHeader - text: qsTr("Scan") + id: scanHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Scan") } Column { @@ -200,8 +202,10 @@ Rectangle { } // Column - Scan SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } Grid { diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index 291dd8680b1446a8cb8525da21f5a12bbe542e6f..c2fcf07e697ce1f7fbacfc7bc0dd62fe46397a32 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -124,8 +124,10 @@ Rectangle { } SectionHeader { - id: transectsHeader - text: qsTr("Transects") + id: transectsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Transects") } GridLayout { @@ -233,9 +235,11 @@ Rectangle { } SectionHeader { - id: terrainHeader - text: qsTr("Terrain") - checked: missionItem.followTerrain + id: terrainHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Terrain") + checked: missionItem.followTerrain } ColumnLayout { @@ -280,8 +284,10 @@ Rectangle { } SectionHeader { - id: statsHeader - text: qsTr("Statistics") + id: statsHeader + anchors.left: parent.left + anchors.right: parent.right + text: qsTr("Statistics") } TransectStyleComplexItemStats { @@ -357,8 +363,6 @@ Rectangle { SectionHeader { id: presectsTransectsHeader - anchors.left: undefined - anchors.right: undefined Layout.fillWidth: true text: qsTr("Transects") } @@ -400,11 +404,9 @@ Rectangle { } SectionHeader { - id: presetsStatsHeader - anchors.left: undefined - anchors.right: undefined + id: presetsStatsHeader Layout.fillWidth: true - text: qsTr("Statistics") + text: qsTr("Statistics") } TransectStyleComplexItemStats { diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml index 811f26192abdd1c8778a1d1e738aba69fe6472bf..4095eb1570b16ab7ddcdfb4b8c369518f1fc8920 100644 --- a/src/QmlControls/ParameterEditor.qml +++ b/src/QmlControls/ParameterEditor.qml @@ -174,6 +174,8 @@ Item { SectionHeader { id: categoryHeader + anchors.left: parent.left + anchors.right: parent.right text: category checked: controller.currentCategory === text exclusiveGroup: sectionGroup diff --git a/src/QmlControls/PreFlightCheckGroup.qml b/src/QmlControls/PreFlightCheckGroup.qml index f3d2b3feeffece0f96f44bbc397a0dfc13ee3a1f..19280ba8d26d38b7159a36e57ea82939d059b293 100644 --- a/src/QmlControls/PreFlightCheckGroup.qml +++ b/src/QmlControls/PreFlightCheckGroup.qml @@ -43,8 +43,10 @@ Column { } SectionHeader { - id: header - text: name + (passed ? qsTr(" (passed)") : "") + id: header + anchors.left: parent.left + anchors.right: parent.right + text: name + (passed ? qsTr(" (passed)") : "") } Column { diff --git a/src/QmlControls/QGroundControl/Controls/qmldir b/src/QmlControls/QGroundControl/Controls/qmldir index 8d3abf8b978a55fef6836b857c163d878045c1f2..fae59ca2d0aa2dbf6937ea1a1ba846b3c7feffae 100644 --- a/src/QmlControls/QGroundControl/Controls/qmldir +++ b/src/QmlControls/QGroundControl/Controls/qmldir @@ -40,7 +40,6 @@ ParameterEditor 1.0 ParameterEditor.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml PIDTuning 1.0 PIDTuning.qml PlanEditToolbar 1.0 PlanEditToolbar.qml -PlanStartOverlay 1.0 PlanStartOverlay.qml PreFlightCheckButton 1.0 PreFlightCheckButton.qml PreFlightCheckGroup 1.0 PreFlightCheckGroup.qml PreFlightCheckModel 1.0 PreFlightCheckModel.qml diff --git a/src/QmlControls/SectionHeader.qml b/src/QmlControls/SectionHeader.qml index 06c9a2ca533ccb57c9f5a810bd242c016ab98931..dc763f2e3da17c4fe55391980e5bd5fca492156e 100644 --- a/src/QmlControls/SectionHeader.qml +++ b/src/QmlControls/SectionHeader.qml @@ -7,10 +7,8 @@ import QGroundControl.ScreenTools 1.0 import QGroundControl.Palette 1.0 FocusScope { - id: _root - anchors.left: parent.left - anchors.right: parent.right - height: column.height + id: _root + height: column.height property alias text: label.text property bool checked: true diff --git a/src/QmlControls/ToolStrip.qml b/src/QmlControls/ToolStrip.qml index 5c09c525280de91a04b1b0f23af7389e324f42f5..be668af7f2288bda4e65edfb795c0be71938ecfa 100644 --- a/src/QmlControls/ToolStrip.qml +++ b/src/QmlControls/ToolStrip.qml @@ -27,6 +27,11 @@ Rectangle { property AbstractButton lastClickedButton: null + function simulateClick(buttonIndex) { + toolStripColumn.children[buttonIndex].checked = true + toolStripColumn.children[buttonIndex].clicked() + } + // Ensure we don't get narrower than content property real _idealWidth: (ScreenTools.isMobile ? ScreenTools.minTouchPixels : ScreenTools.defaultFontPixelWidth * 8) + toolStripColumn.anchors.margins * 2 @@ -73,7 +78,7 @@ Rectangle { checked: modelData.checked !== undefined ? modelData.checked : checked ButtonGroup.group: buttonGroup - // Only drop pannel and toggleable are checkable + // Only drop panel and toggleable are checkable checkable: modelData.dropPanelComponent !== undefined || (modelData.toggle !== undefined && modelData.toggle) onClicked: {