OfflineMap.qml 48.1 KB
Newer Older
dogmaphobic's avatar
dogmaphobic committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
/*=====================================================================

 QGroundControl Open Source Ground Control Station

 (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>

 This file is part of the QGROUNDCONTROL project

 QGROUNDCONTROL is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 QGROUNDCONTROL is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.

 ======================================================================*/

import QtQuick                  2.5
import QtQuick.Controls         1.2
import QtQuick.Controls.Styles  1.2
import QtQuick.Dialogs          1.1
import QtQuick.Layouts          1.2
29 30
import QtLocation               5.5
import QtPositioning            5.5
dogmaphobic's avatar
dogmaphobic committed
31 32 33 34 35 36 37 38

import QGroundControl                       1.0
import QGroundControl.Controls              1.0
import QGroundControl.ScreenTools           1.0
import QGroundControl.Palette               1.0

Rectangle {
    id:                 _offlineMapRoot
39
    color:              qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
40 41 42 43 44 45 46
    anchors.fill:       parent
    anchors.margins:    ScreenTools.defaultFontPixelWidth

    property var    _currentSelection: null

    property string mapKey:        "lastMapType"

47 48 49 50 51 52 53 54
    property string mapType:            QGroundControl.mapEngineManager.loadSetting(mapKey, "Google Street Map")
    property int    mapMargin:          (ScreenTools.defaultFontPixelHeight * 0.2).toFixed(0)
    property real   infoWidth:          Math.max(infoCol.width, (ScreenTools.defaultFontPixelWidth * 40))
    property bool   isDefaultSet:       _offlineMapRoot._currentSelection && _offlineMapRoot._currentSelection.defaultSet
    property bool   isMapInteractive:   true
    property var    savedCenter:        undefined
    property real   savedZoom:          3
    property string savedMapType:       ""
dogmaphobic's avatar
dogmaphobic committed
55 56 57 58 59 60 61 62

    property real oldlon0:      0
    property real oldlon1:      0
    property real oldlat0:      0
    property real oldlat1:      0
    property int  oldz0:        0
    property int  oldz1:        0

Don Gagne's avatar
Don Gagne committed
63 64 65
    readonly property real minZoomLevel: 3
    readonly property real maxZoomLevel: 20

66 67
    QGCPalette { id: qgcpal }

dogmaphobic's avatar
dogmaphobic committed
68 69 70
    Component.onCompleted: {
        QGroundControl.mapEngineManager.loadTileSets()
        updateMap()
71
        savedCenter = _map.toCoordinate(Qt.point(_map.width / 2, _map.height / 2))
dogmaphobic's avatar
dogmaphobic committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
    }

    Connections {
        target: QGroundControl.mapEngineManager
        onTileSetsChanged: {
            setName.text = QGroundControl.mapEngineManager.getUniqueName()
        }
        onErrorMessageChanged: {
            errorDialog.visible = true
        }
    }

    ExclusiveGroup { id: setGroup }

    function handleChanges() {
87 88 89 90 91 92 93 94 95 96
        if(isMapInteractive) {
            var xl = mapMargin
            var yl = mapMargin
            var xr = _map.width.toFixed(0)  - mapMargin
            var yr = _map.height.toFixed(0) - mapMargin
            var c0 = _map.toCoordinate(Qt.point(xl, yl))
            var c1 = _map.toCoordinate(Qt.point(xr, yr))
            if(oldlon0 !== c0.longitude || oldlat0 !== c0.latitude || oldlon1 !== c1.longitude || oldlat1 !== c1.latitude || oldz0 !== _slider0.value || oldz1 !== _slider1.value) {
                QGroundControl.mapEngineManager.updateForCurrentView(c0.longitude, c0.latitude, c1.longitude, c1.latitude, _slider0.value, _slider1.value, mapType)
            }
dogmaphobic's avatar
dogmaphobic committed
97 98 99 100
        }
    }

    function checkSanity() {
101
        if(isMapInteractive && QGroundControl.mapEngineManager.crazySize) {
dogmaphobic's avatar
dogmaphobic committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
            _slider1.value = _slider1.value - 1
            handleChanges()
        }
    }

    function updateMap() {
        for (var i = 0; i < _map.supportedMapTypes.length; i++) {
            if (mapType === _map.supportedMapTypes[i].name) {
                _map.activeMapType = _map.supportedMapTypes[i]
                handleChanges()
                return
            }
        }
    }

    function showOptions() {
118
        _map.visible = false
dogmaphobic's avatar
dogmaphobic committed
119 120 121 122 123 124 125
        _tileSetList.visible = false
        _infoView.visible = false
        _mapView.visible = false
        _optionsView.visible = true
    }

    function showMap() {
126
        _map.visible = true
dogmaphobic's avatar
dogmaphobic committed
127 128 129 130 131 132 133
        _tileSetList.visible = false
        _infoView.visible = false
        _mapView.visible = true
        _optionsView.visible = false
    }

    function showList() {
134
        _map.visible = false
dogmaphobic's avatar
dogmaphobic committed
135 136 137 138 139 140 141 142
        _tileSetList.visible = true
        _infoView.visible = false
        _mapView.visible = false
        _optionsView.visible = false
    }

    function showInfo() {
        if(_currentSelection && !_offlineMapRoot._currentSelection.deleting) {
143
            enterInfoView()
dogmaphobic's avatar
dogmaphobic committed
144 145 146 147
        } else
            showList()
    }

148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    function toRadian(deg) {
        return deg * Math.PI / 180
    }

    function toDegree(rad) {
        return rad * 180 / Math.PI
    }

    function midPoint(lat1, lat2, lon1, lon2) {
        var dLon = toRadian(lon2 - lon1);
        lat1 = toRadian(lat1);
        lat2 = toRadian(lat2);
        lon1 = toRadian(lon1);
        var Bx = Math.cos(lat2) * Math.cos(dLon);
        var By = Math.cos(lat2) * Math.sin(dLon);
        var lat3 = Math.atan2(Math.sin(lat1) + Math.sin(lat2), Math.sqrt((Math.cos(lat1) + Bx) * (Math.cos(lat1) + Bx) + By * By));
        var lon3 = lon1 + Math.atan2(By, Math.cos(lat1) + Bx);
        return QtPositioning.coordinate(toDegree(lat3), toDegree(lon3))
    }

    function enterInfoView() {
        if(!isDefaultSet) {
            isMapInteractive = false
            savedCenter = _map.toCoordinate(Qt.point(_map.width / 2, _map.height / 2))
            savedZoom = _map.zoomLevel
            savedMapType = mapType
            _map.visible = true
            mapType = _offlineMapRoot._currentSelection.mapTypeStr
            _map.center = midPoint(_offlineMapRoot._currentSelection.topleftLat, _offlineMapRoot._currentSelection.bottomRightLat, _offlineMapRoot._currentSelection.topleftLon, _offlineMapRoot._currentSelection.bottomRightLon)
177 178 179 180 181 182 183 184 185
            //-- Delineate Set Region
            var x0 = _offlineMapRoot._currentSelection.topleftLon
            var x1 = _offlineMapRoot._currentSelection.bottomRightLon
            var y0 = _offlineMapRoot._currentSelection.topleftLat
            var y1 = _offlineMapRoot._currentSelection.bottomRightLat
            mapBoundary.topLeft     = QtPositioning.coordinate(y0, x0)
            mapBoundary.bottomRight = QtPositioning.coordinate(y1, x1)
            mapBoundary.visible = true
            _map.fitViewportToMapItems()
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
        }
        _tileSetList.visible = false
        _mapView.visible = false
        _infoView.visible = true
        _optionsView.visible = false
        if(isDefaultSet) {
            _infoView.color = qgcPal.windowShade
            _infoNameRect.color = qgcPal.window
            _infoRect.color = qgcPal.window
        } else {
            _infoView.color = Qt.rgba(0,0,0,0)
            _infoNameRect.color = Qt.rgba(_infoNameRect.color.r, _infoNameRect.color.g, _infoNameRect.color.b, 0.85)
            _infoRect.color = Qt.rgba(_infoRect.color.r, _infoRect.color.g, _infoRect.color.b, 0.85)
        }
    }

    function leaveInfoView() {
203
        mapBoundary.visible = false
204 205 206 207 208 209
        _map.center = savedCenter
        _map.zoomLevel = savedZoom
        mapType = savedMapType
        isMapInteractive = true
    }

dogmaphobic's avatar
dogmaphobic committed
210 211 212 213 214 215
    ExclusiveGroup {
        id: _dropButtonsExclusiveGroup
    }

    onMapTypeChanged: {
        updateMap()
216 217 218
        if(isMapInteractive) {
            QGroundControl.mapEngineManager.saveSetting(mapKey, mapType)
        }
dogmaphobic's avatar
dogmaphobic committed
219 220 221 222 223 224 225 226
    }

    MessageDialog {
        id:         errorDialog
        visible:    false
        text:       QGroundControl.mapEngineManager.errorMessage
        icon:       StandardIcon.Critical
        standardButtons: StandardButton.Ok
227
        title:      qsTr("Errror Message")
dogmaphobic's avatar
dogmaphobic committed
228 229 230 231
        onYes: {
            errorDialog.visible = false
        }
    }
Don Gagne's avatar
Don Gagne committed
232

dogmaphobic's avatar
dogmaphobic committed
233 234 235 236
    Rectangle {
        id:         _offlineMapTopRect
        width:      parent.width
        height:     labelTitle.height + ScreenTools.defaultFontPixelHeight
237
        color:      qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
238 239 240 241 242 243
        anchors.top: parent.top
        Row {
            spacing: ScreenTools.defaultFontPixelHeight * 2
            anchors.verticalCenter: parent.verticalCenter
            QGCLabel {
                id:         labelTitle
244
                text:       qsTr("Offline Maps")
dogmaphobic's avatar
dogmaphobic committed
245 246 247 248 249
                font.pixelSize: ScreenTools.mediumFontPixelSize
                anchors.verticalCenter: parent.verticalCenter
            }
            QGCCheckBox {
                id:         showTilePreview
250
                text:       qsTr("Show tile min/max zoom level preview")
dogmaphobic's avatar
dogmaphobic committed
251 252 253 254 255 256
                checked:    false
                visible:    _mapView.visible
                anchors.verticalCenter: parent.verticalCenter
            }
        }
    }
Don Gagne's avatar
Don Gagne committed
257

258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
    Map {
        id:                 _map
        anchors.top:        _offlineMapTopRect.bottom
        anchors.left:       parent.left
        anchors.bottom:     parent.bottom
        anchors.margins:    mapMargin
        width:              parent.width - ScreenTools.defaultFontPixelWidth
        center:             QGroundControl.defaultMapPosition
        visible:            false
        gesture.flickDeceleration:  3000
        gesture.activeGestures:     MapGestureArea.ZoomGesture | MapGestureArea.PanGesture | MapGestureArea.FlickGesture
        plugin: Plugin { name: "QGroundControl" }

        Rectangle {
            color: Qt.rgba(0,0,0,0)
            border.color: "black"
            border.width: 1
            anchors.fill: parent
        }

278 279 280 281 282 283 284 285 286
        MapRectangle {
            id:             mapBoundary
            border.width:   2
            border.color:   "red"
            color:          Qt.rgba(1,0,0,0.05)
            smooth:         true
            antialiasing:   true
        }

287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
        Component.onCompleted: {
            center = QGroundControl.flightMapPosition
            zoomLevel = QGroundControl.flightMapZoom
        }

        onCenterChanged: {
            handleChanges()
            checkSanity()
        }
        onZoomLevelChanged: {
            handleChanges()
            checkSanity()
        }
        onWidthChanged: {
            handleChanges()
            checkSanity()
        }
        onHeightChanged: {
            handleChanges()
            checkSanity()
        }
        // Used to make pinch zoom work
        MouseArea {
            anchors.fill: parent
        }
    }

dogmaphobic's avatar
dogmaphobic committed
314 315 316 317
    QGCFlickable {
        id:                 _tileSetList
        clip:               true
        anchors.top:        _offlineMapTopRect.bottom
Don Gagne's avatar
Don Gagne committed
318 319 320
        anchors.left:       parent.left
        anchors.right:      parent.right
        anchors.bottom:     _optionsButton.top
dogmaphobic's avatar
dogmaphobic committed
321 322
        contentHeight:      _cacheList.height
        flickableDirection: Flickable.VerticalFlick
Don Gagne's avatar
Don Gagne committed
323

dogmaphobic's avatar
dogmaphobic committed
324 325
        Column {
            id:                 _cacheList
Don Gagne's avatar
Don Gagne committed
326
            width:              Math.min(parent.width, (ScreenTools.defaultFontPixelWidth  * 50).toFixed(0))
dogmaphobic's avatar
dogmaphobic committed
327 328
            anchors.margins:    ScreenTools.defaultFontPixelWidth
            spacing:            (ScreenTools.defaultFontPixelHeight * 0.5).toFixed(0)
Don Gagne's avatar
Don Gagne committed
329 330
            anchors.horizontalCenter: parent.horizontalCenter

dogmaphobic's avatar
dogmaphobic committed
331
            OfflineMapButton {
332
                text:           qsTr("Add new set")
Don Gagne's avatar
Don Gagne committed
333 334 335
                anchors.left:   parent.left
                anchors.right:  parent.right
                height:         (ScreenTools.defaultFontPixelHeight * 2).toFixed(0)
dogmaphobic's avatar
dogmaphobic committed
336 337 338 339 340 341 342 343
                onClicked: {
                    _offlineMapRoot._currentSelection = null
                    showMap()
                }
            }
            Repeater {
                model: QGroundControl.mapEngineManager.tileSets
                delegate: OfflineMapButton {
Don Gagne's avatar
Don Gagne committed
344 345 346 347 348 349
                    text:           object.name
                    size:           object.downloadStatus
                    complete:       object.complete
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    height:         (ScreenTools.defaultFontPixelHeight * 2).toFixed(0)
dogmaphobic's avatar
dogmaphobic committed
350 351 352 353 354 355 356 357
                    onClicked: {
                        _offlineMapRoot._currentSelection = object
                        showInfo()
                    }
                }
            }
        }
    }
Don Gagne's avatar
Don Gagne committed
358

dogmaphobic's avatar
dogmaphobic committed
359 360
    QGCButton {
        id:              _optionsButton
361
        text:            qsTr("Options")
dogmaphobic's avatar
dogmaphobic committed
362 363 364 365 366 367
        visible:         _tileSetList.visible
        anchors.bottom:  parent.bottom
        anchors.right:   parent.right
        anchors.margins: ScreenTools.defaultFontPixelWidth
        onClicked:       showOptions()
    }
Don Gagne's avatar
Don Gagne committed
368

dogmaphobic's avatar
dogmaphobic committed
369
    //-- Offline Map Definition
370
    Item {
dogmaphobic's avatar
dogmaphobic committed
371 372 373 374 375 376 377
        id:                 _mapView
        width:              parent.width
        anchors.top:        _offlineMapTopRect.bottom
        anchors.bottom:     parent.bottom
        anchors.margins:    ScreenTools.defaultFontPixelWidth
        visible:            false

378 379
        //-- Zoom Preview Maps
        Item {
dogmaphobic's avatar
dogmaphobic committed
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
            width:          parent.width
            anchors.top:    parent.top
            Rectangle {
                width:              ScreenTools.defaultFontPixelHeight * 16
                height:             ScreenTools.defaultFontPixelHeight * 9
                anchors.top:        parent.top
                anchors.left:       parent.left
                anchors.margins:    ScreenTools.defaultFontPixelHeight
                color:              "black"
                visible:            showTilePreview.checked
                Map {
                    id:                 _mapMin
                    anchors.fill:       parent
                    anchors.margins:    2
                    zoomLevel:          _slider0.value
                    center:             _map.center
                    gesture.enabled:    false
                    activeMapType:      _map.activeMapType
                    plugin: Plugin { name: "QGroundControl" }
                }
            }
            Rectangle {
                width:              ScreenTools.defaultFontPixelHeight * 16
                height:             ScreenTools.defaultFontPixelHeight * 9
                anchors.top:        parent.top
                anchors.right:      parent.right
                anchors.margins:    ScreenTools.defaultFontPixelHeight
                color:              "black"
                visible:            showTilePreview.checked
                Map {
                    id:                 _mapMax
                    anchors.fill:       parent
                    anchors.margins:    2
                    zoomLevel:          _slider1.value
                    center:             _map.center
                    gesture.enabled:    false
                    activeMapType:      _map.activeMapType
                    plugin: Plugin { name: "QGroundControl" }
                }
            }
        }
421
        //-- Tile set settings
dogmaphobic's avatar
dogmaphobic committed
422 423
        Rectangle {
            id:     bottomRect
424
            width:  _controlRow.width  + (ScreenTools.defaultFontPixelWidth  * 2)
dogmaphobic's avatar
dogmaphobic committed
425
            height: _controlRow.height + (ScreenTools.defaultFontPixelHeight * 2)
426
            color:  qgcPal.window
427 428 429 430 431
            radius: ScreenTools.defaultFontPixelWidth * 0.5
            anchors.horizontalCenter: parent.horizontalCenter
            Component.onCompleted: {
                color = Qt.rgba(color.r, color.g, color.b, 0.85)
            }
dogmaphobic's avatar
dogmaphobic committed
432 433 434 435
            anchors.bottom: parent.bottom
            Row {
                id: _controlRow
                anchors.centerIn: parent
436
                spacing: ScreenTools.defaultFontPixelWidth * 0.5
dogmaphobic's avatar
dogmaphobic committed
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455
                Rectangle {
                    height:     _zoomRow.height + ScreenTools.defaultFontPixelHeight * 1.5
                    width:      _zoomRow.width  + ScreenTools.defaultFontPixelWidth
                    color:      "#98aca4"
                    border.color: "black"
                    border.width: 2
                    radius:     ScreenTools.defaultFontPixelWidth * 0.5
                    anchors.verticalCenter: parent.verticalCenter
                    Row {
                        id: _zoomRow
                        anchors.centerIn:   parent
                        Column {
                            spacing:            ScreenTools.defaultFontPixelHeight * 0.5
                            anchors.verticalCenter: parent.verticalCenter
                            Row {
                                spacing:        ScreenTools.defaultFontPixelWidth * 0.5
                                Column {
                                    anchors.verticalCenter: parent.verticalCenter
                                    Label {
456
                                        text:   qsTr("Min")
dogmaphobic's avatar
dogmaphobic committed
457 458 459 460 461 462
                                        color:  "black"
                                        width:  ScreenTools.defaultFontPixelWidth * 5
                                        font.pixelSize: ScreenTools.smallFontPixelSize
                                        horizontalAlignment: Text.AlignHCenter
                                    }
                                    Label {
463
                                        text:   qsTr("Zoom")
dogmaphobic's avatar
dogmaphobic committed
464 465 466 467 468 469 470 471
                                        color:  "black"
                                        width:  ScreenTools.defaultFontPixelWidth * 5
                                        font.pixelSize: ScreenTools.smallFontPixelSize
                                        horizontalAlignment: Text.AlignHCenter
                                    }
                                }
                                Slider {
                                    id:                 _slider0
Don Gagne's avatar
Don Gagne committed
472 473
                                    minimumValue:       minZoomLevel
                                    maximumValue:       maxZoomLevel
dogmaphobic's avatar
dogmaphobic committed
474 475 476 477 478 479 480
                                    stepSize:           1
                                    tickmarksEnabled:   false
                                    orientation:        Qt.Horizontal
                                    updateValueWhileDragging: true
                                    anchors.verticalCenter: parent.verticalCenter
                                    style: SliderStyle {
                                        groove: Rectangle {
481
                                            implicitWidth:  ScreenTools.defaultFontPixelWidth * 12
dogmaphobic's avatar
dogmaphobic committed
482 483 484 485 486 487 488 489 490
                                            implicitHeight: 4
                                            color:          "gray"
                                            radius:         4
                                        }
                                        handle: Rectangle {
                                            anchors.centerIn: parent
                                            color: control.pressed ? "white" : "lightgray"
                                            border.color: "gray"
                                            border.width:   2
491 492
                                            implicitWidth:  ScreenTools.isAndroid ? 60 : 30
                                            implicitHeight: ScreenTools.isAndroid ? 60 : 30
dogmaphobic's avatar
dogmaphobic committed
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519
                                            radius:         10
                                            Label {
                                                text:  _slider0.value
                                                anchors.centerIn: parent
                                            }
                                        }
                                    }
                                    Component.onCompleted: {
                                        _slider0.value = _map.zoomLevel - 2
                                    }
                                    onValueChanged: {
                                        if(_slider1) {
                                            if(_slider0.value > _slider1.value)
                                                _slider1.value = _slider0.value
                                            else {
                                                handleChanges()
                                                checkSanity()
                                            }
                                        }
                                    }
                                }
                            }
                            Row {
                                spacing:        ScreenTools.defaultFontPixelWidth * 0.5
                                Column {
                                    anchors.verticalCenter: parent.verticalCenter
                                    Label {
520
                                        text:   qsTr("Max")
dogmaphobic's avatar
dogmaphobic committed
521 522 523 524 525 526
                                        color:  "black"
                                        width:  ScreenTools.defaultFontPixelWidth * 5
                                        font.pixelSize: ScreenTools.smallFontPixelSize
                                        horizontalAlignment: Text.AlignHCenter
                                    }
                                    Label {
527
                                        text:   qsTr("Zoom")
dogmaphobic's avatar
dogmaphobic committed
528 529 530 531 532 533 534 535
                                        color:  "black"
                                        width:  ScreenTools.defaultFontPixelWidth * 5
                                        font.pixelSize: ScreenTools.smallFontPixelSize
                                        horizontalAlignment: Text.AlignHCenter
                                    }
                                }
                                Slider {
                                    id:                 _slider1
Don Gagne's avatar
Don Gagne committed
536 537
                                    minimumValue:       minZoomLevel
                                    maximumValue:       maxZoomLevel
dogmaphobic's avatar
dogmaphobic committed
538 539 540 541 542 543 544
                                    stepSize:           1
                                    tickmarksEnabled:   false
                                    orientation:        Qt.Horizontal
                                    updateValueWhileDragging: true
                                    anchors.verticalCenter: parent.verticalCenter
                                    style: SliderStyle {
                                        groove: Rectangle {
545
                                            implicitWidth:  ScreenTools.defaultFontPixelWidth * 12
dogmaphobic's avatar
dogmaphobic committed
546 547 548 549 550 551 552 553 554
                                            implicitHeight: 4
                                            color:          "gray"
                                            radius:         4
                                        }
                                        handle: Rectangle {
                                            anchors.centerIn: parent
                                            color: control.pressed ? "white" : "lightgray"
                                            border.color: "gray"
                                            border.width:   2
555 556
                                            implicitWidth:  ScreenTools.isAndroid ? 60 : 30
                                            implicitHeight: ScreenTools.isAndroid ? 60 : 30
dogmaphobic's avatar
dogmaphobic committed
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581
                                            radius:         10
                                            Label {
                                                text:  _slider1.value
                                                anchors.centerIn: parent
                                            }
                                        }
                                    }
                                    Component.onCompleted: {
                                        _slider1.value = _map.zoomLevel + 2
                                    }
                                    onValueChanged: {
                                        if(_slider1.value < _slider0.value)
                                            _slider0.value = _slider1.value
                                        else {
                                            handleChanges()
                                            checkSanity()
                                        }
                                    }
                                }
                            }
                        }
                        Column {
                            spacing:            ScreenTools.defaultFontPixelHeight * 0.5
                            anchors.verticalCenter: parent.verticalCenter
                            Label {
582
                                text:   qsTr("Tile Count")
dogmaphobic's avatar
dogmaphobic committed
583 584 585 586 587 588 589 590 591 592 593 594
                                color:  "black"
                                width:  ScreenTools.defaultFontPixelWidth * 12
                                font.pixelSize: ScreenTools.smallFontPixelSize
                                horizontalAlignment: Text.AlignHCenter
                            }
                            Label {
                                text:  QGroundControl.mapEngineManager.tileCountStr
                                color: "black"
                                width: ScreenTools.defaultFontPixelWidth * 12
                                horizontalAlignment: Text.AlignHCenter
                            }
                            Label {
595
                                text:   qsTr("Set Size (Est)")
dogmaphobic's avatar
dogmaphobic committed
596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615
                                color:  "black"
                                width:  ScreenTools.defaultFontPixelWidth * 12
                                font.pixelSize: ScreenTools.smallFontPixelSize
                                horizontalAlignment: Text.AlignHCenter
                            }
                            Label {
                                text:  QGroundControl.mapEngineManager.tileSizeStr
                                color: "black"
                                width: ScreenTools.defaultFontPixelWidth * 12
                                horizontalAlignment: Text.AlignHCenter
                            }
                        }
                    }
                }
                Column {
                    anchors.verticalCenter: parent.verticalCenter
                    spacing:            ScreenTools.defaultFontPixelHeight * 0.5
                    Row {
                        spacing:        ScreenTools.defaultFontPixelWidth * 2
                        QGCLabel {
616
                            text:   qsTr("Name:")
dogmaphobic's avatar
dogmaphobic committed
617 618 619 620 621 622
                            width:  ScreenTools.defaultFontPixelWidth * 10
                            anchors.verticalCenter: parent.verticalCenter
                            horizontalAlignment: Text.AlignRight
                        }
                        QGCTextField {
                            id:     setName
623
                            width:  ScreenTools.defaultFontPixelWidth * 24
dogmaphobic's avatar
dogmaphobic committed
624 625 626 627 628 629
                            anchors.verticalCenter: parent.verticalCenter
                        }
                    }
                    Row {
                        spacing: ScreenTools.defaultFontPixelWidth * 2
                        QGCLabel {
630
                            text:  qsTr("Description:")
dogmaphobic's avatar
dogmaphobic committed
631 632 633 634 635 636
                            width:  ScreenTools.defaultFontPixelWidth * 10
                            anchors.verticalCenter: parent.verticalCenter
                            horizontalAlignment: Text.AlignRight
                        }
                        QGCTextField {
                            id:     setDescription
637
                            text:   qsTr("Description")
638
                            width:  ScreenTools.defaultFontPixelWidth * 24
dogmaphobic's avatar
dogmaphobic committed
639 640 641 642 643 644
                            anchors.verticalCenter: parent.verticalCenter
                        }
                    }
                    Row {
                        spacing: ScreenTools.defaultFontPixelWidth * 2
                        QGCLabel {
645
                            text:  qsTr("Map Type:")
dogmaphobic's avatar
dogmaphobic committed
646 647 648 649 650 651
                            width:  ScreenTools.defaultFontPixelWidth * 10
                            anchors.verticalCenter: parent.verticalCenter
                            horizontalAlignment: Text.AlignRight
                        }
                        QGCComboBox {
                            id:         mapCombo
652
                            width:      ScreenTools.defaultFontPixelWidth * 24
dogmaphobic's avatar
dogmaphobic committed
653 654 655 656 657 658 659 660 661 662
                            model:      QGroundControl.mapEngineManager.mapList
                            onActivated: {
                                mapType = textAt(index)
                                if(_dropButtonsExclusiveGroup.current)
                                    _dropButtonsExclusiveGroup.current.checked = false
                                _dropButtonsExclusiveGroup.current = null
                            }
                            Component.onCompleted: {
                                var index = mapCombo.find(mapType)
                                if (index === -1) {
663
                                    console.warn(qsTr("Active map name not in combo"), mapType)
dogmaphobic's avatar
dogmaphobic committed
664 665 666 667 668 669 670 671 672
                                } else {
                                    mapCombo.currentIndex = index
                                }
                            }
                        }
                    }
                }
                Item {
                    height: 1
673
                    width:  ScreenTools.defaultFontPixelWidth * 1.5
dogmaphobic's avatar
dogmaphobic committed
674 675 676 677 678
                }
                Column {
                    anchors.verticalCenter: parent.verticalCenter
                    spacing: ScreenTools.defaultFontPixelHeight * 0.5
                    QGCButton {
679
                        text:  qsTr("Download")
dogmaphobic's avatar
dogmaphobic committed
680 681 682 683 684 685
                        enabled: setName.text.length > 0
                        width: ScreenTools.defaultFontPixelWidth * 10
                        onClicked: {
                            if(QGroundControl.mapEngineManager.findName(setName.text)) {
                                duplicateName.visible = true
                            } else {
686
                                /* This does not work if hosted by QQuickWidget. Waiting until we're 100% QtQuick
dogmaphobic's avatar
dogmaphobic committed
687 688 689 690 691 692 693 694 695 696
                                var mapImage
                                _map.grabToImage(function(result) { mapImage = result; })
                                QGroundControl.mapEngineManager.startDownload(setName.text, setDescription.text, mapType, mapImage);
                                */
                                QGroundControl.mapEngineManager.startDownload(setName.text, setDescription.text, mapType);
                                showList()
                            }
                        }
                    }
                    QGCButton {
697
                        text:  qsTr("Cancel")
dogmaphobic's avatar
dogmaphobic committed
698 699 700 701 702 703 704 705 706 707
                        width: ScreenTools.defaultFontPixelWidth * 10
                        onClicked: {
                            showList()
                        }
                    }
                    MessageDialog {
                        id:         duplicateName
                        visible:    false
                        icon:       StandardIcon.Warning
                        standardButtons: StandardButton.Ok
708 709
                        title:      qsTr("Tile Set Already Exists")
                        text:       qsTr("Tile Set \"%1\" already exists.\nPlease select a different name.").arg(setName.text)
dogmaphobic's avatar
dogmaphobic committed
710 711 712 713 714 715 716 717
                        onYes: {
                            duplicateName.visible = false
                        }
                    }
                }
            }
        }
    }
718
    //-- Show info on current selected map tile set
dogmaphobic's avatar
dogmaphobic committed
719 720
    Rectangle {
        id:                 _infoView
721
        color:              qgcPal.windowShade
dogmaphobic's avatar
dogmaphobic committed
722 723 724 725 726
        width:              parent.width
        anchors.top:        _offlineMapTopRect.bottom
        anchors.bottom:     parent.bottom
        anchors.margins:    ScreenTools.defaultFontPixelWidth
        visible:            false
dogmaphobic's avatar
dogmaphobic committed
727 728 729 730 731 732 733 734 735 736 737 738 739
        QGCFlickable {
            id:                 infoScroll
            anchors.fill:       parent
            contentHeight:      infoColumn.height
            flickableDirection: Flickable.VerticalFlick
            clip:               true
            Column {
                id:             infoColumn
                width:          parent.width
                spacing:        ScreenTools.defaultFontPixelHeight
                Item {
                    height:     ScreenTools.defaultFontPixelHeight * 0.5
                    width:      1
dogmaphobic's avatar
dogmaphobic committed
740
                }
dogmaphobic's avatar
dogmaphobic committed
741
                Rectangle {
742
                    id:         _infoNameRect
dogmaphobic's avatar
dogmaphobic committed
743
                    width:      infoWidth
744
                    height:     infoCol.height + (ScreenTools.defaultFontPixelHeight * 2)
745
                    color:      qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
746 747
                    radius:     ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.horizontalCenter: parent.horizontalCenter
748 749 750
                    Column {
                        id:         infoCol
                        spacing:    ScreenTools.defaultFontPixelHeight
dogmaphobic's avatar
dogmaphobic committed
751
                        anchors.centerIn: parent
752 753 754 755 756 757 758 759 760 761 762
                        QGCLabel {
                            id:     nameLabel
                            text:   _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.name : ""
                            font.pixelSize:   ScreenTools.isAndroid ? ScreenTools.mediumFontPixelSize : ScreenTools.largeFontPixelSize
                            anchors.horizontalCenter: parent.horizontalCenter
                        }
                        QGCLabel {
                            id:     descLabel
                            text:   _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.description : ""
                            anchors.horizontalCenter: parent.horizontalCenter
                        }
dogmaphobic's avatar
dogmaphobic committed
763 764
                    }
                }
dogmaphobic's avatar
dogmaphobic committed
765
                Rectangle {
766
                    id:         _infoRect
dogmaphobic's avatar
dogmaphobic committed
767 768
                    width:      infoWidth
                    height:     infoGrid.height + (ScreenTools.defaultFontPixelHeight * 4)
769
                    color:      qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
770 771 772 773 774 775 776 777 778 779
                    radius:     ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.horizontalCenter: parent.horizontalCenter
                    GridLayout {
                        id:                 infoGrid
                        columns:            2
                        anchors.centerIn:   parent
                        anchors.margins:    ScreenTools.defaultFontPixelWidth  * 2
                        rowSpacing:         ScreenTools.defaultFontPixelWidth
                        columnSpacing:      ScreenTools.defaultFontPixelHeight * 2
                        QGCLabel {
780
                            text:       qsTr("Map Type:")
dogmaphobic's avatar
dogmaphobic committed
781 782 783 784 785 786 787
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.mapTypeStr : ""
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
788
                            text:       qsTr("Min Zoom:")
dogmaphobic's avatar
dogmaphobic committed
789 790 791 792 793 794 795
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.minZoom : ""
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
796
                            text:       qsTr("Max Zoom:")
dogmaphobic's avatar
dogmaphobic committed
797 798 799 800 801 802 803
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.maxZoom : ""
                            visible:    !isDefaultSet
                        }
                        QGCLabel {
804
                            text:       isDefaultSet ? qsTr("Default Set Size:") : qsTr("Total Size:")
dogmaphobic's avatar
dogmaphobic committed
805 806 807 808 809
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.tilesSizeStr : ""
                        }
                        QGCLabel {
810
                            text:       isDefaultSet ? qsTr("Default Set Tile Count:") : qsTr("Total Tile Count:")
dogmaphobic's avatar
dogmaphobic committed
811 812 813 814 815
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.numTilesStr : ""
                        }
                        QGCLabel {
816
                            text:       isDefaultSet ? qsTr("Total Size (All Sets):") : qsTr("Downloaded Size:")
dogmaphobic's avatar
dogmaphobic committed
817 818 819 820 821
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.savedSizeStr : ""
                        }
                        QGCLabel {
822
                            text:       isDefaultSet ? qsTr("Total Count (All Sets):") : qsTr("Downloaded Count:")
dogmaphobic's avatar
dogmaphobic committed
823 824 825 826 827
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.savedTilesStr : ""
                        }
                        QGCLabel {
828
                            text:       qsTr("Error Count:")
dogmaphobic's avatar
dogmaphobic committed
829 830 831 832 833 834
                            visible:    !isDefaultSet && _offlineMapRoot._currentSelection && !_offlineMapRoot._currentSelection.complete
                        }
                        QGCLabel {
                            text:       _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.errorCountStr : ""
                            visible:    !isDefaultSet && _offlineMapRoot._currentSelection && !_offlineMapRoot._currentSelection.complete
                        }
dogmaphobic's avatar
dogmaphobic committed
835
                    }
dogmaphobic's avatar
dogmaphobic committed
836 837 838 839 840 841 842 843 844 845
                }
                Item {
                    height:     ScreenTools.defaultFontPixelHeight * 0.5
                    width:      1
                }
                Row {
                    anchors.horizontalCenter: parent.horizontalCenter
                    spacing: ScreenTools.defaultFontPixelWidth
                    QGCButton {
                        width:      ScreenTools.defaultFontPixelWidth * 18
846
                        text:       qsTr("Delete")
dogmaphobic's avatar
dogmaphobic committed
847 848 849 850 851 852 853 854 855 856
                        enabled:    _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting)
                        onClicked: {
                            if(_offlineMapRoot._currentSelection)
                                deleteDialog.visible = true
                        }
                        MessageDialog {
                            id:         deleteDialog
                            visible:    false
                            icon:       StandardIcon.Warning
                            standardButtons: StandardButton.Yes | StandardButton.No
857
                            title:      qsTr("Delete Tile Set")
dogmaphobic's avatar
dogmaphobic committed
858 859
                            text:       {
                                if(_offlineMapRoot._currentSelection) {
860
                                    var blurb = qsTr("Delete %1 and all its tiles.\nIs this really what you want?").arg(_offlineMapRoot._currentSelection.name)
dogmaphobic's avatar
dogmaphobic committed
861
                                    if(_offlineMapRoot._currentSelection.defaultSet)
862
                                        return blurb + qsTr("\nNote that deleteting the Default Set deletes all tiles from all sets.")
dogmaphobic's avatar
dogmaphobic committed
863 864 865 866 867 868
                                    else
                                        return blurb
                                }
                                return ""
                            }
                            onYes: {
869
                                leaveInfoView()
dogmaphobic's avatar
dogmaphobic committed
870 871 872 873 874 875 876
                                if(_offlineMapRoot._currentSelection)
                                    QGroundControl.mapEngineManager.deleteTileSet(_offlineMapRoot._currentSelection)
                                deleteDialog.visible = false
                                showList()
                            }
                            onNo: {
                                deleteDialog.visible = false
dogmaphobic's avatar
dogmaphobic committed
877 878
                            }
                        }
dogmaphobic's avatar
dogmaphobic committed
879 880
                    }
                    QGCButton {
881
                        text:       qsTr("Resume Download")
dogmaphobic's avatar
dogmaphobic committed
882 883 884 885
                        width:      ScreenTools.defaultFontPixelWidth * 18
                        enabled:    _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting && !_offlineMapRoot._currentSelection.downloading)
                        visible:    !isDefaultSet && _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.complete && !_offlineMapRoot._currentSelection.downloading)
                        onClicked: {
dogmaphobic's avatar
dogmaphobic committed
886
                            if(_offlineMapRoot._currentSelection)
dogmaphobic's avatar
dogmaphobic committed
887
                                _offlineMapRoot._currentSelection.resumeDownloadTask()
dogmaphobic's avatar
dogmaphobic committed
888 889
                        }
                    }
dogmaphobic's avatar
dogmaphobic committed
890
                    QGCButton {
891
                        text:       qsTr("Cancel Download")
dogmaphobic's avatar
dogmaphobic committed
892 893 894 895 896 897 898
                        width:      ScreenTools.defaultFontPixelWidth * 18
                        enabled:    _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting && _offlineMapRoot._currentSelection.downloading)
                        visible:    !isDefaultSet && _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.complete && _offlineMapRoot._currentSelection.downloading)
                        onClicked: {
                            if(_offlineMapRoot._currentSelection)
                                _offlineMapRoot._currentSelection.cancelDownloadTask()
                        }
dogmaphobic's avatar
dogmaphobic committed
899
                    }
dogmaphobic's avatar
dogmaphobic committed
900
                    QGCButton {
901
                        text:       qsTr("Back")
dogmaphobic's avatar
dogmaphobic committed
902
                        width:      ScreenTools.defaultFontPixelWidth * 18
903 904 905 906
                        onClicked: {
                            leaveInfoView()
                            showList()
                        }
dogmaphobic's avatar
dogmaphobic committed
907 908 909 910 911 912 913
                    }
                }
            }
        }
    }
    Rectangle {
        id:                 _optionsView
914
        color:              qgcPal.windowShade
dogmaphobic's avatar
dogmaphobic committed
915 916 917 918 919 920 921 922 923
        width:              parent.width
        anchors.top:        _offlineMapTopRect.bottom
        anchors.bottom:     parent.bottom
        anchors.margins:    ScreenTools.defaultFontPixelWidth
        visible:            false
        onVisibleChanged: {
            if(_optionsView.visible) {
                mapBoxToken.text     = QGroundControl.mapEngineManager.mapboxToken
                maxCacheSize.text    = QGroundControl.mapEngineManager.maxDiskCache
924
                maxCacheMemSize.text = QGroundControl.mapEngineManager.maxMemCache
dogmaphobic's avatar
dogmaphobic committed
925 926
            }
        }
dogmaphobic's avatar
dogmaphobic committed
927 928 929 930 931 932 933 934 935 936 937 938 939
        QGCFlickable {
            id:                 optionsScroll
            anchors.fill:       parent
            contentHeight:      optionsColumn.height
            flickableDirection: Flickable.VerticalFlick
            clip:               true
            Column {
                id:             optionsColumn
                width:          parent.width
                spacing:        ScreenTools.defaultFontPixelHeight
                Item {
                    height:     ScreenTools.defaultFontPixelHeight
                    width:      1
dogmaphobic's avatar
dogmaphobic committed
940
                }
dogmaphobic's avatar
dogmaphobic committed
941 942 943
                Rectangle {
                    width:      infoWidth
                    height:     optionsLabel.height + (ScreenTools.defaultFontPixelHeight * 2)
944
                    color:      qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
945 946
                    radius:     ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.horizontalCenter: parent.horizontalCenter
dogmaphobic's avatar
dogmaphobic committed
947
                    QGCLabel {
dogmaphobic's avatar
dogmaphobic committed
948
                        id:     optionsLabel
Tomaz Canabrava's avatar
Tomaz Canabrava committed
949
                        text:   qsTr("Offline Map Options")
dogmaphobic's avatar
dogmaphobic committed
950 951
                        font.pixelSize:     ScreenTools.isAndroid ? ScreenTools.mediumFontPixelSize : ScreenTools.largeFontPixelSize
                        anchors.centerIn:   parent
dogmaphobic's avatar
dogmaphobic committed
952
                    }
dogmaphobic's avatar
dogmaphobic committed
953 954 955 956 957
                }
                Rectangle {
                    id:         optionsRect
                    width:      optionsGrid.width  + (ScreenTools.defaultFontPixelWidth * 4)
                    height:     optionsGrid.height + (ScreenTools.defaultFontPixelHeight * 4)
958
                    color:      qgcPal.window
dogmaphobic's avatar
dogmaphobic committed
959 960 961 962 963 964 965 966 967
                    radius:     ScreenTools.defaultFontPixelHeight * 0.5
                    anchors.horizontalCenter: parent.horizontalCenter
                    GridLayout {
                        id:                 optionsGrid
                        columns:            2
                        anchors.centerIn:   parent
                        anchors.margins:    ScreenTools.defaultFontPixelWidth  * 2
                        rowSpacing:         ScreenTools.defaultFontPixelWidth  * 1.5
                        columnSpacing:      ScreenTools.defaultFontPixelHeight * 2
dogmaphobic's avatar
dogmaphobic committed
968
                        QGCLabel {
969
                            text:       qsTr("Max Cache Disk Size (MB):")
dogmaphobic's avatar
dogmaphobic committed
970 971 972 973 974 975 976 977
                        }
                        QGCTextField {
                            id:             maxCacheSize
                            maximumLength:  6
                            inputMethodHints: Qt.ImhDigitsOnly
                            validator: IntValidator {bottom: 1; top: 262144;}
                        }
                        QGCLabel {
978
                            text:       qsTr("Max Cache Memory Size (MB):")
dogmaphobic's avatar
dogmaphobic committed
979 980 981 982 983 984 985 986 987 988 989 990 991
                        }
                        QGCTextField {
                            id:             maxCacheMemSize
                            maximumLength:  4
                            inputMethodHints: Qt.ImhDigitsOnly
                            validator: IntValidator {bottom: 1; top: 4096;}
                        }
                        Item {
                            Layout.columnSpan:  2
                            Layout.fillWidth:   true
                            implicitHeight:     ScreenTools.defaultFontPixelHeight * 1.5
                            QGCLabel {
                                anchors.centerIn: parent
992
                                text: qsTr("Memory cache changes require a restart to take effect.")
dogmaphobic's avatar
dogmaphobic committed
993 994 995 996 997 998 999
                                font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85
                            }
                        }
                        Rectangle {
                            Layout.columnSpan:  2
                            Layout.fillWidth:   true
                            implicitHeight:     1
1000
                            color:              qgcPal.text
dogmaphobic's avatar
dogmaphobic committed
1001 1002
                        }
                        QGCLabel {
1003
                            text: qsTr("MapBox Access Token")
dogmaphobic's avatar
dogmaphobic committed
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016
                        }
                        QGCTextField {
                            id:                 mapBoxToken
                            Layout.fillWidth:   true
                            maximumLength:      256
                            implicitWidth :     ScreenTools.defaultFontPixelWidth * 30
                        }
                        Item {
                            Layout.columnSpan:  2
                            Layout.fillWidth:   true
                            implicitHeight:     ScreenTools.defaultFontPixelHeight * 1.5
                            QGCLabel {
                                anchors.centerIn: parent
1017
                                text: qsTr("With an access token, you can use MapBox Maps.")
dogmaphobic's avatar
dogmaphobic committed
1018 1019
                                font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85
                            }
dogmaphobic's avatar
dogmaphobic committed
1020 1021 1022
                        }
                    }
                }
dogmaphobic's avatar
dogmaphobic committed
1023 1024 1025 1026
                Row {
                    anchors.horizontalCenter: parent.horizontalCenter
                    spacing: ScreenTools.defaultFontPixelWidth
                    QGCButton {
1027
                        text:       qsTr("Save")
dogmaphobic's avatar
dogmaphobic committed
1028 1029 1030 1031 1032 1033 1034
                        width:      ScreenTools.defaultFontPixelWidth * 18
                        onClicked:  {
                            QGroundControl.mapEngineManager.mapboxToken  = mapBoxToken.text
                            QGroundControl.mapEngineManager.maxDiskCache = parseInt(maxCacheSize.text)
                            QGroundControl.mapEngineManager.maxMemCache  = parseInt(maxCacheMemSize.text)
                            showList()
                        }
dogmaphobic's avatar
dogmaphobic committed
1035
                    }
dogmaphobic's avatar
dogmaphobic committed
1036
                    QGCButton {
1037
                        text:       qsTr("Cancel")
dogmaphobic's avatar
dogmaphobic committed
1038 1039 1040 1041
                        width:      ScreenTools.defaultFontPixelWidth * 18
                        onClicked:  {
                            showList()
                        }
dogmaphobic's avatar
dogmaphobic committed
1042 1043 1044 1045 1046 1047
                    }
                }
            }
        }
    }
}