Browse Source

Make custom dialog into a function

Internet available now has a signal
QGC4.4
Gus Grubba 8 years ago
parent
commit
9f4d98a55f
  1. 2
      src/FlightDisplay/FlightDisplayView.qml
  2. 5
      src/QtLocationPlugin/QGCMapEngine.cpp
  3. 1
      src/QtLocationPlugin/QGCMapEngine.h
  4. 12
      src/QtLocationPlugin/QMLControl/OfflineMap.qml
  5. 28
      src/ui/MainWindowInner.qml

2
src/FlightDisplay/FlightDisplayView.qml

@ -573,7 +573,7 @@ QGCView { @@ -573,7 +573,7 @@ QGCView {
/// Close all dialogs
function closeAll() {
rootLoader.sourceComponent = null
mainWindow.resetCustomDialog()
guidedActionConfirm.visible = false
guidedActionList.visible = false
altitudeSlider.visible = false

5
src/QtLocationPlugin/QGCMapEngine.cpp

@ -500,7 +500,10 @@ QGCMapEngine::testInternet() @@ -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

1
src/QtLocationPlugin/QGCMapEngine.h

@ -107,6 +107,7 @@ private slots: @@ -107,6 +107,7 @@ private slots:
signals:
void updateTotals (quint32 totaltiles, quint64 totalsize, quint32 defaulttiles, quint64 defaultsize);
void internetUpdated ();
private:
void _wipeOldCaches ();

12
src/QtLocationPlugin/QMLControl/OfflineMap.qml

@ -958,7 +958,7 @@ QGCView { @@ -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 { @@ -1032,7 +1032,7 @@ QGCView {
onClicked: {
showList();
if(QGroundControl.mapEngineManager.exportSets()) {
rootLoader.sourceComponent = exportToDiskProgress
mainWindow.showCustomDialog(exportToDiskProgress)
}
}
}
@ -1090,7 +1090,7 @@ QGCView { @@ -1090,7 +1090,7 @@ QGCView {
visible: !QGroundControl.mapEngineManager.exporting
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
rootLoader.sourceComponent = null
mainWindow.closeCustomDialog()
}
}
}
@ -1173,7 +1173,7 @@ QGCView { @@ -1173,7 +1173,7 @@ QGCView {
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
showList();
rootLoader.sourceComponent = null
mainWindow.closeCustomDialog()
}
}
Row {
@ -1186,7 +1186,7 @@ QGCView { @@ -1186,7 +1186,7 @@ QGCView {
onClicked: {
if(!QGroundControl.mapEngineManager.importSets()) {
showList();
rootLoader.sourceComponent = null
mainWindow.closeCustomDialog()
}
}
}
@ -1195,7 +1195,7 @@ QGCView { @@ -1195,7 +1195,7 @@ QGCView {
width: _bigButtonSize * 1.25
onClicked: {
showList();
rootLoader.sourceComponent = null
mainWindow.closeCustomDialog()
}
}
}

28
src/ui/MainWindowInner.qml

@ -63,7 +63,7 @@ Item { @@ -63,7 +63,7 @@ Item {
}
function showSettingsView() {
rootLoader.sourceComponent = null
resetCustomDialog()
if(currentPopUp) {
currentPopUp.close()
}
@ -78,7 +78,7 @@ Item { @@ -78,7 +78,7 @@ Item {
}
function showSetupView() {
rootLoader.sourceComponent = null
resetCustomDialog()
if(currentPopUp) {
currentPopUp.close()
}
@ -93,7 +93,7 @@ Item { @@ -93,7 +93,7 @@ Item {
}
function showPlanView() {
rootLoader.sourceComponent = null
resetCustomDialog()
if(currentPopUp) {
currentPopUp.close()
}
@ -107,7 +107,7 @@ Item { @@ -107,7 +107,7 @@ Item {
}
function showFlyView() {
rootLoader.sourceComponent = null
resetCustomDialog()
if(currentPopUp) {
currentPopUp.close()
}
@ -118,7 +118,7 @@ Item { @@ -118,7 +118,7 @@ Item {
}
function showAnalyzeView() {
rootLoader.sourceComponent = null
resetCustomDialog()
if(currentPopUp) {
currentPopUp.close()
}
@ -148,6 +148,20 @@ Item { @@ -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 { @@ -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 { @@ -244,7 +258,7 @@ Item {
}
function showPopUp(dropItem, centerX) {
rootLoader.sourceComponent = null
mainWindow.resetCustomDialog()
var oldIndicator = indicatorDropdown.sourceComponent
if(currentPopUp) {
currentPopUp.close()

Loading…
Cancel
Save