diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml index a3adf9bab238936a8b616dd1ddcda85f9e1fb264..353dc7a6fdf44648d9732b0173c14990ba6768d8 100644 --- a/src/FlightDisplay/FlightDisplayView.qml +++ b/src/FlightDisplay/FlightDisplayView.qml @@ -573,7 +573,7 @@ QGCView { /// Close all dialogs function closeAll() { - rootLoader.sourceComponent = null + mainWindow.resetCustomDialog() guidedActionConfirm.visible = false guidedActionList.visible = false altitudeSlider.visible = false diff --git a/src/QtLocationPlugin/QGCMapEngine.cpp b/src/QtLocationPlugin/QGCMapEngine.cpp index 89af8db4260c9039a8256ac85c07751ed41ff52a..571ce692733ca1b520e30b3a0c3455dbe204303a 100644 --- a/src/QtLocationPlugin/QGCMapEngine.cpp +++ b/src/QtLocationPlugin/QGCMapEngine.cpp @@ -500,7 +500,10 @@ QGCMapEngine::testInternet() void QGCMapEngine::_internetStatus(bool active) { - _isInternetActive = active; + if(_isInternetActive != active) { + _isInternetActive = active; + emit internetUpdated(); + } } // Resolution math: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#Resolution_and_Scale diff --git a/src/QtLocationPlugin/QGCMapEngine.h b/src/QtLocationPlugin/QGCMapEngine.h index 271bc8ec0777692e4eac5fd1c4d5e627204707a0..e0fd28036ce5dc4cabd1bec0383f5708878d4b0a 100644 --- a/src/QtLocationPlugin/QGCMapEngine.h +++ b/src/QtLocationPlugin/QGCMapEngine.h @@ -107,6 +107,7 @@ private slots: signals: void updateTotals (quint32 totaltiles, quint64 totalsize, quint32 defaulttiles, quint64 defaultsize); + void internetUpdated (); private: void _wipeOldCaches (); diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index aa262b05065461bf57b87510f945ef24f8ac149d..97ba8e0a8f81500813a8cce293693685590ba73c 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -958,7 +958,7 @@ QGCView { visible: !ScreenTools.isMobile onClicked: { QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone - rootLoader.sourceComponent = importDialog + mainWindow.showCustomDialog(importDialog) } } QGCButton { @@ -1032,7 +1032,7 @@ QGCView { onClicked: { showList(); if(QGroundControl.mapEngineManager.exportSets()) { - rootLoader.sourceComponent = exportToDiskProgress + mainWindow.showCustomDialog(exportToDiskProgress) } } } @@ -1090,7 +1090,7 @@ QGCView { visible: !QGroundControl.mapEngineManager.exporting anchors.horizontalCenter: parent.horizontalCenter onClicked: { - rootLoader.sourceComponent = null + mainWindow.closeCustomDialog() } } } @@ -1173,7 +1173,7 @@ QGCView { anchors.horizontalCenter: parent.horizontalCenter onClicked: { showList(); - rootLoader.sourceComponent = null + mainWindow.closeCustomDialog() } } Row { @@ -1186,7 +1186,7 @@ QGCView { onClicked: { if(!QGroundControl.mapEngineManager.importSets()) { showList(); - rootLoader.sourceComponent = null + mainWindow.closeCustomDialog() } } } @@ -1195,7 +1195,7 @@ QGCView { width: _bigButtonSize * 1.25 onClicked: { showList(); - rootLoader.sourceComponent = null + mainWindow.closeCustomDialog() } } } diff --git a/src/ui/MainWindowInner.qml b/src/ui/MainWindowInner.qml index c9c25a9113d59a6dbe077229670cfc6c982c4229..31936d81b43a80a9f3806f2536650dc41e8d3f35 100644 --- a/src/ui/MainWindowInner.qml +++ b/src/ui/MainWindowInner.qml @@ -63,7 +63,7 @@ Item { } function showSettingsView() { - rootLoader.sourceComponent = null + resetCustomDialog() if(currentPopUp) { currentPopUp.close() } @@ -78,7 +78,7 @@ Item { } function showSetupView() { - rootLoader.sourceComponent = null + resetCustomDialog() if(currentPopUp) { currentPopUp.close() } @@ -93,7 +93,7 @@ Item { } function showPlanView() { - rootLoader.sourceComponent = null + resetCustomDialog() if(currentPopUp) { currentPopUp.close() } @@ -107,7 +107,7 @@ Item { } function showFlyView() { - rootLoader.sourceComponent = null + resetCustomDialog() if(currentPopUp) { currentPopUp.close() } @@ -118,7 +118,7 @@ Item { } function showAnalyzeView() { - rootLoader.sourceComponent = null + resetCustomDialog() if(currentPopUp) { currentPopUp.close() } @@ -148,6 +148,20 @@ 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) @@ -223,7 +237,7 @@ Item { } function showMessageArea() { - rootLoader.sourceComponent = null + mainWindow.resetCustomDialog() var currentlyVisible = messageArea.visible if(currentPopUp) { currentPopUp.close() @@ -244,7 +258,7 @@ Item { } function showPopUp(dropItem, centerX) { - rootLoader.sourceComponent = null + mainWindow.resetCustomDialog() var oldIndicator = indicatorDropdown.sourceComponent if(currentPopUp) { currentPopUp.close()