From a8a30ba1e76780bf247dd7dfe90f35e01dc24b72 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sun, 18 Oct 2015 13:13:20 -0700 Subject: [PATCH] Better visuals on no connected, and connected no components --- src/VehicleSetup/SetupView.qml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml index cc039b6..5744217 100644 --- a/src/VehicleSetup/SetupView.qml +++ b/src/VehicleSetup/SetupView.qml @@ -53,7 +53,11 @@ Item { function showSummaryPanel() { if (_fullParameterVehicleAvailable) { - panelLoader.source = "VehicleSummary.qml"; + if (multiVehicleManager.activeVehicle.autopilot.vehicleComponents.length == 0) { + panelLoader.sourceComponent = noComponentsVehicleSummaryComponent + } else { + panelLoader.source = "VehicleSummary.qml"; + } } else if (multiVehicleManager.parameterReadyVehicleAvailable) { panelLoader.sourceComponent = missingParametersVehicleSummaryComponent } else { @@ -115,7 +119,7 @@ Item { } Component { - id: disconnectedVehicleSummaryComponent + id: noComponentsVehicleSummaryComponent Rectangle { color: qgcPal.windowShade @@ -127,11 +131,8 @@ Item { horizontalAlignment: Text.AlignHCenter wrapMode: Text.WordWrap font.pixelSize: ScreenTools.mediumFontPixelSize - text: "Welcome to QGroundControl. " + - "QGroundControl supports any mavlink enabled vehicle. " + - "If you are using the PX4 Flight Stack, you also get full support for setting up and calibrating your vehicle. "+ - "Otherwise you will only get support for flying a vehicle which has been setup and calibrated using other means. " + - "Use the Connect button above to connect to your vehicle." + text: "QGroundControl does not currently support setup of your vehicle type. " + + "If your vehicle is already configured you can still Fly." onLinkActivated: Qt.openUrlExternally(link) } @@ -139,6 +140,25 @@ Item { } Component { + id: disconnectedVehicleSummaryComponent + + Rectangle { + color: qgcPal.windowShade + + QGCLabel { + anchors.margins: _defaultTextWidth * 2 + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + font.pixelSize: ScreenTools.largeFontPixelSize + text: "Click Connect on the top right to Fly. Click Firmware on the left to upgrade your vehicle." + + onLinkActivated: Qt.openUrlExternally(link) + } + } + } + Component { id: missingParametersVehicleSummaryComponent Rectangle { @@ -218,6 +238,7 @@ Item { width: _buttonWidth imageResource: "/qmlimages/VehicleSummaryIcon.png" setupIndicator: false + checked: true exclusiveGroup: setupButtonGroup text: "SUMMARY"