Browse Source

Convert old style overlay dialogs in Offline Maps to QtQuick 2.4 controls (Popup)

QGC4.4
Gus Grubba 6 years ago
parent
commit
1d0a02d203
  1. 1
      src/FlightDisplay/FlightDisplayView.qml
  2. 103
      src/QmlControls/OfflineMapButton.qml
  3. 2
      src/QmlControls/QGCToolBarButton.qml
  4. 432
      src/QtLocationPlugin/QMLControl/OfflineMap.qml
  5. 1
      src/ui/MainRootWindow.qml

1
src/FlightDisplay/FlightDisplayView.qml

@ -680,7 +680,6 @@ Item {
/// Close all dialogs /// Close all dialogs
function closeAll() { function closeAll() {
rootLoader.sourceComponent = null
guidedActionConfirm.visible = false guidedActionConfirm.visible = false
guidedActionList.visible = false guidedActionList.visible = false
altitudeSlider.visible = false altitudeSlider.visible = false

103
src/QmlControls/OfflineMapButton.qml

@ -8,23 +8,26 @@
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.3
import QtQuick.Controls 1.2 import QtQuick.Controls 2.4
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
Rectangle { Button {
id: mapButton id: mapButton
anchors.margins: ScreenTools.defaultFontPixelWidth height: ScreenTools.defaultFontPixelHeight * 4
color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button autoExclusive: true
border.width: _showBorder ? 1: 0
border.color: qgcPal.buttonText background: Rectangle {
anchors.fill: parent
color: _showHighlight ? qgcPal.buttonHighlight : qgcPal.button
border.width: _showBorder ? 1: 0
border.color: qgcPal.buttonText
}
property var tileSet: null property var tileSet: null
property var currentSet: null property var currentSet: null
property bool checked: false
property bool complete: false property bool complete: false
property alias text: nameLabel.text
property int tiles: 0 property int tiles: 0
property string size: "" property string size: ""
@ -37,27 +40,11 @@ Rectangle {
property bool _pressed: false property bool _pressed: false
property bool _hovered: false property bool _hovered: false
signal clicked() contentItem: Row {
anchors.centerIn: parent
property ExclusiveGroup exclusiveGroup: null anchors.margins: ScreenTools.defaultFontPixelWidth
onExclusiveGroupChanged: {
if (exclusiveGroup) {
checked = false
exclusiveGroup.bindCheckable(mapButton)
}
}
onCheckedChanged: {
if(checked) {
currentSet = tileSet
}
}
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
Row {
anchors.centerIn: parent
QGCLabel { QGCLabel {
id: nameLabel text: mapButton.text
width: mapButton.width * 0.4 width: mapButton.width * 0.4
color: _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText color: _showHighlight ? qgcPal.buttonHighlightText : qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -97,62 +84,4 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
} }
MouseArea {
anchors.fill: parent
hoverEnabled: !ScreenTools.isMobile
onMouseXChanged: {
if(!ScreenTools.isMobile) {
_lastGlobalMouseX = ScreenTools.mouseX()
_lastGlobalMouseY = ScreenTools.mouseY()
}
}
onMouseYChanged: {
if(!ScreenTools.isMobile) {
_lastGlobalMouseX = ScreenTools.mouseX()
_lastGlobalMouseY = ScreenTools.mouseY()
}
}
onEntered: {
if(!ScreenTools.isMobile) {
_hovered = true
_forceHoverOff = false
hoverTimer.start()
}
}
onExited: {
if(!ScreenTools.isMobile) {
_hovered = false
_forceHoverOff = false
hoverTimer.stop()
}
}
onPressed: {
if(!ScreenTools.isMobile) {
_pressed = true
}
}
onReleased: {
if(!ScreenTools.isMobile) {
_pressed = false
}
}
onClicked: {
checked = true
mapButton.clicked()
}
}
Timer {
id: hoverTimer
interval: 250
repeat: !ScreenTools.isMobile
onTriggered: {
if (_lastGlobalMouseX !== ScreenTools.mouseX() || _lastGlobalMouseY !== ScreenTools.mouseY()) {
_forceHoverOff = true
} else {
_forceHoverOff = false
}
}
}
} }

2
src/QmlControls/QGCToolBarButton.qml

@ -22,8 +22,6 @@ Button {
property bool logo: false property bool logo: false
QGCPalette { id: qgcPal }
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: logo ? qgcPal.brandingPurple : (checked ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0)) color: logo ? qgcPal.brandingPurple : (checked ? qgcPal.buttonHighlight : Qt.rgba(0,0,0,0))

432
src/QtLocationPlugin/QMLControl/OfflineMap.qml

@ -7,11 +7,11 @@
* *
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3 import QtQuick 2.11
import QtQuick.Controls 1.2 import QtQuick.Controls 2.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.11
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2 import QtQuick.Controls.Styles 1.4
import QtLocation 5.3 import QtLocation 5.3
import QtPositioning 5.3 import QtPositioning 5.3
@ -33,10 +33,10 @@ Item {
property string mapKey: "lastMapType" property string mapKey: "lastMapType"
property var _settingsManager: QGroundControl.settingsManager property var _settingsManager: QGroundControl.settingsManager
property var _settings: _settingsManager.offlineMapsSettings property var _settings: _settingsManager ? _settingsManager.offlineMapsSettings : null
property var _fmSettings: _settingsManager.flightMapSettings property var _fmSettings: _settingsManager ? _settingsManager.flightMapSettings : null
property Fact _mapboxFact: _settingsManager.appSettings.mapboxToken property Fact _mapboxFact: _settingsManager ? _settingsManager.appSettings.mapboxToken : null
property Fact _esriFact: _settingsManager.appSettings.esriToken property Fact _esriFact: _settingsManager ? _settingsManager.appSettings.esriToken : null
property string mapType: _fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue property string mapType: _fmSettings.mapProvider.enumStringValue + " " + _fmSettings.mapType.enumStringValue
property bool isMapInteractive: false property bool isMapInteractive: false
@ -79,8 +79,6 @@ Item {
} }
} }
ExclusiveGroup { id: setGroup }
function handleChanges() { function handleChanges() {
if(isMapInteractive) { if(isMapInteractive) {
var xl = 0 var xl = 0
@ -203,10 +201,6 @@ Item {
_map.zoomLevel = QGroundControl.flightMapZoom _map.zoomLevel = QGroundControl.flightMapZoom
} }
ExclusiveGroup {
id: _dropButtonsExclusiveGroup
}
onMapTypeChanged: { onMapTypeChanged: {
updateMap() updateMap()
if(isMapInteractive) { if(isMapInteractive) {
@ -222,7 +216,7 @@ Item {
onAcceptedForSave: { onAcceptedForSave: {
if (QGroundControl.mapEngineManager.exportSets(file)) { if (QGroundControl.mapEngineManager.exportSets(file)) {
rootLoader.sourceComponent = exportToDiskProgress exportToDiskProgress.open()
} else { } else {
showList() showList()
} }
@ -754,9 +748,6 @@ Item {
model: QGroundControl.mapEngineManager.mapList model: QGroundControl.mapEngineManager.mapList
onActivated: { onActivated: {
mapType = textAt(index) mapType = textAt(index)
if(_dropButtonsExclusiveGroup.current)
_dropButtonsExclusiveGroup.current.checked = false
_dropButtonsExclusiveGroup.current = null
} }
Component.onCompleted: { Component.onCompleted: {
var index = mapCombo.find(mapType) var index = mapCombo.find(mapType)
@ -806,18 +797,15 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: sliderTouchArea * 1.25 height: sliderTouchArea * 1.25
minimumValue: minZoomLevel from: minZoomLevel
maximumValue: maxZoomLevel to: maxZoomLevel
stepSize: 1 stepSize: 1
updateValueWhileDragging: true live: true
property bool _updateSetting: false property bool _updateSetting: false
Component.onCompleted: { Component.onCompleted: {
sliderMinZoom.value = _settings.minZoomLevelDownload.rawValue sliderMinZoom.value = _settings.minZoomLevelDownload.rawValue
_updateSetting = true _updateSetting = true
} }
onValueChanged: { onValueChanged: {
if(sliderMinZoom.value > sliderMaxZoom.value) { if(sliderMinZoom.value > sliderMaxZoom.value) {
sliderMaxZoom.value = sliderMinZoom.value sliderMaxZoom.value = sliderMinZoom.value
@ -828,28 +816,21 @@ Item {
} }
handleChanges() handleChanges()
} }
style: SliderStyle { handle: Rectangle {
groove: Rectangle { x: sliderMinZoom.leftPadding + sliderMinZoom.visualPosition * (sliderMinZoom.availableWidth - width)
implicitWidth: sliderMinZoom.width y: sliderMinZoom.topPadding + sliderMinZoom.availableHeight * 0.5 - height * 0.5
implicitHeight: 4 implicitWidth: sliderTouchArea
color: qgcPal.colorBlue implicitHeight: sliderTouchArea
radius: 4 radius: sliderTouchArea * 0.5
} color: qgcPal.button
handle: Rectangle { border.width: 1
anchors.centerIn: parent border.color: qgcPal.buttonText
color: qgcPal.button Label {
border.color: qgcPal.buttonText text: sliderMinZoom.value
border.width: 1 anchors.centerIn: parent
implicitWidth: sliderTouchArea font.family: ScreenTools.normalFontFamily
implicitHeight: sliderTouchArea font.pointSize: ScreenTools.smallFontPointSize
radius: sliderTouchArea * 0.5 color: qgcPal.buttonText
Label {
text: sliderMinZoom.value
anchors.centerIn: parent
font.family: ScreenTools.normalFontFamily
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonText
}
} }
} }
} // Slider - min zoom } // Slider - min zoom
@ -859,18 +840,15 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: sliderTouchArea * 1.25 height: sliderTouchArea * 1.25
minimumValue: minZoomLevel from: minZoomLevel
maximumValue: maxZoomLevel to: maxZoomLevel
stepSize: 1 stepSize: 1
updateValueWhileDragging: true live: true
property bool _updateSetting: false property bool _updateSetting: false
Component.onCompleted: { Component.onCompleted: {
sliderMaxZoom.value = _settings.maxZoomLevelDownload.rawValue sliderMaxZoom.value = _settings.maxZoomLevelDownload.rawValue
_updateSetting = true _updateSetting = true
} }
onValueChanged: { onValueChanged: {
if(sliderMaxZoom.value < sliderMinZoom.value) { if(sliderMaxZoom.value < sliderMinZoom.value) {
sliderMinZoom.value = sliderMaxZoom.value sliderMinZoom.value = sliderMaxZoom.value
@ -881,28 +859,21 @@ Item {
} }
handleChanges() handleChanges()
} }
style: SliderStyle { handle: Rectangle {
groove: Rectangle { x: sliderMaxZoom.leftPadding + sliderMaxZoom.visualPosition * (sliderMaxZoom.availableWidth - width)
implicitWidth: sliderMaxZoom.width y: sliderMaxZoom.topPadding + sliderMaxZoom.availableHeight * 0.5 - height * 0.5
implicitHeight: 4 implicitWidth: sliderTouchArea
color: qgcPal.colorBlue implicitHeight: sliderTouchArea
radius: 4 radius: sliderTouchArea * 0.5
} color: qgcPal.button
handle: Rectangle { border.width: 1
anchors.centerIn: parent border.color: qgcPal.buttonText
color: qgcPal.button Label {
border.color: qgcPal.buttonText text: sliderMaxZoom.value
border.width: 1 anchors.centerIn: parent
implicitWidth: sliderTouchArea font.family: ScreenTools.normalFontFamily
implicitHeight: sliderTouchArea font.pointSize: ScreenTools.smallFontPointSize
radius: sliderTouchArea * 0.5 color: qgcPal.buttonText
Label {
text: sliderMaxZoom.value
anchors.centerIn: parent
font.family: ScreenTools.normalFontFamily
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonText
}
} }
} }
} // Slider - max zoom } // Slider - max zoom
@ -977,22 +948,24 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
contentHeight: _cacheList.height contentHeight: _cacheList.height
ButtonGroup {
id: buttonGroup
buttons: _cacheList.children
}
Column { Column {
id: _cacheList id: _cacheList
width: Math.min(_tileSetList.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0)) width: Math.min(_tileSetList.width, (ScreenTools.defaultFontPixelWidth * 50).toFixed(0))
spacing: ScreenTools.defaultFontPixelHeight * 0.5 spacing: ScreenTools.defaultFontPixelHeight * 0.5
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
ExclusiveGroup { id: selectionGroup }
OfflineMapButton { OfflineMapButton {
id: firstButton id: firstButton
text: qsTr("Add New Set") text: qsTr("Add New Set")
width: _cacheList.width width: _cacheList.width
height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2) height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2)
currentSet: _currentSelection currentSet: _currentSelection
exclusiveGroup: selectionGroup
onClicked: { onClicked: {
offlineMapView._currentSelection = null offlineMapView._currentSelection = null
checked = true
addNewSet() addNewSet()
} }
} }
@ -1005,11 +978,11 @@ Item {
complete: object.complete complete: object.complete
width: firstButton.width width: firstButton.width
height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2) height: ScreenTools.defaultFontPixelHeight * (ScreenTools.isMobile ? 3 : 2)
exclusiveGroup: selectionGroup
currentSet: _currentSelection currentSet: _currentSelection
tileSet: object tileSet: object
onClicked: { onClicked: {
offlineMapView._currentSelection = object offlineMapView._currentSelection = object
checked = true
showInfo() showInfo()
} }
} }
@ -1029,7 +1002,7 @@ Item {
visible: QGroundControl.corePlugin.options.showOfflineMapImport visible: QGroundControl.corePlugin.options.showOfflineMapImport
onClicked: { onClicked: {
QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone QGroundControl.mapEngineManager.importAction = QGCMapEngineManager.ActionNone
rootLoader.sourceComponent = importDialog importDialog.open()
} }
} }
QGCButton { QGCButton {
@ -1118,160 +1091,161 @@ Item {
} }
} }
Component { Popup {
id: exportToDiskProgress id: exportToDiskProgress
Rectangle { width: mainWindow.width * 0.666
width: mainWindow.width height: mainWindow.height * 0.333
height: mainWindow.height modal: true
color: "black" focus: true
anchors.centerIn: parent parent: Overlay.overlay
Rectangle { x: Math.round((mainWindow.width - width) * 0.5)
width: parent.width * 0.5 y: Math.round((mainWindow.height - height) * 0.5)
height: exportCol.height * 1.25 closePolicy: Popup.NoAutoClose
radius: ScreenTools.defaultFontPixelWidth background: Rectangle {
color: qgcPal.windowShadeDark anchors.fill: parent
border.color: qgcPal.text color: qgcPal.windowShadeDark
anchors.centerIn: parent border.color: qgcPal.text
Column { radius: ScreenTools.defaultFontPixelWidth
id: exportCol }
spacing: ScreenTools.defaultFontPixelHeight Column {
width: parent.width id: exportCol
anchors.centerIn: parent spacing: ScreenTools.defaultFontPixelHeight
QGCLabel { width: parent.width
text: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting ? qsTr("Tile Set Export Progress") : qsTr("Tile Set Export Completed") anchors.centerIn: parent
font.family: ScreenTools.demiboldFontFamily QGCLabel {
font.pointSize: ScreenTools.mediumFontPointSize text: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting ? qsTr("Tile Set Export Progress") : qsTr("Tile Set Export Completed")
anchors.horizontalCenter: parent.horizontalCenter font.family: ScreenTools.demiboldFontFamily
} font.pointSize: ScreenTools.mediumFontPointSize
ProgressBar { anchors.horizontalCenter: parent.horizontalCenter
id: progressBar }
width: parent.width * 0.45 ProgressBar {
maximumValue: 100 width: parent.width * 0.45
value: QGroundControl.mapEngineManager.actionProgress from: 0
anchors.horizontalCenter: parent.horizontalCenter to: 100
} value: QGroundControl.mapEngineManager.actionProgress
BusyIndicator { anchors.horizontalCenter: parent.horizontalCenter
visible: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false }
running: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false BusyIndicator {
width: exportCloseButton.height visible: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false
height: exportCloseButton.height running: QGroundControl.mapEngineManager ? QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionExporting : false
anchors.horizontalCenter: parent.horizontalCenter width: exportCloseButton.height
} height: exportCloseButton.height
QGCButton { anchors.horizontalCenter: parent.horizontalCenter
id: exportCloseButton }
text: qsTr("Close") QGCButton {
width: _buttonSize id: exportCloseButton
visible: !QGroundControl.mapEngineManager.exporting text: qsTr("Close")
anchors.horizontalCenter: parent.horizontalCenter width: _buttonSize
onClicked: { visible: !QGroundControl.mapEngineManager.exporting
rootLoader.sourceComponent = null anchors.horizontalCenter: parent.horizontalCenter
} onClicked: {
} exportToDiskProgress.close()
} }
} }
} }
} }
Component { Popup {
id: importDialog id: importDialog
Rectangle { width: mainWindow.width * 0.666
width: mainWindow.width height: importCol.height * 1.5
height: mainWindow.height modal: true
color: "black" focus: true
anchors.centerIn: parent parent: Overlay.overlay
Rectangle { x: Math.round((mainWindow.width - width) * 0.5)
width: parent.width * 0.5 y: Math.round((mainWindow.height - height) * 0.5)
height: importCol.height * 1.5 closePolicy: Popup.NoAutoClose
radius: ScreenTools.defaultFontPixelWidth background: Rectangle {
color: qgcPal.windowShadeDark anchors.fill: parent
border.color: qgcPal.text color: qgcPal.windowShadeDark
anchors.centerIn: parent border.color: qgcPal.text
Column { radius: ScreenTools.defaultFontPixelWidth
id: importCol }
spacing: ScreenTools.defaultFontPixelHeight Column {
width: parent.width id: importCol
anchors.centerIn: parent spacing: ScreenTools.defaultFontPixelHeight
QGCLabel { width: parent.width
text: { anchors.centerIn: parent
if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone) { QGCLabel {
return qsTr("Map Tile Set Import"); text: {
} else if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting) { if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone) {
return qsTr("Map Tile Set Import Progress"); return qsTr("Map Tile Set Import");
} else { } else if(QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting) {
return qsTr("Map Tile Set Import Completed"); return qsTr("Map Tile Set Import Progress");
} } else {
} return qsTr("Map Tile Set Import Completed");
font.family: ScreenTools.demiboldFontFamily
font.pointSize: ScreenTools.mediumFontPointSize
anchors.horizontalCenter: parent.horizontalCenter
}
ProgressBar {
id: progressBar
width: parent.width * 0.45
maximumValue: 100
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
value: QGroundControl.mapEngineManager.actionProgress
anchors.horizontalCenter: parent.horizontalCenter
}
BusyIndicator {
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
running: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
width: ScreenTools.defaultFontPixelWidth * 2
height: width
anchors.horizontalCenter: parent.horizontalCenter
}
ExclusiveGroup { id: radioGroup }
Column {
spacing: ScreenTools.defaultFontPixelHeight
width: ScreenTools.defaultFontPixelWidth * 24
anchors.horizontalCenter: parent.horizontalCenter
QGCRadioButton {
exclusiveGroup: radioGroup
text: qsTr("Append to existing set")
checked: !QGroundControl.mapEngineManager.importReplace
onClicked: QGroundControl.mapEngineManager.importReplace = !checked
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone
}
QGCRadioButton {
exclusiveGroup: radioGroup
text: qsTr("Replace existing set")
checked: QGroundControl.mapEngineManager.importReplace
onClicked: QGroundControl.mapEngineManager.importReplace = checked
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone
}
} }
QGCButton { }
text: qsTr("Close") font.family: ScreenTools.demiboldFontFamily
width: _bigButtonSize * 1.25 font.pointSize: ScreenTools.mediumFontPointSize
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionDone anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenter: parent.horizontalCenter }
onClicked: { ProgressBar {
showList(); width: parent.width * 0.45
rootLoader.sourceComponent = null from: 0
} to: 100
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
value: QGroundControl.mapEngineManager.actionProgress
anchors.horizontalCenter: parent.horizontalCenter
}
BusyIndicator {
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
running: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionImporting
width: ScreenTools.defaultFontPixelWidth * 2
height: width
anchors.horizontalCenter: parent.horizontalCenter
}
ButtonGroup {
buttons: mapSetButtons.children
}
Column {
id: mapSetButtons
spacing: ScreenTools.defaultFontPixelHeight
width: ScreenTools.defaultFontPixelWidth * 24
anchors.horizontalCenter: parent.horizontalCenter
QGCRadioButton {
text: qsTr("Append to existing set")
checked: !QGroundControl.mapEngineManager.importReplace
onClicked: QGroundControl.mapEngineManager.importReplace = !checked
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone
}
QGCRadioButton {
text: qsTr("Replace existing set")
checked: QGroundControl.mapEngineManager.importReplace
onClicked: QGroundControl.mapEngineManager.importReplace = checked
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone
}
}
QGCButton {
text: qsTr("Close")
width: _bigButtonSize * 1.25
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionDone
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
showList();
importDialog.close()
}
}
Row {
spacing: _margins
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone
anchors.horizontalCenter: parent.horizontalCenter
QGCButton {
text: qsTr("Import")
width: _bigButtonSize * 1.25
onClicked: {
importDialog.close()
fileDialog.title = qsTr("Import Tile Set")
fileDialog.selectExisting = true
fileDialog.openForLoad()
} }
Row { }
spacing: _margins QGCButton {
visible: QGroundControl.mapEngineManager.importAction === QGCMapEngineManager.ActionNone text: qsTr("Cancel")
anchors.horizontalCenter: parent.horizontalCenter width: _bigButtonSize * 1.25
QGCButton { onClicked: {
text: qsTr("Import") showList();
width: _bigButtonSize * 1.25 importDialog.close()
onClicked: {
rootLoader.sourceComponent = null
fileDialog.title = qsTr("Import Tile Set")
fileDialog.selectExisting = true
fileDialog.openForLoad()
}
}
QGCButton {
text: qsTr("Cancel")
width: _bigButtonSize * 1.25
onClicked: {
showList();
rootLoader.sourceComponent = null
}
}
} }
} }
} }

1
src/ui/MainRootWindow.qml

@ -309,6 +309,7 @@ ApplicationWindow {
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Loader helper for any child, no matter how deep, to display elements //-- Loader helper for any child, no matter how deep, to display elements
// on top of the main window. // on top of the main window.
// This is DEPRECATED. Use Popup instead.
Loader { Loader {
id: rootLoader id: rootLoader
anchors.centerIn: parent anchors.centerIn: parent

Loading…
Cancel
Save