Browse Source

For whatever reason, showing the dialog through a function causes a crash in QML (undebugable--new word!)

QGC4.4
Gus Grubba 8 years ago
parent
commit
cc54a4e05c
  1. 3
      src/FlightDisplay/FlightDisplayView.qml
  2. 16
      src/QtLocationPlugin/QMLControl/OfflineMap.qml
  3. 35
      src/ui/MainWindowInner.qml

3
src/FlightDisplay/FlightDisplayView.qml

@ -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

16
src/QtLocationPlugin/QMLControl/OfflineMap.qml

@ -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 {
onClicked: { onClicked: {
showList(); showList();
if(QGroundControl.mapEngineManager.exportSets()) { if(QGroundControl.mapEngineManager.exportSets()) {
mainWindow.showCustomDialog(exportToDiskProgress) rootLoader.sourceComponent = exportToDiskProgress
} }
} }
} }
@ -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 {
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 {
onClicked: { onClicked: {
if(!QGroundControl.mapEngineManager.importSets()) { if(!QGroundControl.mapEngineManager.importSets()) {
showList(); showList();
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
} }
@ -1195,7 +1198,8 @@ QGCView {
width: _bigButtonSize * 1.25 width: _bigButtonSize * 1.25
onClicked: { onClicked: {
showList(); showList();
mainWindow.closeCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
} }
} }
} }

35
src/ui/MainWindowInner.qml

@ -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 {
} }
function showSetupView() { function showSetupView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
@ -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 {
} }
function showFlyView() { function showFlyView() {
resetCustomDialog() mainWindow.enableToolbar()
rootLoader.sourceComponent = null
if(currentPopUp) { if(currentPopUp) {
currentPopUp.close() currentPopUp.close()
} }
@ -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 {
} }
} }
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 {
} }
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 {
} }
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()

Loading…
Cancel
Save