Commit 019e06d4 authored by Gus Grubba's avatar Gus Grubba Committed by GitHub

Merge pull request #4789 from dogmaphobic/offlineTiles

JavaScript exception and minor UI tweaks.
parents 989a0d7b 24aa97f1
...@@ -37,12 +37,13 @@ QGCView { ...@@ -37,12 +37,13 @@ QGCView {
property string savedMapType: "" property string savedMapType: ""
property bool _showPreview: true property bool _showPreview: true
property bool _defaultSet: offlineMapView && offlineMapView._currentSelection && offlineMapView._currentSelection.defaultSet property bool _defaultSet: offlineMapView && offlineMapView._currentSelection && offlineMapView._currentSelection.defaultSet
property real _margins: ScreenTools.defaultFontPixelWidth /2 property real _margins: ScreenTools.defaultFontPixelWidth / 2
property bool _saveRealEstate: ScreenTools.isTinyScreen || ScreenTools.isShortScreen property bool _saveRealEstate: ScreenTools.isTinyScreen || ScreenTools.isShortScreen
property real _adjustableFontPointSize: _saveRealEstate ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize property real _adjustableFontPointSize: _saveRealEstate ? ScreenTools.smallFontPointSize : ScreenTools.defaultFontPointSize
property var _mapAdjustedColor: _map.isSatelliteMap ? "white" : "black" property var _mapAdjustedColor: _map.isSatelliteMap ? "white" : "black"
property bool _tooManyTiles: QGroundControl.mapEngineManager.tileCount > _maxTilesForDownload
readonly property real minZoomLevel: 3 readonly property real minZoomLevel: 3
readonly property real maxZoomLevel: 20 readonly property real maxZoomLevel: 20
...@@ -358,7 +359,14 @@ QGCView { ...@@ -358,7 +359,14 @@ QGCView {
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85)
radius: ScreenTools.defaultFontPixelWidth * 0.5 radius: ScreenTools.defaultFontPixelWidth * 0.5
visible: false visible: false
property bool _extraButton: !_defaultSet && ((!offlineMapView._currentSelection.complete && !offlineMapView._currentSelection.downloading) || (!offlineMapView._currentSelection.complete && offlineMapView._currentSelection.downloading))
property bool _extraButton: {
if(!offlineMapView._currentSelection)
return false;
var curSel = offlineMapView._currentSelection;
return !_defaultSet && ((!curSel.complete && !curSel.downloading) || (!curSel.complete && curSel.downloading));
}
property real _labelWidth: ScreenTools.defaultFontPixelWidth * 10 property real _labelWidth: ScreenTools.defaultFontPixelWidth * 10
property real _valueWidth: ScreenTools.defaultFontPixelWidth * 14 property real _valueWidth: ScreenTools.defaultFontPixelWidth * 14
Column { Column {
...@@ -582,7 +590,7 @@ QGCView { ...@@ -582,7 +590,7 @@ QGCView {
anchors.margins: ScreenTools.defaultFontPixelWidth anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right anchors.right: parent.right
width: ScreenTools.defaultFontPixelWidth * 24 width: ScreenTools.defaultFontPixelWidth * (ScreenTools.isTinyScreen ? 24 : 28)
height: Math.min(parent.height - (anchors.margins * 2), addNewSetFlickable.y + addNewSetColumn.height + addNewSetLabel.anchors.margins) height: Math.min(parent.height - (anchors.margins * 2), addNewSetFlickable.y + addNewSetColumn.height + addNewSetLabel.anchors.margins)
color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85) color: Qt.rgba(qgcPal.window.r, qgcPal.window.g, qgcPal.window.b, 0.85)
radius: ScreenTools.defaultFontPixelWidth * 0.5 radius: ScreenTools.defaultFontPixelWidth * 0.5
...@@ -616,9 +624,9 @@ QGCView { ...@@ -616,9 +624,9 @@ QGCView {
id: addNewSetColumn id: addNewSetColumn
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelHeight / (ScreenTools.isTinyScreen ? 4 : 2) spacing: ScreenTools.defaultFontPixelHeight * (ScreenTools.isTinyScreen ? 0.25 : 0.5)
Column { Column {
spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
QGCLabel { text: qsTr("Name:") } QGCLabel { text: qsTr("Name:") }
...@@ -628,8 +636,8 @@ QGCView { ...@@ -628,8 +636,8 @@ QGCView {
anchors.right: parent.right anchors.right: parent.right
} }
} }
Column { Column {
spacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.25
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
QGCLabel { QGCLabel {
...@@ -661,7 +669,7 @@ QGCView { ...@@ -661,7 +669,7 @@ QGCView {
Rectangle { Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: zoomColumn.height + ScreenTools.defaultFontPixelHeight / 2 height: zoomColumn.height + ScreenTools.defaultFontPixelHeight * 0.5
color: qgcPal.window color: qgcPal.window
border.color: qgcPal.text border.color: qgcPal.text
radius: ScreenTools.defaultFontPixelWidth * 0.5 radius: ScreenTools.defaultFontPixelWidth * 0.5
...@@ -723,7 +731,7 @@ QGCView { ...@@ -723,7 +731,7 @@ QGCView {
GridLayout { GridLayout {
columns: 2 columns: 2
rowSpacing: 0 rowSpacing: ScreenTools.isTinyScreen ? 0 : ScreenTools.defaultFontPixelHeight * 0.5
QGCLabel { QGCLabel {
text: qsTr("Count:") text: qsTr("Count:")
font.pointSize: _adjustableFontPointSize font.pointSize: _adjustableFontPointSize
...@@ -745,13 +753,20 @@ QGCView { ...@@ -745,13 +753,20 @@ QGCView {
} // Column - Zoom info } // Column - Zoom info
} // Rectangle - Zoom info } // Rectangle - Zoom info
QGCLabel {
text: qsTr("Too many tiles")
visible: _tooManyTiles
color: qgcPal.warningText
anchors.horizontalCenter: parent.horizontalCenter
}
Row { Row {
spacing: ScreenTools.defaultFontPixelWidth spacing: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
QGCButton { QGCButton {
text: _tooManyTiles ? qsTr("Too many tiles") : qsTr("Download") id: downloadButton
text: qsTr("Download")
enabled: !_tooManyTiles && setName.text.length > 0 enabled: !_tooManyTiles && setName.text.length > 0
property bool _tooManyTiles: QGroundControl.mapEngineManager.tileCount > _maxTilesForDownload
onClicked: { onClicked: {
if(QGroundControl.mapEngineManager.findName(setName.text)) { if(QGroundControl.mapEngineManager.findName(setName.text)) {
duplicateName.visible = true duplicateName.visible = true
...@@ -762,7 +777,8 @@ QGCView { ...@@ -762,7 +777,8 @@ QGCView {
} }
} }
QGCButton { QGCButton {
text: qsTr("Cancel") text: qsTr("Cancel")
width: downloadButton.width
onClicked: { onClicked: {
showList() showList()
} }
......
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