diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc
index 9d65b31..d7f24d6 100644
--- a/qgroundcontrol.qrc
+++ b/qgroundcontrol.qrc
@@ -3,18 +3,19 @@
src/FactSystem/FactSystemTest.qml
- src/ui/toolbar/MainToolBarIndicators.qml
src/ui/toolbar/ArmedIndicator.qml
src/ui/toolbar/BatteryIndicator.qml
src/ui/toolbar/GPSIndicator.qml
src/ui/toolbar/GPSRTKIndicator.qml
+ src/ui/toolbar/JoystickIndicator.qml
+ src/ui/toolbar/LinkIndicator.qml
+ src/ui/toolbar/MainToolBarIndicators.qml
src/ui/toolbar/MessageIndicator.qml
src/ui/toolbar/ModeIndicator.qml
- src/ui/toolbar/VTOLModeIndicator.qml
+ src/ui/toolbar/MultiVehicleSelector.qml
src/ui/toolbar/RCRSSIIndicator.qml
src/ui/toolbar/TelemetryRSSIIndicator.qml
- src/ui/toolbar/JoystickIndicator.qml
- src/ui/toolbar/LinkIndicator.qml
+ src/ui/toolbar/VTOLModeIndicator.qml
src/PlanView/CorridorScanEditor.qml
diff --git a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
index 8b22d09..53bb2ae 100644
--- a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
+++ b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
@@ -8,7 +8,6 @@ import QGroundControl.Palette 1.0
Item {
anchors.fill: parent
- color: qgcPal.windowShadeDark
FactPanelController { id: controller; }
diff --git a/src/FirmwarePlugin/FirmwarePlugin.cc b/src/FirmwarePlugin/FirmwarePlugin.cc
index 1790a4a..0ab4af0 100644
--- a/src/FirmwarePlugin/FirmwarePlugin.cc
+++ b/src/FirmwarePlugin/FirmwarePlugin.cc
@@ -321,6 +321,7 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
Q_UNUSED(vehicle);
//-- Default list of indicators for all vehicles.
if(_toolBarIndicatorList.size() == 0) {
+ _toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSIndicator.qml")));
_toolBarIndicatorList.append(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml")));
diff --git a/src/FlightDisplay/MultiVehicleList.qml b/src/FlightDisplay/MultiVehicleList.qml
index 2a050c6..64ffdc1 100644
--- a/src/FlightDisplay/MultiVehicleList.qml
+++ b/src/FlightDisplay/MultiVehicleList.qml
@@ -19,7 +19,7 @@ import QGroundControl.Vehicle 1.0
import QGroundControl.FlightMap 1.0
Item {
- property var guidedActionsController
+ property var guidedActionsController
property real _margin: ScreenTools.defaultFontPixelWidth / 2
property real _widgetHeight: ScreenTools.defaultFontPixelHeight * 3
@@ -111,7 +111,7 @@ Item {
QGCLabel {
Layout.alignment: Qt.AlignTop
- text: _vehicle.id
+ text: _vehicle ? _vehicle.id : ""
color: _textColor
}
@@ -128,7 +128,7 @@ Item {
QGCLabel {
Layout.alignment: Qt.AlignHCenter
- text: _vehicle.armed ? qsTr("Armed") : qsTr("Disarmed")
+ text: _vehicle && _vehicle.armed ? qsTr("Armed") : qsTr("Disarmed")
color: _textColor
}
}
diff --git a/src/ui/MainQmlWindow.qml b/src/ui/MainQmlWindow.qml
index 5c6a3e0..0da3d25 100644
--- a/src/ui/MainQmlWindow.qml
+++ b/src/ui/MainQmlWindow.qml
@@ -591,7 +591,7 @@ ApplicationWindow {
//-- System Messages
property var _messageQueue: []
- property string _systemMessage: ""
+ property string _systemMessage: ""
function showMessage(message) {
vehicleMessageArea.close()
@@ -616,7 +616,7 @@ ApplicationWindow {
y: ScreenTools.defaultFontPixelHeight
x: Math.round((mainWindow.width - width) * 0.5)
width: mainWindow.width * 0.55
- height: ScreenTools.defaultFontPixelHeight * 4
+ height: ScreenTools.defaultFontPixelHeight * 6
modal: false
focus: true
closePolicy: Popup.CloseOnEscape
@@ -640,7 +640,8 @@ ApplicationWindow {
//-- Show all messages in queue
for (var i = 0; i < mainWindow._messageQueue.length; i++) {
var text = mainWindow._messageQueue[i]
- mainWindow._systemMessage.append(text)
+ if(i) mainWindow._systemMessage += "
"
+ mainWindow._systemMessage += text
}
//-- Clear it
mainWindow._messageQueue = []
diff --git a/src/ui/toolbar/MainToolBarIndicators.qml b/src/ui/toolbar/MainToolBarIndicators.qml
index ade60c8..55105f2 100644
--- a/src/ui/toolbar/MainToolBarIndicators.qml
+++ b/src/ui/toolbar/MainToolBarIndicators.qml
@@ -81,61 +81,6 @@ Item {
anchors.leftMargin: ScreenTools.defaultFontPixelWidth * 2
spacing: ScreenTools.defaultFontPixelWidth * 1.5
visible: activeVehicle && !communicationLost
-
- //---------------------------------------------------------------------
- //-- Vehicle Selector
- QGCButton {
- id: vehicleSelectorButton
- width: visible ? 0 : ScreenTools.defaultFontPixelHeight * 8
- text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None")
- visible: QGroundControl.multiVehicleManager.vehicles.count > 1
- Layout.alignment: Qt.AlignVCenter
-
- onClicked: {
- vehicleMenu.popup()
- }
-
- Menu {
- id: vehicleMenu
- }
-
- Component {
- id: vehicleMenuItemComponent
- MenuItem {
- onTriggered: QGroundControl.multiVehicleManager.activeVehicle = vehicle
- property int vehicleId: Number(text.split(" ")[1])
- property var vehicle: QGroundControl.multiVehicleManager.getVehicleById(vehicleId)
- }
- }
-
- property var vehicleMenuItems: []
-
- function updateVehicleMenu() {
- var i;
- // Remove old menu items
- for (i = 0; i < vehicleMenuItems.length; i++) {
- vehicleMenu.removeItem(vehicleMenuItems[i])
- }
- vehicleMenuItems.length = 0
- // Add new items
- for (i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
- var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
- var menuItem = vehicleMenuItemComponent.createObject(null, { "text": "Vehicle " + vehicle.id })
- vehicleMenuItems.push(menuItem)
- vehicleMenu.insertItem(i, menuItem)
- }
- }
-
- Component.onCompleted: updateVehicleMenu()
-
- Connections {
- target: QGroundControl.multiVehicleManager.vehicles
- onCountChanged: vehicleSelectorButton.updateVehicleMenu()
- }
- }
-
- //---------------------------------------------------------------------
- //-- Indicators
Repeater {
model: activeVehicle ? activeVehicle.toolBarIndicators : []
Loader {
diff --git a/src/ui/toolbar/MultiVehicleSelector.qml b/src/ui/toolbar/MultiVehicleSelector.qml
new file mode 100644
index 0000000..2d52536
--- /dev/null
+++ b/src/ui/toolbar/MultiVehicleSelector.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+ *
+ * (c) 2009-2016 QGROUNDCONTROL PROJECT
+ *
+ * QGroundControl is licensed according to the terms in the file
+ * COPYING.md in the root of the source code directory.
+ *
+ ****************************************************************************/
+
+
+import QtQuick 2.3
+import QtQuick.Controls 1.2
+
+import QGroundControl 1.0
+import QGroundControl.Controls 1.0
+import QGroundControl.MultiVehicleManager 1.0
+import QGroundControl.ScreenTools 1.0
+import QGroundControl.Palette 1.0
+
+//-------------------------------------------------------------------------
+//-- Mode Indicator
+Item {
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ visible: _multiVehicles
+ width: _multiVehicles ? multiVehicleSelector.width : 0
+
+ property bool _multiVehicles: activeVehicle ? QGroundControl.multiVehicleManager.vehicles.count > 1 : false
+
+ Connections {
+ target: QGroundControl.multiVehicleManager.vehicles
+ onCountChanged: multiVehicleSelector.updatemultiVehiclesMenu()
+ }
+
+ QGCLabel {
+ id: multiVehicleSelector
+ text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None")
+ font.pointSize: ScreenTools.mediumFontPointSize
+ color: qgcPal.buttonText
+ anchors.verticalCenter: parent.verticalCenter
+ Menu {
+ id: multiVehiclesMenu
+ }
+ Component {
+ id: multiVehicleMenuItemComponent
+ MenuItem {
+ onTriggered: QGroundControl.multiVehicleManager.activeVehicle = vehicle
+ property int vehicleId: Number(text.split(" ")[1])
+ property var vehicle: QGroundControl.multiVehicleManager.getVehicleById(vehicleId)
+ }
+ }
+ property var multiVehiclesMenuItems: []
+ function updatemultiVehiclesMenu() {
+ if (_multiVehicles) {
+ // Remove old menu items
+ for (var i = 0; i < multiVehiclesMenuItems.length; i++) {
+ multiVehiclesMenu.removeItem(multiVehiclesMenuItems[i])
+ }
+ multiVehiclesMenuItems.length = 0
+ // Add new items
+ for (i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
+ var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
+ var menuItem = multiVehicleMenuItemComponent.createObject(null, { "text": "Vehicle " + vehicle.id })
+ multiVehiclesMenuItems.push(menuItem)
+ multiVehiclesMenu.insertItem(i, menuItem)
+ console.log("Vehicle " + vehicle.id)
+ }
+ }
+ }
+ Component.onCompleted: {
+ multiVehicleSelector.updatemultiVehiclesMenu()
+ }
+ }
+ MouseArea {
+ visible: _multiVehicles
+ anchors.fill: parent
+ onClicked: multiVehiclesMenu.popup()
+ }
+}