Newer
Older
hideDialog()
}
}
}
Gus Grubba
committed
Component {
id: clearVehicleMissionDialog
QGCViewMessage {
message: qsTr("Are you sure you want to remove all mission items and clear the mission from the vehicle?")
function accept() {
Gus Grubba
committed
hideDialog()
}
}
}
//- ToolStrip DropPanel Components
Component {
id: centerMapDropPanel
CenterMapDropPanel {
map: editorMap
fitFunctions: mapFitFunctions
}
}
Component {
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: {
addComplexItem(modelData)
dropPanel.hide()
}
}
}
} // Column
}
property string _overwriteText: (_editingLayer == _layerMission) ? qsTr("Mission overwrite") : ((_editingLayer == _layerGeoFence) ? qsTr("GeoFence overwrite") : qsTr("Rally Points overwrite"))
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")
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
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
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
if (_planMasterController.containsItems) {
mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
}
mainWindow.showComponentDialog(syncLoadFromFileOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
enabled: !_planMasterController.syncInProgress && _planMasterController.currentPlanFile !== ""
if(_planMasterController.currentPlanFile !== "") {
_planMasterController.saveToCurrent()
enabled: !_planMasterController.syncInProgress && _planMasterController.containsItems
Gus Grubba
committed
text: qsTr("Save Mission Waypoints As KML...")
enabled: !_planMasterController.syncInProgress && _visualItems.count > 1
mainWindow.showComponentDialog(noItemForKML, qsTr("KML"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
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()
mainWindow.showComponentDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
}
}
}
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)