Newer
Older
id: patternDropPanel
ColumnLayout {
spacing: ScreenTools.defaultFontPixelWidth * 0.5
QGCLabel { text: qsTr("Create complex pattern:") }
Repeater {
model: _missionController.complexMissionItemNames
QGCButton {
text: modelData
Layout.fillWidth: true
onClicked: {
insertComplexItemAfterCurrent(modelData)
dropPanel.hide()
}
}
}
} // Column
}
property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite"))
id: unsavedChangedLabel
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: globals.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
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
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
if (_planMasterController.containsItems) {
mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
}
enabled: !_planMasterController.syncInProgress
if (_planMasterController.dirty) {
mainWindow.showComponentDialog(syncLoadFromFileOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
_planMasterController.loadFromSelectedFile()
enabled: !_planMasterController.syncInProgress && _planMasterController.currentPlanFile !== ""
if(_planMasterController.currentPlanFile !== "") {
_planMasterController.saveToCurrent()
_planMasterController.saveToSelectedFile()
enabled: !_planMasterController.syncInProgress && _planMasterController.containsItems
_planMasterController.saveToSelectedFile()
Layout.columnSpan: 3
Layout.fillWidth: true
text: qsTr("Save Mission Waypoints As KML...")
enabled: !_planMasterController.syncInProgress && _visualItems.count > 1
mainWindow.showComponentDialog(noItemForKML, qsTr("KML"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
_planMasterController.saveKmlToSelectedFile()
SectionHeader {
id: vehicleSection
Layout.fillWidth: true
text: qsTr("Vehicle")
}
RowLayout {
Layout.fillWidth: true
spacing: _margin
visible: vehicleSection.visible
enabled: !_planMasterController.offline && !_planMasterController.syncInProgress && _planMasterController.containsItems
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
QGCButton {
text: qsTr("Download")
Layout.fillWidth: true
enabled: !_planMasterController.offline && !_planMasterController.syncInProgress
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
dropPanel.hide()
if (_planMasterController.dirty) {
mainWindow.showComponentDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
_planMasterController.loadFromVehicle()
}
}
}
QGCButton {
Layout.fillWidth: true
Layout.columnSpan: 2
enabled: !_planMasterController.offline && !_planMasterController.syncInProgress
visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: {
dropPanel.hide()
mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)