| 1 |
// SPDX-FileCopyrightText: 2018 James Turner |
| 2 |
// SPDX-License-Identifier: GPL-2.0-or-later |
| 3 |
|
| 4 |
import QtQuick 2.4 |
| 5 |
import FlightGear.Launcher 1.0 |
| 6 |
|
| 7 |
Rectangle { |
| 8 |
id: root |
| 9 |
property int aircraftStatus |
| 10 |
property var requiredFGVersion |
| 11 |
|
| 12 |
visible: (aircraftStatus != LocalAircraftCache.AircraftOk) |
| 13 |
|
| 14 |
implicitHeight: warningText.height + 8 |
| 15 |
|
| 16 |
radius: 4 |
| 17 |
border.width: 2 |
| 18 |
border.color: "red" |
| 19 |
|
| 20 |
state: "ok" |
| 21 |
|
| 22 |
states: [ |
| 23 |
State { |
| 24 |
name: "ok" |
| 25 |
}, |
| 26 |
|
| 27 |
State { |
| 28 |
name: "sim-version-too-low" |
| 29 |
when: aircraftStatus == LocalAircraftCache.AircraftNeedsNewerSimulator |
| 30 |
|
| 31 |
PropertyChanges { |
| 32 |
target: warningText |
| 33 |
text: "This aircraft requires FlightGear version " + root.requiredFGVersion + " or higher." |
| 34 |
} |
| 35 |
}, |
| 36 |
|
| 37 |
State { |
| 38 |
name: "unmaintained" |
| 39 |
when: aircraftStatus == LocalAircraftCache.AircraftUnmaintained |
| 40 |
|
| 41 |
PropertyChanges { |
| 42 |
target: warningText |
| 43 |
text: "This aircraft is in need of maintenance, and may have bugs or incompatibilities. " |
| 44 |
+ "If you would like to contribute to fixing and improving this aircraft, please see " |
| 45 |
+ "<a href=\"\">this page on our wiki</a>."; |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
] |
| 50 |
|
| 51 |
Text { |
| 52 |
id: warningText |
| 53 |
anchors.verticalCenter: parent.verticalCenter |
| 54 |
font.bold: true |
| 55 |
linkColor: "#68A6E1" |
| 56 |
} |
| 57 |
} |