Commit e55403e5 authored by Gus Grubba's avatar Gus Grubba

Disambiguate showComponentDialog

parent cc520f07
...@@ -165,7 +165,7 @@ AnalyzePage { ...@@ -165,7 +165,7 @@ AnalyzePage {
enabled: !logController.requestingList && !logController.downloadingLogs && logController.model.count > 0 enabled: !logController.requestingList && !logController.downloadingLogs && logController.model.count > 0
text: qsTr("Erase All") text: qsTr("Erase All")
width: _butttonWidth width: _butttonWidth
onClicked: mainWindow.showDialog( onClicked: mainWindow.showComponentDialog(
eraseAllMessage, eraseAllMessage,
qsTr("Delete All Log Files"), qsTr("Delete All Log Files"),
mainWindow.showDialogDefaultWidth, mainWindow.showDialogDefaultWidth,
......
...@@ -444,7 +444,7 @@ SetupPage { ...@@ -444,7 +444,7 @@ SetupPage {
onClicked: { onClicked: {
_calcVoltageDlgVehicleVoltage = vehicleVoltage _calcVoltageDlgVehicleVoltage = vehicleVoltage
_calcVoltageDlgBattVoltMultParam = battVoltMult _calcVoltageDlgBattVoltMultParam = battVoltMult
mainWindow.showDialog(calcVoltageMultiplierDlgComponent, qsTr("Calculate Voltage Multiplier"), mainWindow.showDialogDefaultWidth, StandardButton.Close) mainWindow.showComponentDialog(calcVoltageMultiplierDlgComponent, qsTr("Calculate Voltage Multiplier"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
} }
...@@ -476,7 +476,7 @@ SetupPage { ...@@ -476,7 +476,7 @@ SetupPage {
onClicked: { onClicked: {
_calcAmpsPerVoltDlgVehicleCurrent = vehicleCurrent _calcAmpsPerVoltDlgVehicleCurrent = vehicleCurrent
_calcAmpsPerVoltDlgBattAmpPerVoltParam = battAmpPerVolt _calcAmpsPerVoltDlgBattAmpPerVoltParam = battAmpPerVolt
mainWindow.showDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), mainWindow.showDialogDefaultWidth, StandardButton.Close) mainWindow.showComponentDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
} }
......
...@@ -107,7 +107,7 @@ SetupPage { ...@@ -107,7 +107,7 @@ SetupPage {
break break
} }
mainWindow.showDialog(orientationsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, buttons) mainWindow.showComponentDialog(orientationsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, buttons)
} }
APMSensorParams { APMSensorParams {
...@@ -129,20 +129,20 @@ SetupPage { ...@@ -129,20 +129,20 @@ SetupPage {
onWaitingForCancelChanged: { onWaitingForCancelChanged: {
if (controller.waitingForCancel) { if (controller.waitingForCancel) {
mainWindow.showDialog(waitForCancelDialogComponent, qsTr("Calibration Cancel"), mainWindow.showDialogDefaultWidth, 0) mainWindow.showComponentDialog(waitForCancelDialogComponent, qsTr("Calibration Cancel"), mainWindow.showDialogDefaultWidth, 0)
} }
} }
onCalibrationComplete: { onCalibrationComplete: {
switch (calType) { switch (calType) {
case APMSensorsComponentController.CalTypeAccel: case APMSensorsComponentController.CalTypeAccel:
mainWindow.showDialog(postCalibrationComponent, qsTr("Accelerometer calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(postCalibrationComponent, qsTr("Accelerometer calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
break break
case APMSensorsComponentController.CalTypeOffboardCompass: case APMSensorsComponentController.CalTypeOffboardCompass:
mainWindow.showDialog(postCalibrationComponent, qsTr("Compass calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(postCalibrationComponent, qsTr("Compass calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
break break
case APMSensorsComponentController.CalTypeOnboardCompass: case APMSensorsComponentController.CalTypeOnboardCompass:
mainWindow.showDialog(postOnboardCompassCalibrationComponent, qsTr("Calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(postOnboardCompassCalibrationComponent, qsTr("Calibration complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
break break
} }
} }
...@@ -571,7 +571,7 @@ SetupPage { ...@@ -571,7 +571,7 @@ SetupPage {
if (controller.accelSetupNeeded) { if (controller.accelSetupNeeded) {
mainWindow.showMessageDialog(_levelHorizonText, qsTr("Accelerometer must be calibrated prior to Level Horizon.")) mainWindow.showMessageDialog(_levelHorizonText, qsTr("Accelerometer must be calibrated prior to Level Horizon."))
} else { } else {
mainWindow.showDialog(levelHorizonDialogComponent, _levelHorizonText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(levelHorizonDialogComponent, _levelHorizonText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
} }
...@@ -579,7 +579,7 @@ SetupPage { ...@@ -579,7 +579,7 @@ SetupPage {
QGCButton { QGCButton {
width: _buttonWidth width: _buttonWidth
text: _calibratePressureText text: _calibratePressureText
onClicked: mainWindow.showDialog(calibratePressureDialogComponent, _calibratePressureText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) onClicked: mainWindow.showComponentDialog(calibratePressureDialogComponent, _calibratePressureText, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
readonly property string _calibratePressureText: activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure") readonly property string _calibratePressureText: activeVehicle.fixedWing ? qsTr("Cal Baro/Airspeed") : qsTr("Calibrate Pressure")
} }
...@@ -589,7 +589,7 @@ SetupPage { ...@@ -589,7 +589,7 @@ SetupPage {
text: qsTr("CompassMot") text: qsTr("CompassMot")
visible: activeVehicle ? activeVehicle.supportsMotorInterference : false visible: activeVehicle ? activeVehicle.supportsMotorInterference : false
onClicked: mainWindow.showDialog(compassMotDialogComponent, qsTr("CompassMot - Compass Motor Interference Calibration"), mainWindow.showDialogFullWidth, StandardButton.Cancel | StandardButton.Ok) onClicked: mainWindow.showComponentDialog(compassMotDialogComponent, qsTr("CompassMot - Compass Motor Interference Calibration"), mainWindow.showDialogFullWidth, StandardButton.Cancel | StandardButton.Ok)
} }
QGCButton { QGCButton {
......
...@@ -120,7 +120,7 @@ SetupPage { ...@@ -120,7 +120,7 @@ SetupPage {
id: defaultsButton id: defaultsButton
anchors.left: parent.left anchors.left: parent.left
text: qsTr("Load Vehicle Default Parameters") text: qsTr("Load Vehicle Default Parameters")
onClicked: mainWindow.showDialog(selectParamFileDialogComponent, qsTr("Load Vehicle Default Parameters"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onClicked: mainWindow.showComponentDialog(selectParamFileDialogComponent, qsTr("Load Vehicle Default Parameters"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
} }
......
...@@ -345,7 +345,7 @@ SetupPage { ...@@ -345,7 +345,7 @@ SetupPage {
onClicked: { onClicked: {
if (text === qsTr("Calibrate")) { if (text === qsTr("Calibrate")) {
mainWindow.showDialog(zeroTrimsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) mainWindow.showComponentDialog(zeroTrimsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} else { } else {
controller.nextButtonClicked() controller.nextButtonClicked()
} }
...@@ -405,12 +405,12 @@ SetupPage { ...@@ -405,12 +405,12 @@ SetupPage {
QGCButton { QGCButton {
id: bindButton id: bindButton
text: qsTr("Spektrum Bind") text: qsTr("Spektrum Bind")
onClicked: mainWindow.showDialog(spektrumBindDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) onClicked: mainWindow.showComponentDialog(spektrumBindDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
QGCButton { QGCButton {
text: qsTr("Copy Trims") text: qsTr("Copy Trims")
onClicked: mainWindow.showDialog(copyTrimsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) onClicked: mainWindow.showComponentDialog(copyTrimsDialogComponent, dialogTitle, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
} }
} // Column - Left Column } // Column - Left Column
......
...@@ -65,7 +65,7 @@ SetupPage { ...@@ -65,7 +65,7 @@ SetupPage {
id: controller id: controller
Component.onCompleted: { Component.onCompleted: {
if (controller.showCustomConfigPanel) { if (controller.showCustomConfigPanel) {
mainWindow.showDialog(customConfigDialogComponent, qsTr("Custom Airframe Config"), mainWindow.showDialogDefaultWidth, StandardButton.Reset) mainWindow.showComponentDialog(customConfigDialogComponent, qsTr("Custom Airframe Config"), mainWindow.showDialogDefaultWidth, StandardButton.Reset)
} }
} }
} }
...@@ -131,7 +131,7 @@ Your vehicle will also be restarted in order to complete the process.") ...@@ -131,7 +131,7 @@ Your vehicle will also be restarted in order to complete the process.")
anchors.right: parent.right anchors.right: parent.right
text: qsTr("Apply and Restart") text: qsTr("Apply and Restart")
onClicked: mainWindow.showDialog(applyRestartDialogComponent, qsTr("Apply and Restart"), mainWindow.showDialogDefaultWidth, StandardButton.Apply | StandardButton.Cancel) onClicked: mainWindow.showComponentDialog(applyRestartDialogComponent, qsTr("Apply and Restart"), mainWindow.showDialogDefaultWidth, StandardButton.Apply | StandardButton.Cancel)
} }
} }
......
...@@ -300,7 +300,7 @@ SetupPage { ...@@ -300,7 +300,7 @@ SetupPage {
QGCButton { QGCButton {
id: voltMultCalculateButton id: voltMultCalculateButton
text: qsTr("Calculate") text: qsTr("Calculate")
onClicked: mainWindow.showDialog(calcVoltageDividerDlgComponent, qsTr("Calculate Voltage Divider"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onClicked: mainWindow.showComponentDialog(calcVoltageDividerDlgComponent, qsTr("Calculate Voltage Divider"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
Item { width: 1; height: 1; Layout.columnSpan: 2 } Item { width: 1; height: 1; Layout.columnSpan: 2 }
...@@ -328,7 +328,7 @@ SetupPage { ...@@ -328,7 +328,7 @@ SetupPage {
QGCButton { QGCButton {
id: ampPerVoltCalculateButton id: ampPerVoltCalculateButton
text: qsTr("Calculate") text: qsTr("Calculate")
onClicked: mainWindow.showDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onClicked: mainWindow.showComponentDialog(calcAmpsPerVoltDlgComponent, qsTr("Calculate Amps per Volt"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
Item { width: 1; height: 1; Layout.columnSpan: 2 } Item { width: 1; height: 1; Layout.columnSpan: 2 }
......
...@@ -131,12 +131,12 @@ Item { ...@@ -131,12 +131,12 @@ Item {
onMagCalComplete: { onMagCalComplete: {
setOrientationsDialogShowBoardOrientation = false setOrientationsDialogShowBoardOrientation = false
mainWindow.showDialog(setOrientationsDialogComponent, qsTr("Compass Calibration Complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(setOrientationsDialogComponent, qsTr("Compass Calibration Complete"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
} }
onWaitingForCancelChanged: { onWaitingForCancelChanged: {
if (controller.waitingForCancel) { if (controller.waitingForCancel) {
mainWindow.showDialog(waitForCancelDialogComponent, qsTr("Calibration Cancel"), mainWindow.showDialogDefaultWidth, 0) mainWindow.showComponentDialog(waitForCancelDialogComponent, qsTr("Calibration Cancel"), mainWindow.showDialogDefaultWidth, 0)
} }
} }
} }
...@@ -393,7 +393,7 @@ Item { ...@@ -393,7 +393,7 @@ Item {
onClicked: { onClicked: {
preCalibrationDialogType = "compass" preCalibrationDialogType = "compass"
preCalibrationDialogHelp = compassHelp preCalibrationDialogHelp = compassHelp
mainWindow.showDialog(preCalibrationDialogComponent, qsTr("Calibrate Compass"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(preCalibrationDialogComponent, qsTr("Calibrate Compass"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -407,7 +407,7 @@ Item { ...@@ -407,7 +407,7 @@ Item {
onClicked: { onClicked: {
preCalibrationDialogType = "gyro" preCalibrationDialogType = "gyro"
preCalibrationDialogHelp = gyroHelp preCalibrationDialogHelp = gyroHelp
mainWindow.showDialog(preCalibrationDialogComponent, qsTr("Calibrate Gyro"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(preCalibrationDialogComponent, qsTr("Calibrate Gyro"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -421,7 +421,7 @@ Item { ...@@ -421,7 +421,7 @@ Item {
onClicked: { onClicked: {
preCalibrationDialogType = "accel" preCalibrationDialogType = "accel"
preCalibrationDialogHelp = accelHelp preCalibrationDialogHelp = accelHelp
mainWindow.showDialog(preCalibrationDialogComponent, qsTr("Calibrate Accelerometer"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(preCalibrationDialogComponent, qsTr("Calibrate Accelerometer"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -436,7 +436,7 @@ Item { ...@@ -436,7 +436,7 @@ Item {
onClicked: { onClicked: {
preCalibrationDialogType = "level" preCalibrationDialogType = "level"
preCalibrationDialogHelp = levelHelp preCalibrationDialogHelp = levelHelp
mainWindow.showDialog(preCalibrationDialogComponent, qsTr("Level Horizon"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(preCalibrationDialogComponent, qsTr("Level Horizon"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -454,7 +454,7 @@ Item { ...@@ -454,7 +454,7 @@ Item {
onClicked: { onClicked: {
preCalibrationDialogType = "airspeed" preCalibrationDialogType = "airspeed"
preCalibrationDialogHelp = airspeedHelp preCalibrationDialogHelp = airspeedHelp
mainWindow.showDialog(preCalibrationDialogComponent, qsTr("Calibrate Airspeed"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(preCalibrationDialogComponent, qsTr("Calibrate Airspeed"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -483,7 +483,7 @@ Item { ...@@ -483,7 +483,7 @@ Item {
onClicked: { onClicked: {
setOrientationsDialogShowBoardOrientation = true setOrientationsDialogShowBoardOrientation = true
mainWindow.showDialog(setOrientationsDialogComponent, qsTr("Set Orientations"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(setOrientationsDialogComponent, qsTr("Set Orientations"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
} }
} }
} // Column - Buttons } // Column - Buttons
......
...@@ -33,11 +33,11 @@ QGCTextField { ...@@ -33,11 +33,11 @@ QGCTextField {
_textField.updated() _textField.updated()
} else { } else {
_validateString = text _validateString = text
mainWindow.showDialog(validationErrorDialogComponent, qsTr("Invalid Value"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) mainWindow.showComponentDialog(validationErrorDialogComponent, qsTr("Invalid Value"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
} }
} }
onHelpClicked: mainWindow.showDialog(helpDialogComponent, qsTr("Value Details"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) onHelpClicked: mainWindow.showComponentDialog(helpDialogComponent, qsTr("Value Details"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
Component { Component {
id: validationErrorDialogComponent id: validationErrorDialogComponent
......
...@@ -97,7 +97,7 @@ Rectangle { ...@@ -97,7 +97,7 @@ Rectangle {
onClicked: { onClicked: {
valueListView.focus = true valueListView.focus = true
if (_currentIndex === index) { if (_currentIndex === index) {
mainWindow.showDialog(editDialogComponent, qsTr("Value Details"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) mainWindow.showComponentDialog(editDialogComponent, qsTr("Value Details"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
} else { } else {
_currentIndex = index _currentIndex = index
valueListView.positionViewAtIndex(_currentIndex, ListView.Center) valueListView.positionViewAtIndex(_currentIndex, ListView.Center)
......
...@@ -162,7 +162,7 @@ Item { ...@@ -162,7 +162,7 @@ Item {
if (promptForMissionRemove && (_missionController.containsItems || _geoFenceController.containsItems || _rallyPointController.containsItems)) { if (promptForMissionRemove && (_missionController.containsItems || _geoFenceController.containsItems || _rallyPointController.containsItems)) {
// ArduPilot has a strange bug which prevents mission clear from working at certain times, so we can't show this dialog // ArduPilot has a strange bug which prevents mission clear from working at certain times, so we can't show this dialog
if (!activeVehicle.apmFirmware) { if (!activeVehicle.apmFirmware) {
mainWindow.showDialog(missionCompleteDialogComponent, qsTr("Flight Plan complete"), mainWindow.showDialogDefaultWidth, StandardButton.Close) mainWindow.showComponentDialog(missionCompleteDialogComponent, qsTr("Flight Plan complete"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
} }
promptForMissionRemove = false promptForMissionRemove = false
......
...@@ -65,7 +65,7 @@ Map { ...@@ -65,7 +65,7 @@ Map {
} }
function centerToSpecifiedLocation() { function centerToSpecifiedLocation() {
mainWindow.showDialog(specifyMapPositionDialog, qsTr("Specify Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close) mainWindow.showComponentDialog(specifyMapPositionDialog, qsTr("Specify Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
Component { Component {
......
...@@ -50,7 +50,7 @@ Column { ...@@ -50,7 +50,7 @@ Column {
property int _curCameraIndex: _dynamicCameras ? _dynamicCameras.currentCamera : 0 property int _curCameraIndex: _dynamicCameras ? _dynamicCameras.currentCamera : 0
function showSettings() { function showSettings() {
mainWindow.showDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok) mainWindow.showComponentDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok)
} }
//-- Dumb camera trigger if no actual camera interface exists //-- Dumb camera trigger if no actual camera interface exists
......
...@@ -37,7 +37,7 @@ Column { ...@@ -37,7 +37,7 @@ Column {
} }
function showSettings() { function showSettings() {
mainWindow.showDialog(propertyPicker, qsTr("Value Widget Setup"), mainWindow.showDialogDefaultWidth, StandardButton.Ok) mainWindow.showComponentDialog(propertyPicker, qsTr("Value Widget Setup"), mainWindow.showDialogDefaultWidth, StandardButton.Ok)
} }
function listContains(list, value) { function listContains(list, value) {
......
...@@ -235,13 +235,13 @@ Item { ...@@ -235,13 +235,13 @@ Item {
MenuItem { MenuItem {
text: qsTr("Edit position..." ) text: qsTr("Edit position..." )
visible: _circle visible: _circle
onTriggered: mainWindow.showDialog(editCenterPositionDialog, qsTr("Edit Center Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onTriggered: mainWindow.showComponentDialog(editCenterPositionDialog, qsTr("Edit Center Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
MenuItem { MenuItem {
text: qsTr("Edit position..." ) text: qsTr("Edit position..." )
visible: !_circle && menu._editingVertexIndex >= 0 visible: !_circle && menu._editingVertexIndex >= 0
onTriggered: mainWindow.showDialog(editVertexPositionDialog, qsTr("Edit Vertex Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onTriggered: mainWindow.showComponentDialog(editVertexPositionDialog, qsTr("Edit Vertex Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
MenuItem { MenuItem {
......
...@@ -148,7 +148,7 @@ Item { ...@@ -148,7 +148,7 @@ Item {
MenuItem { MenuItem {
text: qsTr("Edit position..." ) text: qsTr("Edit position..." )
onTriggered: mainWindow.showDialog(editPositionDialog, qsTr("Edit Position"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel) onTriggered: mainWindow.showComponentDialog(editPositionDialog, qsTr("Edit Position"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
} }
MenuItem { MenuItem {
......
...@@ -146,7 +146,7 @@ Rectangle { ...@@ -146,7 +146,7 @@ Rectangle {
MenuItem { MenuItem {
text: qsTr("Edit position...") text: qsTr("Edit position...")
visible: missionItem.specifiesCoordinate visible: missionItem.specifiesCoordinate
onTriggered: mainWindow.showDialog(editPositionDialog, qsTr("Edit Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onTriggered: mainWindow.showComponentDialog(editPositionDialog, qsTr("Edit Position"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
MenuSeparator { MenuSeparator {
...@@ -193,7 +193,7 @@ Rectangle { ...@@ -193,7 +193,7 @@ Rectangle {
} }
} }
onClicked: mainWindow.showDialog(commandDialog, qsTr("Select Mission Command"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel) onClicked: mainWindow.showComponentDialog(commandDialog, qsTr("Select Mission Command"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
} }
QGCLabel { QGCLabel {
......
...@@ -118,7 +118,7 @@ Item { ...@@ -118,7 +118,7 @@ Item {
target: _appSettings ? _appSettings.defaultMissionItemAltitude : null target: _appSettings ? _appSettings.defaultMissionItemAltitude : null
onRawValueChanged: { onRawValueChanged: {
if (_visualItems.count > 1) { if (_visualItems.count > 1) {
mainWindow.showDialog(applyNewAltitude, qsTr("Apply new alititude"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) mainWindow.showComponentDialog(applyNewAltitude, qsTr("Apply new alititude"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
} }
} }
} }
...@@ -195,7 +195,7 @@ Item { ...@@ -195,7 +195,7 @@ Item {
return return
} }
if (activeVehicle && activeVehicle.armed && activeVehicle.flightMode === activeVehicle.missionFlightMode) { if (activeVehicle && activeVehicle.armed && activeVehicle.flightMode === activeVehicle.missionFlightMode) {
mainWindow.showDialog(activeMissionUploadDialogComponent, qsTr("Plan Upload"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel) mainWindow.showComponentDialog(activeMissionUploadDialogComponent, qsTr("Plan Upload"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
} else { } else {
sendToVehicle() sendToVehicle()
} }
...@@ -320,7 +320,7 @@ Item { ...@@ -320,7 +320,7 @@ Item {
insertComplexMissionItemFromKMLOrSHP(_missionController.surveyComplexItemName, file, -1) insertComplexMissionItemFromKMLOrSHP(_missionController.surveyComplexItemName, file, -1)
} else { } else {
polygonSelectPatternFile = file polygonSelectPatternFile = file
mainWindow.showDialog(patternPolygonSelectDialog, fileDialog.title, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) mainWindow.showComponentDialog(patternPolygonSelectDialog, fileDialog.title, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
} else if (retList[0] == ShapeFileHelper.Polyline) { } else if (retList[0] == ShapeFileHelper.Polyline) {
insertComplexMissionItemFromKMLOrSHP(_missionController.corridorScanComplexItemName, file, -1) insertComplexMissionItemFromKMLOrSHP(_missionController.corridorScanComplexItemName, file, -1)
...@@ -988,7 +988,7 @@ Item { ...@@ -988,7 +988,7 @@ Item {
enabled: _planMasterController.containsItems enabled: _planMasterController.containsItems
onClicked: { onClicked: {
dropPanel.hide() dropPanel.hide()
mainWindow.showDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) mainWindow.showComponentDialog(removeAllPromptDialog, qsTr("New Plan"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
} }
} }
...@@ -999,7 +999,7 @@ Item { ...@@ -999,7 +999,7 @@ Item {
onClicked: { onClicked: {
dropPanel.hide() dropPanel.hide()
if (_planMasterController.dirty) { if (_planMasterController.dirty) {
mainWindow.showDialog(syncLoadFromFileOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) mainWindow.showComponentDialog(syncLoadFromFileOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else { } else {
_planMasterController.loadFromSelectedFile() _planMasterController.loadFromSelectedFile()
} }
...@@ -1037,7 +1037,7 @@ Item { ...@@ -1037,7 +1037,7 @@ Item {
onClicked: { onClicked: {
// First point does not count // First point does not count
if (_visualItems.count < 2) { if (_visualItems.count < 2) {
mainWindow.showDialog(noItemForKML, qsTr("KML"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel) mainWindow.showComponentDialog(noItemForKML, qsTr("KML"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
return return
} }
dropPanel.hide() dropPanel.hide()
...@@ -1074,7 +1074,7 @@ Item { ...@@ -1074,7 +1074,7 @@ Item {
onClicked: { onClicked: {
dropPanel.hide() dropPanel.hide()
if (_planMasterController.dirty) { if (_planMasterController.dirty) {
mainWindow.showDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) mainWindow.showComponentDialog(syncLoadFromVehicleOverwrite, columnHolder._overwriteText, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} else { } else {
_planMasterController.loadFromVehicle() _planMasterController.loadFromVehicle()
} }
...@@ -1089,7 +1089,7 @@ Item { ...@@ -1089,7 +1089,7 @@ Item {
visible: !QGroundControl.corePlugin.options.disableVehicleConnection visible: !QGroundControl.corePlugin.options.disableVehicleConnection
onClicked: { onClicked: {
dropPanel.hide() dropPanel.hide()
mainWindow.showDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) mainWindow.showComponentDialog(clearVehicleMissionDialog, text, mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel)
} }
} }
......
...@@ -91,7 +91,7 @@ Rectangle { ...@@ -91,7 +91,7 @@ Rectangle {
if (index == _indexCustom) { if (index == _indexCustom) {
missionItem.clearCurrentPreset() missionItem.clearCurrentPreset()
} else if (index == _indexCreate) { } else if (index == _indexCreate) {
mainWindow.showDialog(savePresetDialog, qsTr("Save Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) mainWindow.showComponentDialog(savePresetDialog, qsTr("Save Preset"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
} else if (index == _indexDelete) { } else if (index == _indexDelete) {
if (missionItem.builtInPreset) { if (missionItem.builtInPreset) {
mainWindow.showMessage(qsTr("Delete Preset"), qsTr("This preset cannot be deleted."), StandardButton.Ok) mainWindow.showMessage(qsTr("Delete Preset"), qsTr("This preset cannot be deleted."), StandardButton.Ok)
......
...@@ -189,7 +189,7 @@ Item { ...@@ -189,7 +189,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
text: qsTr("Set Logging") text: qsTr("Set Logging")
onClicked: mainWindow.showDialog(filtersDialogComponent, qsTr("Turn on logging categories"), mainWindow.showDialogDefaultWidth, StandardButton.Close) onClicked: mainWindow.showComponentDialog(filtersDialogComponent, qsTr("Turn on logging categories"), mainWindow.showDialogDefaultWidth, StandardButton.Close)
} }
} }
} }
......
...@@ -16,7 +16,7 @@ Rectangle { ...@@ -16,7 +16,7 @@ Rectangle {
function pickLogFile() { function pickLogFile() {
if (mainWindow.activeVehicle) { if (mainWindow.activeVehicle) {
mainWindow.showMessageDialog(qsTr("Log Replay"), qsTr("You must close all connections prior to replaying a log."), StandardButton.Ok) mainWindow.showMessageDialog(qsTr("Log Replay"), qsTr("You must close all connections prior to replaying a log."))
return return
} }
......
...@@ -34,7 +34,7 @@ Item { ...@@ -34,7 +34,7 @@ Item {
ParameterEditorController { ParameterEditorController {
id: controller; id: controller;
onShowErrorMessage: { onShowErrorMessage: {
mainWindow.showMessageDialog(qsTr("Parameter Load Errors")) mainWindow.showMessageDialog(qsTr("Parameter Editor"), qsTr("Parameter Load Errors"))
} }
} }
...@@ -110,12 +110,12 @@ Item { ...@@ -110,12 +110,12 @@ Item {
MenuItem { MenuItem {
text: qsTr("Reset all to firmware's defaults") text: qsTr("Reset all to firmware's defaults")
visible: !activeVehicle.apmFirmware visible: !activeVehicle.apmFirmware
onTriggered: mainWindow.showDialog(resetToDefaultConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset) onTriggered: mainWindow.showComponentDialog(resetToDefaultConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset)
} }
MenuItem { MenuItem {
text: qsTr("Reset to vehicle's configuration defaults") text: qsTr("Reset to vehicle's configuration defaults")
visible: !activeVehicle.apmFirmware visible: !activeVehicle.apmFirmware
onTriggered: mainWindow.showDialog(resetToVehicleConfigurationConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset) onTriggered: mainWindow.showComponentDialog(resetToVehicleConfigurationConfirmComponent, qsTr("Reset All"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Reset)
} }
MenuSeparator { } MenuSeparator { }
MenuItem { MenuItem {
...@@ -143,7 +143,7 @@ Item { ...@@ -143,7 +143,7 @@ Item {
MenuSeparator { } MenuSeparator { }
MenuItem { MenuItem {
text: qsTr("Reboot Vehicle") text: qsTr("Reboot Vehicle")
onTriggered: mainWindow.showDialog(rebootVehicleConfirmComponent, qsTr("Reboot Vehicle"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) onTriggered: mainWindow.showComponentDialog(rebootVehicleConfirmComponent, qsTr("Reboot Vehicle"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} }
} }
...@@ -280,7 +280,7 @@ Item { ...@@ -280,7 +280,7 @@ Item {
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
onClicked: { onClicked: {
_editorDialogFact = factRow.modelFact _editorDialogFact = factRow.modelFact
mainWindow.showDialog(editorDialogComponent, qsTr("Parameter Editor"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Save) mainWindow.showComponentDialog(editorDialogComponent, qsTr("Parameter Editor"), mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Save)
} }
} }
} }
......
...@@ -43,7 +43,7 @@ Item { ...@@ -43,7 +43,7 @@ Item {
function openForLoad() { function openForLoad() {
_openForLoad = true _openForLoad = true
if (_mobileDlg && folder.length !== 0) { if (_mobileDlg && folder.length !== 0) {
mainWindow.showDialog(mobileFileOpenDialog, title, mainWindow.showDialogDefaultWidth, StandardButton.Cancel) mainWindow.showComponentDialog(mobileFileOpenDialog, title, mainWindow.showDialogDefaultWidth, StandardButton.Cancel)
} else { } else {
fullFileDialog.open() fullFileDialog.open()
} }
...@@ -52,7 +52,7 @@ Item { ...@@ -52,7 +52,7 @@ Item {
function openForSave() { function openForSave() {
_openForLoad = false _openForLoad = false
if (_mobileDlg && folder.length !== 0) { if (_mobileDlg && folder.length !== 0) {
mainWindow.showDialog(mobileFileSaveDialog, title, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok) mainWindow.showComponentDialog(mobileFileSaveDialog, title, mainWindow.showDialogDefaultWidth, StandardButton.Cancel | StandardButton.Ok)
} else { } else {
fullFileDialog.open() fullFileDialog.open()
} }
......
...@@ -536,7 +536,7 @@ Item { ...@@ -536,7 +536,7 @@ Item {
QGCButton { QGCButton {
text: qsTr("Delete") text: qsTr("Delete")
width: ScreenTools.defaultFontPixelWidth * (infoView._extraButton ? 6 : 10) width: ScreenTools.defaultFontPixelWidth * (infoView._extraButton ? 6 : 10)
onClicked: mainWindow.showDialog(deleteConfirmationDialogComponent, qsTr("Confirm Delete"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) onClicked: mainWindow.showComponentDialog(deleteConfirmationDialogComponent, qsTr("Confirm Delete"), mainWindow.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No)
} }
QGCButton { QGCButton {
text: qsTr("Ok") text: qsTr("Ok")
...@@ -1014,7 +1014,7 @@ Item { ...@@ -1014,7 +1014,7 @@ Item {
QGCButton { QGCButton {
text: qsTr("Options") text: qsTr("Options")
width: _buttonSize width: _buttonSize
onClicked: mainWindow.showDialog(optionsDialogComponent, qsTr("Offline Maps Options"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) onClicked: mainWindow.showComponentDialog(optionsDialogComponent, qsTr("Offline Maps Options"), mainWindow.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel)
} }
} }
......
...@@ -136,7 +136,7 @@ SetupPage { ...@@ -136,7 +136,7 @@ SetupPage {
// We end up here when we detect a board plugged in after we've started upgrade // We end up here when we detect a board plugged in after we've started upgrade
statusTextArea.append(highlightPrefix + qsTr("Found device") + highlightSuffix + ": " + controller.boardType) statusTextArea.append(highlightPrefix + qsTr("Found device") + highlightSuffix + ": " + controller.boardType)
if (controller.pixhawkBoard || controller.px4FlowBoard) { if (controller.pixhawkBoard || controller.px4FlowBoard) {
mainWindow.showDialog(pixhawkFirmwareSelectDialogComponent, title, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel) mainWindow.showComponentDialog(pixhawkFirmwareSelectDialogComponent, title, mainWindow.showDialogDefaultWidth, StandardButton.Ok | StandardButton.Cancel)
} }
} }
} }
......
...@@ -131,8 +131,8 @@ ApplicationWindow { ...@@ -131,8 +131,8 @@ ApplicationWindow {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Global complex dialog //-- Global complex dialog
/// Shows a QGCViewDialog component /// Shows a QGCViewDialogContainer based dialog
/// @param component QGCViewDialog component /// @param component The dialog contents
/// @param title Title for dialog /// @param title Title for dialog
/// @param charWidth Width of dialog in characters /// @param charWidth Width of dialog in characters
/// @param buttons Buttons to show in dialog using StandardButton enum /// @param buttons Buttons to show in dialog using StandardButton enum
...@@ -140,7 +140,7 @@ ApplicationWindow { ...@@ -140,7 +140,7 @@ ApplicationWindow {
readonly property int showDialogFullWidth: -1 ///< Use for full width dialog readonly property int showDialogFullWidth: -1 ///< Use for full width dialog
readonly property int showDialogDefaultWidth: 40 ///< Use for default dialog width readonly property int showDialogDefaultWidth: 40 ///< Use for default dialog width
function showDialog(component, title, charWidth, buttons) { function showComponentDialog(component, title, charWidth, buttons) {
var dialogWidth = charWidth === showDialogFullWidth ? mainWindow.width : ScreenTools.defaultFontPixelWidth * charWidth var dialogWidth = charWidth === showDialogFullWidth ? mainWindow.width : ScreenTools.defaultFontPixelWidth * charWidth
mainWindowDialog.width = dialogWidth mainWindowDialog.width = dialogWidth
mainWindowDialog.dialogComponent = component mainWindowDialog.dialogComponent = component
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment