FirmwareUpgrade.qml 2.87 KB
Newer Older
1 2 3 4 5 6 7
import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2

import QGroundControl.Controls 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
8
import QGroundControl.FirmwareUpgradeController 1.0
9 10 11

Rectangle {
    width: 600
12
    height: 600
13 14

    property var qgcPal: QGCPalette { colorGroup: QGCPalette.Active }
15 16 17 18 19
    property FirmwareUpgradeController controller: FirmwareUpgradeController {
        upgradeButton: upgradeButton
        statusLog: statusTextArea
        firmwareType: FirmwareUpgradeController.StableFirmware
    }
20 21 22 23

    color: qgcPal.window

    Column {
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
        anchors.fill:parent

        Text {
            text: "FIRMWARE UPDATE"
            color: qgcPal.windowText
            font.pointSize: 20
        }

        Item {
            // Just used as a spacer
            height: 20
            width: 10
        }

        ExclusiveGroup { id: firmwareGroup }

40
        QGCRadioButton {
41 42
            id: stableFirwareRadio
            exclusiveGroup: firmwareGroup
43
            text: qsTr("Standard Version (stable)")
44 45 46 47 48 49
            checked: true
            enabled: upgradeButton.enabled
            onClicked: {
                if (checked)
                    controller.firmwareType = FirmwareUpgradeController.StableFirmware
            }
50 51
        }
        QGCRadioButton {
52 53
            id: betaFirwareRadio
            exclusiveGroup: firmwareGroup
54
            text: qsTr("Beta Testing (beta)")
55 56
            enabled: upgradeButton.enabled
            onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.BetaFirmware }
57 58
        }
        QGCRadioButton {
59 60
            id: devloperFirwareRadio
            exclusiveGroup: firmwareGroup
61
            text: qsTr("Developer Build (master)")
62 63
            enabled: upgradeButton.enabled
            onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.DeveloperFirmware }
64 65
        }
        QGCRadioButton {
66 67
            id: customFirwareRadio
            exclusiveGroup: firmwareGroup
68
            text: qsTr("Custom firmware file...")
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
            enabled: upgradeButton.enabled
            onClicked: { if (checked) controller.firmwareType = FirmwareUpgradeController.CustomFirmware }
        }

        Item {
            // Just used as a spacer
            height: 20
            width: 10
        }

        QGCButton {
            id: upgradeButton
            text: "UPGRADE"
            onClicked: {
                controller.doFirmwareUpgrade();
            }
        }

        Item {
            // Just used as a spacer
            height: 20
            width: 10
        }

        TextArea {
            id: statusTextArea
            width: parent.width
            height: 300
            readOnly: true
            style: TextAreaStyle {
                textColor: qgcPal.windowText
                backgroundColor: qgcPal.window
            }
102 103 104
        }
    }
}