|
|
@ -38,6 +38,9 @@ ApplicationWindow { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property var _rgPreventViewSwitch: [ false ] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5 |
|
|
|
readonly property real _topBottomMargins: ScreenTools.defaultFontPixelHeight * 0.5 |
|
|
|
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl |
|
|
|
readonly property string _mainToolbar: QGroundControl.corePlugin.options.mainToolbarUrl |
|
|
|
readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl |
|
|
|
readonly property string _planToolbar: QGroundControl.corePlugin.options.planToolbarUrl |
|
|
@ -49,7 +52,6 @@ ApplicationWindow { |
|
|
|
property bool communicationLost: activeVehicle ? activeVehicle.connectionLost : false |
|
|
|
property bool communicationLost: activeVehicle ? activeVehicle.connectionLost : false |
|
|
|
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : "" |
|
|
|
property string formatedMessage: activeVehicle ? activeVehicle.formatedMessage : "" |
|
|
|
property real availableHeight: mainWindow.height - mainWindow.header.height - mainWindow.footer.height |
|
|
|
property real availableHeight: mainWindow.height - mainWindow.header.height - mainWindow.footer.height |
|
|
|
property bool preventViewSwitch: false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property var currentPlanMissionItem: planMasterControllerPlan ? planMasterControllerPlan.missionController.currentPlanViewItem : null |
|
|
|
property var currentPlanMissionItem: planMasterControllerPlan ? planMasterControllerPlan.missionController.currentPlanViewItem : null |
|
|
|
property var planMasterControllerPlan: null |
|
|
|
property var planMasterControllerPlan: null |
|
|
@ -73,6 +75,25 @@ ApplicationWindow { |
|
|
|
//------------------------------------------------------------------------- |
|
|
|
//------------------------------------------------------------------------- |
|
|
|
//-- Global Scope Functions |
|
|
|
//-- Global Scope Functions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Prevent view switching |
|
|
|
|
|
|
|
function pushPreventViewSwitch() { |
|
|
|
|
|
|
|
_rgPreventViewSwitch.push(true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Allow view switching |
|
|
|
|
|
|
|
function popPreventViewSwitch() { |
|
|
|
|
|
|
|
if (_rgPreventViewSwitch.length == 1) { |
|
|
|
|
|
|
|
console.warning("mainWindow.popPreventViewSwitch called when nothing pushed") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_rgPreventViewSwitch.pop() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// @return true: View switches are not currently allowed |
|
|
|
|
|
|
|
function preventViewSwitch() { |
|
|
|
|
|
|
|
return _rgPreventViewSwitch[_rgPreventViewSwitch.length - 1] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function viewSwitch(isPlanView) { |
|
|
|
function viewSwitch(isPlanView) { |
|
|
|
settingsWindow.visible = false |
|
|
|
settingsWindow.visible = false |
|
|
|
setupWindow.visible = false |
|
|
|
setupWindow.visible = false |
|
|
@ -152,8 +173,7 @@ ApplicationWindow { |
|
|
|
mainWindowDialog.dialogComponent = component |
|
|
|
mainWindowDialog.dialogComponent = component |
|
|
|
mainWindowDialog.dialogTitle = title |
|
|
|
mainWindowDialog.dialogTitle = title |
|
|
|
mainWindowDialog.dialogButtons = buttons |
|
|
|
mainWindowDialog.dialogButtons = buttons |
|
|
|
console.log("Prevent view switch") |
|
|
|
mainWindow.pushPreventViewSwitch() |
|
|
|
mainWindow.preventViewSwitch = true |
|
|
|
|
|
|
|
mainWindowDialog.open() |
|
|
|
mainWindowDialog.open() |
|
|
|
if (buttons & StandardButton.Cancel || buttons & StandardButton.Close || buttons & StandardButton.Discard || buttons & StandardButton.Abort || buttons & StandardButton.Ignore) { |
|
|
|
if (buttons & StandardButton.Cancel || buttons & StandardButton.Close || buttons & StandardButton.Discard || buttons & StandardButton.Abort || buttons & StandardButton.Ignore) { |
|
|
|
mainWindowDialog.closePolicy = Popup.NoAutoClose; |
|
|
|
mainWindowDialog.closePolicy = Popup.NoAutoClose; |
|
|
@ -188,7 +208,7 @@ ApplicationWindow { |
|
|
|
} |
|
|
|
} |
|
|
|
onClosed: { |
|
|
|
onClosed: { |
|
|
|
console.log("View switch ok") |
|
|
|
console.log("View switch ok") |
|
|
|
mainWindow.preventViewSwitch = false |
|
|
|
mainWindow.popPreventViewSwitch() |
|
|
|
dlgLoader.source = "" |
|
|
|
dlgLoader.source = "" |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|