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