CameraPageWidget.qml 25.9 KB
Newer Older
1 2
/****************************************************************************
 *
Gus Grubba's avatar
Gus Grubba committed
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8 9
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11 12 13 14 15
import QtQuick                  2.4
import QtPositioning            5.2
import QtQuick.Layouts          1.2
import QtQuick.Controls         1.4
import QtQuick.Dialogs          1.2
import QtGraphicalEffects       1.0
16

17 18 19 20 21 22 23 24
import QGroundControl                   1.0
import QGroundControl.ScreenTools       1.0
import QGroundControl.Controls          1.0
import QGroundControl.Palette           1.0
import QGroundControl.Vehicle           1.0
import QGroundControl.Controllers       1.0
import QGroundControl.FactSystem        1.0
import QGroundControl.FactControls      1.0
25 26 27 28

/// Camera page for Instrument Panel PageView
Column {
    width:      pageWidth
Gus Grubba's avatar
Gus Grubba committed
29
    spacing:    ScreenTools.defaultFontPixelHeight * 0.25
30

31
    property bool   showSettingsIcon:       _camera !== null
32

Gus Grubba's avatar
Gus Grubba committed
33
    property var    _dynamicCameras:        activeVehicle ? activeVehicle.dynamicCameras : null
34
    property bool   _isCamera:              _dynamicCameras ? _dynamicCameras.cameras.count > 0 : false
35
    property int    _curCameraIndex:        _dynamicCameras ? _dynamicCameras.currentCamera : 0
36
    property var    _camera:                _isCamera ? (_dynamicCameras.cameras.get(_curCameraIndex) && _dynamicCameras.cameras.get(_curCameraIndex).paramComplete ? _dynamicCameras.cameras.get(_curCameraIndex) : null) : null
37 38 39
    property bool   _cameraModeUndefined:   _camera ? _camera.cameraMode === QGCCameraControl.CAM_MODE_UNDEFINED : true
    property bool   _cameraVideoMode:       _camera ? _camera.cameraMode === QGCCameraControl.CAM_MODE_VIDEO : false
    property bool   _cameraPhotoMode:       _camera ? _camera.cameraMode === QGCCameraControl.CAM_MODE_PHOTO : false
40
    property bool   _cameraElapsedMode:     _camera && _camera.cameraMode === QGCCameraControl.CAM_MODE_PHOTO && _camera.photoMode === QGCCameraControl.PHOTO_CAPTURE_TIMELAPSE
41 42 43
    property real   _spacers:               ScreenTools.defaultFontPixelHeight * 0.5
    property real   _labelFieldWidth:       ScreenTools.defaultFontPixelWidth * 30
    property real   _editFieldWidth:        ScreenTools.defaultFontPixelWidth * 30
Gus Grubba's avatar
Gus Grubba committed
44
    property bool   _communicationLost:     activeVehicle ? activeVehicle.connectionLost : false
45
    property bool   _streamingEnabled:      false //TODO: determine what it should be, VideoPageWidget.qml does QGroundControl.settingsManager.videoSettings.streamConfigured
46
    property bool   _hasModes:              _camera && _camera.hasModes
Gus Grubba's avatar
Gus Grubba committed
47
    property bool   _videoRecording:        _camera && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING
48
    property bool   _photoIdle:             _camera && (_camera.photoStatus === QGCCameraControl.PHOTO_CAPTURE_IDLE || _camera.photoStatus >= QGCCameraControl.PHOTO_CAPTURE_LAST)
49
    property bool   _storageReady:          _camera && _camera.storageStatus === QGCCameraControl.STORAGE_READY
50
    property bool   _batteryReady:          _camera && _camera.batteryRemaining >= 0
51
    property bool   _storageIgnored:        _camera && _camera.storageStatus === QGCCameraControl.STORAGE_NOT_SUPPORTED
52
    property bool   _canShoot:              !_cameraModeUndefined && ((_storageReady && _camera.storageFree > 0) || _storageIgnored)
olliw42's avatar
olliw42 committed
53
    property bool   _isShooting:            (_cameraVideoMode && _videoRecording) || (_cameraPhotoMode && !_photoIdle)
54

55
    function showSettings() {
56
        mainWindow.showComponentDialog(cameraSettings, _cameraVideoMode ? qsTr("Video Settings") : qsTr("Camera Settings"), 70, StandardButton.Ok)
57 58 59
    }

    //-- Dumb camera trigger if no actual camera interface exists
60 61 62
    QGCButton {
        anchors.horizontalCenter:   parent.horizontalCenter
        text:                       qsTr("Trigger Camera")
63
        visible:                    !_camera
Gus Grubba's avatar
Gus Grubba committed
64 65
        onClicked:                  activeVehicle.triggerCamera()
        enabled:                    activeVehicle
66
    }
67
    Item { width: 1; height: ScreenTools.defaultFontPixelHeight; visible: _camera; }
68 69 70
    //-- Actual controller
    QGCLabel {
        id:             cameraLabel
71 72
        text:           _camera ? _camera.modelName : qsTr("Camera")
        visible:        _camera
73
        font.pointSize: ScreenTools.defaultFontPointSize
74 75
        anchors.horizontalCenter: parent.horizontalCenter
    }
Gus Grubba's avatar
Gus Grubba committed
76 77
    QGCLabel {
        text: _camera ? qsTr("Free Space: ") + _camera.storageFreeStr : ""
78
        font.pointSize: ScreenTools.defaultFontPointSize
Gus Grubba's avatar
Gus Grubba committed
79
        anchors.horizontalCenter: parent.horizontalCenter
olliw42's avatar
olliw42 committed
80
        visible: _storageReady
Gus Grubba's avatar
Gus Grubba committed
81
    }
82 83
    QGCLabel {
        text: _camera ? qsTr("Battery: ") + _camera.batteryRemainingStr : ""
84
        font.pointSize: ScreenTools.defaultFontPointSize
85
        anchors.horizontalCenter: parent.horizontalCenter
olliw42's avatar
olliw42 committed
86
        visible: _batteryReady
87
    }
88
    //-- Camera Mode (visible only if camera has modes)
Gus Grubba's avatar
Gus Grubba committed
89
    Item { width: 1; height: ScreenTools.defaultFontPixelHeight * 0.75; visible: camMode.visible; }
90
    Rectangle {
Gus Grubba's avatar
Gus Grubba committed
91
        id:         camMode
Gus Grubba's avatar
Gus Grubba committed
92 93 94
        width:      _hasModes ? ScreenTools.defaultFontPixelWidth * 8 : 0
        height:     _hasModes ? ScreenTools.defaultFontPixelWidth * 4 : 0
        color:      qgcPal.button
95 96 97 98 99
        radius:     height * 0.5
        visible:    _hasModes
        anchors.horizontalCenter: parent.horizontalCenter
        //-- Video Mode
        Rectangle {
Gus Grubba's avatar
Gus Grubba committed
100 101 102
            width:  parent.height
            height: parent.height
            color:  _cameraVideoMode ? qgcPal.window : qgcPal.button
103 104
            radius: height * 0.5
            anchors.left: parent.left
Gus Grubba's avatar
Gus Grubba committed
105 106
            border.color: qgcPal.text
            border.width: _cameraVideoMode ? 1 : 0
107 108
            anchors.verticalCenter: parent.verticalCenter
            QGCColoredImage {
Gus Grubba's avatar
Gus Grubba committed
109 110 111
                height:             parent.height * 0.5
                width:              height
                anchors.centerIn:   parent
112 113 114 115 116 117
                source:             "/qmlimages/camera_video.svg"
                fillMode:           Image.PreserveAspectFit
                sourceSize.height:  height
                color:              _cameraVideoMode ? qgcPal.colorGreen : qgcPal.text
                MouseArea {
                    anchors.fill:   parent
olliw42's avatar
olliw42 committed
118
                    enabled:        _cameraPhotoMode && !_isShooting
119 120 121 122 123 124 125 126
                    onClicked: {
                        _camera.setVideoMode()
                    }
                }
            }
        }
        //-- Photo Mode
        Rectangle {
Gus Grubba's avatar
Gus Grubba committed
127 128 129
            width:  parent.height
            height: parent.height
            color:  _cameraPhotoMode ? qgcPal.window : qgcPal.button
130 131
            radius: height * 0.5
            anchors.right: parent.right
Gus Grubba's avatar
Gus Grubba committed
132 133
            border.color: qgcPal.text
            border.width: _cameraPhotoMode ? 1 : 0
134 135
            anchors.verticalCenter: parent.verticalCenter
            QGCColoredImage {
Gus Grubba's avatar
Gus Grubba committed
136 137 138
                height:             parent.height * 0.5
                width:              height
                anchors.centerIn:   parent
139 140 141 142 143 144
                source:             "/qmlimages/camera_photo.svg"
                fillMode:           Image.PreserveAspectFit
                sourceSize.height:  height
                color:              _cameraPhotoMode ? qgcPal.colorGreen : qgcPal.text
                MouseArea {
                    anchors.fill:   parent
olliw42's avatar
olliw42 committed
145
                    enabled:        _cameraVideoMode && !_isShooting
146 147 148 149 150 151 152 153
                    onClicked: {
                        _camera.setPhotoMode()
                    }
                }
            }
        }
    }
    //-- Shutter
Gus Grubba's avatar
Gus Grubba committed
154
    Item { width: 1; height: ScreenTools.defaultFontPixelHeight * 0.75; visible: camShutter.visible; }
155
    Rectangle {
Gus Grubba's avatar
Gus Grubba committed
156
        id:         camShutter
157 158 159 160
        color:      Qt.rgba(0,0,0,0)
        width:      ScreenTools.defaultFontPixelWidth * 6
        height:     width
        radius:     width * 0.5
161
        visible:    _camera
162 163 164 165
        border.color: qgcPal.buttonText
        border.width: 3
        anchors.horizontalCenter: parent.horizontalCenter
        Rectangle {
olliw42's avatar
olliw42 committed
166
            width:      parent.width * (_isShooting ? 0.5 : 0.75)
167
            height:     width
olliw42's avatar
olliw42 committed
168
            radius:     _isShooting ? 0 : width * 0.5
169
            color:      _canShoot ? qgcPal.colorRed : qgcPal.colorGrey
170 171 172 173
            anchors.centerIn:   parent
        }
        MouseArea {
            anchors.fill:   parent
174
            enabled:        _canShoot
175 176
            onClicked: {
                if(_cameraVideoMode) {
Gus Grubba's avatar
Gus Grubba committed
177
                    _camera.toggleVideo()
178
                } else {
179
                    if(_cameraPhotoMode && !_photoIdle && _cameraElapsedMode) {
Gus Grubba's avatar
Gus Grubba committed
180 181 182 183
                        _camera.stopTakePhoto()
                    } else {
                        _camera.takePhoto()
                    }
184 185 186 187
                }
            }
        }
    }
olliw42's avatar
olliw42 committed
188
    //-- Timer/Counter
189
    Item { width: 1; height: ScreenTools.defaultFontPixelHeight * 0.75; visible: _camera; }
Gus Grubba's avatar
Gus Grubba committed
190 191
    QGCLabel {
        text: (_cameraVideoMode && _camera.videoStatus === QGCCameraControl.VIDEO_CAPTURE_STATUS_RUNNING) ? _camera.recordTimeStr : "00:00:00"
192
        font.pointSize: ScreenTools.defaultFontPointSize
Gus Grubba's avatar
Gus Grubba committed
193 194 195 196
        visible: _cameraVideoMode
        anchors.horizontalCenter: parent.horizontalCenter
    }
    QGCLabel {
Gus Grubba's avatar
Gus Grubba committed
197
        text: activeVehicle && _cameraPhotoMode ? ('00000' + activeVehicle.cameraTriggerPoints.count).slice(-5) : "00000"
198
        font.pointSize: ScreenTools.defaultFontPointSize
Gus Grubba's avatar
Gus Grubba committed
199 200 201
        visible: _cameraPhotoMode
        anchors.horizontalCenter: parent.horizontalCenter
    }
olliw42's avatar
olliw42 committed
202
    //-- Settings
203
    Item { width: 1; height: ScreenTools.defaultFontPixelHeight; visible: _camera; }
204 205 206 207 208 209 210 211 212 213 214 215 216 217
    Component {
        id: cameraSettings
        QGCViewDialog {
            id: _cameraSettingsDialog
            QGCFlickable {
                anchors.fill:       parent
                contentHeight:      camSettingsCol.height
                flickableDirection: Flickable.VerticalFlick
                clip:               true
                Column {
                    id:             camSettingsCol
                    anchors.left:   parent.left
                    anchors.right:  parent.right
                    spacing:        _margins
Gus Grubba's avatar
Gus Grubba committed
218 219
                    //-------------------------------------------
                    //-- Camera Selector
Gus Grubba's avatar
Gus Grubba committed
220
                    Row {
221 222
                        spacing:            ScreenTools.defaultFontPixelWidth
                        visible:            _isCamera && _dynamicCameras.cameraLabels.length > 1
Gus Grubba's avatar
Gus Grubba committed
223 224 225 226 227 228 229 230 231 232
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            text:           qsTr("Camera Selector:")
                            width:          _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCComboBox {
                            id:             cameraSelector
                            model:          _isCamera ? _dynamicCameras.cameraLabels : []
                            width:          _editFieldWidth
Gus Grubba's avatar
Gus Grubba committed
233 234
                            onActivated:    _dynamicCameras.currentCamera = index
                            currentIndex:   _dynamicCameras.currentCamera
Gus Grubba's avatar
Gus Grubba committed
235 236
                        }
                    }
Gus Grubba's avatar
Gus Grubba committed
237 238 239 240
                    //-------------------------------------------
                    //-- Stream Selector
                    Row {
                        spacing:            ScreenTools.defaultFontPixelWidth
241
                        visible:            _camera && _camera.streamLabels.length > 1
Gus Grubba's avatar
Gus Grubba committed
242 243 244 245 246 247 248 249 250 251 252 253 254
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            text:           qsTr("Stream Selector:")
                            width:          _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCComboBox {
                            model:          _camera ? _camera.streamLabels : []
                            width:          _editFieldWidth
                            onActivated:    _camera.currentStream = index
                            currentIndex:   _camera ? _camera.currentStream : 0
                        }
                    }
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295
                    //-------------------------------------------
                    //-- Thermal Modes
                    Row {
                        spacing:            ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        visible:            QGroundControl.videoManager.hasThermal
                        property var thermalModes: [qsTr("Off"), qsTr("Blend"), qsTr("Full"), qsTr("Picture In Picture")]
                        QGCLabel {
                            text:           qsTr("Thermal View Mode")
                            width:          _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCComboBox {
                            width:          _editFieldWidth
                            model:          parent.thermalModes
                            currentIndex:   _camera ? _camera.thermalMode : 0
                            onActivated:    _camera.thermalMode = index
                        }
                    }
                    //-------------------------------------------
                    //-- Thermal Video Opacity
                    Row {
                        spacing:            ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        visible:            QGroundControl.videoManager.hasThermal && _camera.thermalMode === QGCCameraControl.THERMAL_BLEND
                        QGCLabel {
                            text:           qsTr("Blend Opacity")
                            width:          _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        Slider {
                            width:          _editFieldWidth
                            maximumValue:   100
                            minimumValue:   0
                            value:          _camera ? _camera.thermalOpacity : 0
                            updateValueWhileDragging: true
                            onValueChanged: {
                                _camera.thermalOpacity = value
                            }
                        }
                    }
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
                    //-------------------------------------------
                    //-- Camera Settings
                    Repeater {
                        model:      _camera ? _camera.activeSettings : []
                        Row {
                            spacing:        ScreenTools.defaultFontPixelWidth
                            anchors.horizontalCenter: parent.horizontalCenter
                            property var    _fact:      _camera.getFact(modelData)
                            property bool   _isBool:    _fact.typeIsBool
                            property bool   _isCombo:   !_isBool && _fact.enumStrings.length > 0
                            property bool   _isSlider:  _fact && !isNaN(_fact.increment)
                            property bool   _isEdit:    !_isBool && !_isSlider && _fact.enumStrings.length < 1
                            QGCLabel {
                                text:       parent._fact.shortDescription
                                width:      _labelFieldWidth
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactComboBox {
                                width:      parent._isCombo ? _editFieldWidth : 0
                                fact:       parent._fact
                                indexModel: false
                                visible:    parent._isCombo
                                anchors.verticalCenter: parent.verticalCenter
                            }
                            FactTextField {
                                width:      parent._isEdit ? _editFieldWidth : 0
                                fact:       parent._fact
                                visible:    parent._isEdit
                            }
                            QGCSlider {
                                width:          parent._isSlider ? _editFieldWidth : 0
                                maximumValue:   parent._fact.max
                                minimumValue:   parent._fact.min
                                stepSize:       parent._fact.increment
                                visible:        parent._isSlider
                                updateValueWhileDragging:   false
                                anchors.verticalCenter:     parent.verticalCenter
                                Component.onCompleted: {
                                    value = parent._fact.value
                                }
                                onValueChanged: {
                                    parent._fact.value = value
                                }
                            }
                            Item {
                                width:      parent._isBool ? _editFieldWidth : 0
                                height:     factSwitch.height
                                visible:    parent._isBool
                                anchors.verticalCenter: parent.verticalCenter
                                property var _fact: parent._fact
                                Switch {
                                    id: factSwitch
                                    anchors.left:   parent.left
                                    checked:        parent._fact ? parent._fact.value : false
                                    onClicked:      parent._fact.value = checked ? 1 : 0
                                }
                            }
                        }
                    }
                    //-------------------------------------------
Gus Grubba's avatar
Gus Grubba committed
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403
                    //-- Time Lapse
                    Row {
                        spacing:        ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        visible:        _cameraPhotoMode
                        property var photoModes: [qsTr("Single"), qsTr("Time Lapse")]
                        QGCLabel {
                            text:       qsTr("Photo Mode")
                            width:      _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCComboBox {
                            id:             photoModeCombo
                            width:          _editFieldWidth
                            model:          parent.photoModes
                            currentIndex:   _camera ? _camera.photoMode : 0
                            onActivated:    _camera.photoMode = index
                        }
                    }
                    //-------------------------------------------
                    //-- Time Lapse Interval
                    Row {
                        spacing:        ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        visible:        _cameraPhotoMode && _camera.photoMode === QGCCameraControl.PHOTO_CAPTURE_TIMELAPSE
                        QGCLabel {
                            text:       qsTr("Photo Interval (seconds)")
                            width:      _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        Item {
                            height:     photoModeCombo.height
                            width:      _editFieldWidth
                            QGCSlider {
                                maximumValue:   60
                                minimumValue:   1
                                stepSize:       1
                                value:          _camera ? _camera.photoLapse : 5
                                displayValue:   true
                                updateValueWhileDragging: true
                                anchors.fill:   parent
                                onValueChanged: {
                                    _camera.photoLapse = value
                                }
                            }
                        }
                    }
                    //-------------------------------------------
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
                    // Grid Lines
                    Row {
                        visible:                _camera && _camera.autoStream
                        spacing:                ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                           text:                qsTr("Grid Lines")
                           width:               _labelFieldWidth
                           anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCSwitch {
                            enabled:            _streamingEnabled && activeVehicle
                            checked:            QGroundControl.settingsManager.videoSettings.gridLines.rawValue
                            width:              _editFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                            onClicked: {
                                if(checked) {
                                    QGroundControl.settingsManager.videoSettings.gridLines.rawValue = 1
                                } else {
                                    QGroundControl.settingsManager.videoSettings.gridLines.rawValue = 0
                                }
                            }
                        }
                    }
                    //-------------------------------------------
                    //-- Video Fit
                    Row {
                        visible:                _camera && _camera.autoStream
                        spacing:                ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            text:               qsTr("Video Screen Fit")
                            width:               _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        FactComboBox {
                            fact:               QGroundControl.settingsManager.videoSettings.videoFit
                            indexModel:         false
                            width:              _editFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                    }
                    //-------------------------------------------
447 448
                    //-- Reset Camera
                    Row {
449
                        spacing:                ScreenTools.defaultFontPixelWidth
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            text:       qsTr("Reset Camera Defaults")
                            width:      _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCButton {
                            text:       qsTr("Reset")
                            onClicked:  resetPrompt.open()
                            width:      _editFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                            MessageDialog {
                                id:                 resetPrompt
                                title:              qsTr("Reset Camera to Factory Settings")
                                text:               qsTr("Confirm resetting all settings?")
                                standardButtons:    StandardButton.Yes | StandardButton.No
                                onNo: resetPrompt.close()
                                onYes: {
Gus Grubba's avatar
Gus Grubba committed
468
                                    _camera.resetSettings()
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
                                    resetPrompt.close()
                                }
                            }
                        }
                    }
                    //-------------------------------------------
                    //-- Format Storage
                    Row {
                        spacing:        ScreenTools.defaultFontPixelWidth
                        anchors.horizontalCenter: parent.horizontalCenter
                        QGCLabel {
                            text:       qsTr("Storage")
                            width:      _labelFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                        }
                        QGCButton {
                            text:       qsTr("Format")
                            onClicked:  formatPrompt.open()
                            width:      _editFieldWidth
                            anchors.verticalCenter: parent.verticalCenter
                            MessageDialog {
                                id:                 formatPrompt
                                title:              qsTr("Format Camera Storage")
                                text:               qsTr("Confirm erasing all files?")
                                standardButtons:    StandardButton.Yes | StandardButton.No
                                onNo: formatPrompt.close()
                                onYes: {
Gus Grubba's avatar
Gus Grubba committed
496
                                    _camera.formatCard()
497 498 499 500 501 502 503 504 505
                                    formatPrompt.close()
                                }
                            }
                        }
                    }
                }
            }
        }
    }
506
}