Commit cc54a4e0 authored by Gus Grubba's avatar Gus Grubba

For whatever reason, showing the dialog through a function causes a crash in...

For whatever reason, showing the dialog through a function causes a crash in QML (undebugable--new word!)
parent dea6998a
...@@ -573,7 +573,8 @@ QGCView { ...@@ -573,7 +573,8 @@ QGCView {
/// Close all dialogs /// Close all dialogs
function closeAll() { function closeAll() {
mainWindow.resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
guidedActionConfirm.visible = false guidedActionConfirm.visible = false
guidedActionList.visible = false guidedActionList.visible = false
altitudeSlider.visible = false altitudeSlider.visible = false
......
...@@ -958,7 +958,7 @@ QGCView { ...@@ -958,7 +958,7 @@ QGCView {
visible: !ScreenTools.isMobile visible: !ScreenTools.isMobile
onClicked: { onClicked: {
QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone
mainWindow.showCustomDialog(importDialog) rootLoader.sourceComponent = importDialog
} }
} }
QGCButton { QGCButton {
...@@ -1032,7 +1032,7 @@ QGCView { ...@@ -1032,7 +1032,7 @@ QGCView {
onClicked: { onClicked: {
showList(); showList();
if(QGroundControl.mapEngineManager.exportSets()) { if(QGroundControl.mapEngineManager.exportSets()) {
mainWindow.showCustomDialog(exportToDiskProgress) rootLoader.sourceComponent = exportToDiskProgress
} }
} }
} }
...@@ -1090,7 +1090,8 @@ QGCView { ...@@ -1090,7 +1090,8 @@ QGCView {
visible: !QGroundControl.mapEngineManager.exporting visible: !QGroundControl.mapEngineManager.exporting
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
} }
...@@ -1173,7 +1174,8 @@ QGCView { ...@@ -1173,7 +1174,8 @@ QGCView {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
onClicked: { onClicked: {
showList(); showList();
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
Row { Row {
...@@ -1186,7 +1188,8 @@ QGCView { ...@@ -1186,7 +1188,8 @@ QGCView {
onClicked: { onClicked: {
if(!QGroundControl.mapEngineManager.importSets()) { if(!QGroundControl.mapEngineManager.importSets()) {
showList(); showList();
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
} }
...@@ -1195,7 +1198,8 @@ QGCView { ...@@ -1195,7 +1198,8 @@ QGCView {
width: _bigButtonSize * 1.25 width: _bigButtonSize * 1.25
onClicked: { onClicked: {
showList(); showList();
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
} }
......
...@@ -63,7 +63,8 @@ Item { ...@@ -63,7 +63,8 @@ Item {
} }
function showSettingsView() { function showSettingsView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
...@@ -78,7 +79,8 @@ Item { ...@@ -78,7 +79,8 @@ Item {
} }
function showSetupView() { function showSetupView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
...@@ -93,7 +95,8 @@ Item { ...@@ -93,7 +95,8 @@ Item {
} }
function showPlanView() { function showPlanView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
...@@ -107,7 +110,8 @@ Item { ...@@ -107,7 +110,8 @@ Item {
} }
function showFlyView() { function showFlyView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
...@@ -118,7 +122,8 @@ Item { ...@@ -118,7 +122,8 @@ Item {
} }
function showAnalyzeView() { function showAnalyzeView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
...@@ -148,20 +153,6 @@ Item { ...@@ -148,20 +153,6 @@ Item {
} }
} }
function showCustomDialog(dlg) {
rootLoader.sourceComponent = dlg
}
function closeCustomDialog() {
mainWindow.enableToolbar()
rootLoader.sourceComponent = null
}
function resetCustomDialog() {
rootLoader.sourceComponent = null
mainWindow.enableToolbar()
}
MessageDialog { MessageDialog {
id: unsavedMissionCloseDialog id: unsavedMissionCloseDialog
title: qsTr("%1 close").arg(QGroundControl.appName) title: qsTr("%1 close").arg(QGroundControl.appName)
...@@ -237,7 +228,8 @@ Item { ...@@ -237,7 +228,8 @@ Item {
} }
function showMessageArea() { function showMessageArea() {
mainWindow.resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
var currentlyVisible = messageArea.visible var currentlyVisible = messageArea.visible
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
...@@ -258,7 +250,8 @@ Item { ...@@ -258,7 +250,8 @@ Item {
} }
function showPopUp(dropItem, centerX) { function showPopUp(dropItem, centerX) {
mainWindow.resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
var oldIndicator = indicatorDropdown.sourceComponent var oldIndicator = indicatorDropdown.sourceComponent
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
......
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