Commit 20664925 authored by DoinLakeFlyer's avatar DoinLakeFlyer

parent cbbf4322
......@@ -92,15 +92,17 @@
<file alias="QGroundControl/Controls/EditPositionDialog.qml">../src/QmlControls/EditPositionDialog.qml</file>
<file alias="QGroundControl/Controls/ExclusiveGroupItem.qml">../src/QmlControls/ExclusiveGroupItem.qml</file>
<file alias="QGroundControl/Controls/FactSliderPanel.qml">../src/QmlControls/FactSliderPanel.qml</file>
<file alias="QGroundControl/Controls/FirstRunPrompt.qml">../src/FirstRunPromptDialogs/FirstRunPrompt.qml</file>
<file alias="QGroundControl/Controls/FileButton.qml">../src/QmlControls/FileButton.qml</file>
<file alias="QGroundControl/Controls/FlightModeDropdown.qml">../src/QmlControls/FlightModeDropdown.qml</file>
<file alias="QGroundControl/Controls/FlightModeMenu.qml">../src/QmlControls/FlightModeMenu.qml</file>
<file alias="QGroundControl/Controls/FWLandingPatternMapVisual.qml">../src/PlanView/FWLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/Controls/GeoFenceEditor.qml">../src/PlanView/GeoFenceEditor.qml</file>
<file alias="QGroundControl/Controls/GeoFenceMapVisuals.qml">../src/PlanView/GeoFenceMapVisuals.qml</file>
<file alias="QGroundControl/Controls/HorizontalFactValueGrid.qml">../src/QmlControls/HorizontalFactValueGrid.qml</file>
<file alias="QGroundControl/Controls/IndicatorButton.qml">../src/QmlControls/IndicatorButton.qml</file>
<file alias="QGroundControl/Controls/InstrumentValue.qml">../src/QmlControls/InstrumentValue.qml</file>
<file alias="QGroundControl/Controls/InstrumentValueArea.qml">../src/QmlControls/InstrumentValueArea.qml</file>
<file alias="QGroundControl/Controls/InstrumentValueLabel.qml">../src/QmlControls/InstrumentValueLabel.qml</file>
<file alias="QGroundControl/Controls/InstrumentValueValue.qml">../src/QmlControls/InstrumentValueValue.qml</file>
<file alias="QGroundControl/Controls/InstrumentValueEditDialog.qml">../src/QmlControls/InstrumentValueEditDialog.qml</file>
<file alias="QGroundControl/Controls/JoystickThumbPad.qml">../src/QmlControls/JoystickThumbPad.qml</file>
<file alias="QGroundControl/Controls/KMLOrSHPFileDialog.qml">../src/QmlControls/KMLOrSHPFileDialog.qml</file>
......@@ -177,11 +179,14 @@
<file alias="QGroundControl/Controls/SurveyMapVisual.qml">../src/PlanView/SurveyMapVisual.qml</file>
<file alias="QGroundControl/Controls/TerrainStatus.qml">../src/PlanView/TerrainStatus.qml</file>
<file alias="QGroundControl/Controls/TakeoffItemMapVisual.qml">../src/PlanView/TakeoffItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolBarBase.qml">../src/ui/toolbar/ToolBarBase.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">../src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">../src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">../src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">../src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/VerticalFactValueGrid.qml">../src/QmlControls/VerticalFactValueGrid.qml</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">../src/ViewWidgets/ViewWidget.qml</file>
<file alias="QGroundControl/Controls/VTOLLandingPatternMapVisual.qml">../src/PlanView/VTOLLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/FactControls/AltitudeFactTextField.qml">../src/FactSystem/FactControls/AltitudeFactTextField.qml</file>
<file alias="QGroundControl/FactControls/FactBitmask.qml">../src/FactSystem/FactControls/FactBitmask.qml</file>
<file alias="QGroundControl/FactControls/FactCheckBox.qml">../src/FactSystem/FactControls/FactCheckBox.qml</file>
......@@ -203,12 +208,19 @@
<file alias="QGroundControl/FlightDisplay/FlyViewMissionCompleteDialog.qml">../src/FlightDisplay/FlyViewMissionCompleteDialog.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewPreFlightChecklistPopup.qml">../src/FlightDisplay/FlyViewPreFlightChecklistPopup.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStrip.qml">../src/FlightDisplay/FlyViewToolStrip.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewToolStripActionList.qml">../src/FlightDisplay/FlyViewToolStripActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewVideo.qml">../src/FlightDisplay/FlyViewVideo.qml</file>
<file alias="QGroundControl/FlightDisplay/FlyViewWidgetLayer.qml">../src/FlightDisplay/FlyViewWidgetLayer.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionActionList.qml">../src/FlightDisplay/GuidedActionActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionConfirm.qml">../src/FlightDisplay/GuidedActionConfirm.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">../src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionsController.qml">../src/FlightDisplay/GuidedActionsController.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionLand.qml">../src/FlightDisplay/GuidedActionLand.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionList.qml">../src/FlightDisplay/GuidedActionList.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionTakeoff.qml">../src/FlightDisplay/GuidedActionTakeoff.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionPause.qml">../src/FlightDisplay/GuidedActionPause.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedActionRTL.qml">../src/FlightDisplay/GuidedActionRTL.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedAltitudeSlider.qml">../src/FlightDisplay/GuidedAltitudeSlider.qml</file>
<file alias="QGroundControl/FlightDisplay/GuidedToolStripAction.qml">../src/FlightDisplay/GuidedToolStripAction.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehicleList.qml">../src/FlightDisplay/MultiVehicleList.qml</file>
<file alias="QGroundControl/FlightDisplay/MultiVehiclePanel.qml">../src/FlightDisplay/MultiVehiclePanel.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightBatteryCheck.qml">../src/FlightDisplay/PreFlightBatteryCheck.qml</file>
......@@ -216,6 +228,7 @@
<file alias="QGroundControl/FlightDisplay/PreFlightRCCheck.qml">../src/FlightDisplay/PreFlightRCCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSensorsHealthCheck.qml">../src/FlightDisplay/PreFlightSensorsHealthCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightSoundCheck.qml">../src/FlightDisplay/PreFlightSoundCheck.qml</file>
<file alias="QGroundControl/FlightDisplay/PreFlightCheckListShowAction.qml">../src/FlightDisplay/PreFlightCheckListShowAction.qml</file>
<file alias="QGroundControl/FlightDisplay/TerrainProgress.qml">../src/FlightDisplay/TerrainProgress.qml</file>
<file alias="QGroundControl/FlightDisplay/VehicleWarnings.qml">../src/FlightDisplay/VehicleWarnings.qml</file>
<file alias="QGroundControl/FlightDisplay/qmldir">../src/QmlControls/QGroundControl/FlightDisplay/qmldir</file>
......@@ -262,12 +275,11 @@
<file alias="VibrationPageWidget.qml">../src/FlightMap/Widgets/VibrationPageWidget.qml</file>
<file alias="VideoPageWidget.qml">../src/FlightMap/Widgets/VideoPageWidget.qml</file>
<file alias="VirtualJoystick.qml">../src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="QGroundControl/Controls/VTOLLandingPatternMapVisual.qml">../src/PlanView/VTOLLandingPatternMapVisual.qml</file>
<file alias="VTOLLandingPatternEditor.qml">../src/PlanView/VTOLLandingPatternEditor.qml</file>
<file alias="QGroundControl/Specific/qmldir">../src/QmlControls/QGroundControl/Specific/qmldir</file>
<file alias="QGroundControl/Specific/StartupWizard.qml">../src/QmlControls/QGroundControl/Specific/StartupWizard.qml</file>
<file alias="QGroundControl/Specific/BaseStartupWizardPage.qml">../src/QmlControls/QGroundControl/Specific/BaseStartupWizardPage.qml</file>
<file alias="QGroundControl/Specific/UnitsWizardPage.qml">../src/QmlControls/QGroundControl/Specific/UnitsWizardPage.qml</file>
</qresource>
<qresource prefix="/FirstRunPromptDialogs">
<file alias="UnitsFirstRunPrompt.qml">../src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml</file>
<file alias="OfflineVehicleFirstRunPrompt.qml">../src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="ADSBVehicleManager.SettingsGroup.json">../src/Settings/ADSBVehicleManager.SettingsGroup.json</file>
......
......@@ -33,16 +33,16 @@ AutoPilotPlugin* CustomFirmwarePlugin::autopilotPlugin(Vehicle* vehicle)
return new CustomAutoPilotPlugin(vehicle, vehicle);
}
const QVariantList& CustomFirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
const QVariantList& CustomFirmwarePlugin::toolIndicators(const Vehicle* vehicle)
{
if (_toolBarIndicatorList.size() == 0) {
if (_toolIndicatorList.size() == 0) {
// First call the base class to get the standard QGC list. This way we are guaranteed to always get
// any new toolbar indicators which are added upstream in our custom build.
_toolBarIndicatorList = FirmwarePlugin::toolBarIndicators(vehicle);
_toolIndicatorList = FirmwarePlugin::toolIndicators(vehicle);
// Then specifically remove the RC RSSI indicator.
_toolBarIndicatorList.removeOne(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")));
_toolIndicatorList.removeOne(QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")));
}
return _toolBarIndicatorList;
return _toolIndicatorList;
}
// Tells QGC that your vehicle has a gimbal on it. This will in turn cause thing like gimbal commands to point
......
......@@ -25,10 +25,10 @@ public:
CustomFirmwarePlugin();
// FirmwarePlugin overrides
AutoPilotPlugin* autopilotPlugin (Vehicle* vehicle) final;
const QVariantList& toolBarIndicators (const Vehicle* vehicle) final;
bool hasGimbal (Vehicle* vehicle, bool& rollSupported, bool& pitchSupported, bool& yawSupported) final;
AutoPilotPlugin* autopilotPlugin (Vehicle* vehicle) final;
const QVariantList& toolIndicators (const Vehicle* vehicle) final;
bool hasGimbal (Vehicle* vehicle, bool& rollSupported, bool& pitchSupported, bool& yawSupported) final;
private:
QVariantList _toolBarIndicatorList;
QVariantList _toolIndicatorList;
};
......@@ -92,6 +92,7 @@
<file alias="QGroundControl/Controls/EditPositionDialog.qml">src/QmlControls/EditPositionDialog.qml</file>
<file alias="QGroundControl/Controls/ExclusiveGroupItem.qml">src/QmlControls/ExclusiveGroupItem.qml</file>
<file alias="QGroundControl/Controls/FactSliderPanel.qml">src/QmlControls/FactSliderPanel.qml</file>
<file alias="QGroundControl/Controls/FirstRunPrompt.qml">src/FirstRunPromptDialogs/FirstRunPrompt.qml</file>
<file alias="QGroundControl/Controls/FileButton.qml">src/QmlControls/FileButton.qml</file>
<file alias="QGroundControl/Controls/FlightModeDropdown.qml">src/QmlControls/FlightModeDropdown.qml</file>
<file alias="QGroundControl/Controls/FlightModeMenu.qml">src/QmlControls/FlightModeMenu.qml</file>
......@@ -185,6 +186,7 @@
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/VerticalFactValueGrid.qml">src/QmlControls/VerticalFactValueGrid.qml</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
<file alias="QGroundControl/Controls/VTOLLandingPatternMapVisual.qml">src/PlanView/VTOLLandingPatternMapVisual.qml</file>
<file alias="QGroundControl/FactControls/AltitudeFactTextField.qml">src/FactSystem/FactControls/AltitudeFactTextField.qml</file>
<file alias="QGroundControl/FactControls/FactBitmask.qml">src/FactSystem/FactControls/FactBitmask.qml</file>
<file alias="QGroundControl/FactControls/FactCheckBox.qml">src/FactSystem/FactControls/FactCheckBox.qml</file>
......@@ -273,12 +275,11 @@
<file alias="VibrationPageWidget.qml">src/FlightMap/Widgets/VibrationPageWidget.qml</file>
<file alias="VideoPageWidget.qml">src/FlightMap/Widgets/VideoPageWidget.qml</file>
<file alias="VirtualJoystick.qml">src/FlightDisplay/VirtualJoystick.qml</file>
<file alias="QGroundControl/Controls/VTOLLandingPatternMapVisual.qml">src/PlanView/VTOLLandingPatternMapVisual.qml</file>
<file alias="VTOLLandingPatternEditor.qml">src/PlanView/VTOLLandingPatternEditor.qml</file>
<file alias="QGroundControl/Specific/qmldir">src/QmlControls/QGroundControl/Specific/qmldir</file>
<file alias="QGroundControl/Specific/StartupWizard.qml">src/QmlControls/QGroundControl/Specific/StartupWizard.qml</file>
<file alias="QGroundControl/Specific/BaseStartupWizardPage.qml">src/QmlControls/QGroundControl/Specific/BaseStartupWizardPage.qml</file>
<file alias="QGroundControl/Specific/UnitsWizardPage.qml">src/QmlControls/QGroundControl/Specific/UnitsWizardPage.qml</file>
</qresource>
<qresource prefix="/FirstRunPromptDialogs">
<file alias="UnitsFirstRunPrompt.qml">src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml</file>
<file alias="OfflineVehicleFirstRunPrompt.qml">src/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="ADSBVehicleManager.SettingsGroup.json">src/Settings/ADSBVehicleManager.SettingsGroup.json</file>
......
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Dialogs 1.3
import QGroundControl 1.0
import QGroundControl.Controls 1.0
// Base class for all first run prompt dialogs
QGCPopupDialog {
buttons: StandardButton.Ok
property int promptId
property bool markAsShownOnClose: true
onHideDialog: {
if (markAsShownOnClose) {
QGroundControl.settingsManager.appSettings.firstRunPromptIdsMarkIdAsShown(promptId)
}
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.SettingsManager 1.0
import QGroundControl.Controls 1.0
FirstRunPrompt {
title: qsTr("Vehicle Information")
promptId: QGroundControl.corePlugin.offlineVehicleFirstRunPromptId
property real _margins: ScreenTools.defaultFontPixelWidth
property var _appSettings: QGroundControl.settingsManager.appSettings
property var _offlineVehicle: QGroundControl.multiVehicleManager.offlineEditingVehicle
property bool _showCruiseSpeed: !_offlineVehicle.multiRotor
property bool _showHoverSpeed: _offlineVehicle.multiRotor || _offlineVehicle.vtol
property bool _multipleFirmware: QGroundControl.supportedFirmwareCount > 2
property bool _multipleVehicleTypes: QGroundControl.supportedVehicleCount > 1
property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 16
ColumnLayout {
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
id: unitsSectionLabel
Layout.preferredWidth: valueRect.width
text: qsTr("Specify information about the vehicle you plan to fly. If you are unsure of the correct values leave them as is.")
wrapMode: Text.WordWrap
}
Rectangle {
id: valueRect
Layout.preferredHeight: valueGrid.height + (_margins * 2)
Layout.preferredWidth: valueGrid.width + (_margins * 2)
color: qgcPal.windowShade
Layout.fillWidth: true
GridLayout {
id: valueGrid
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
columns: 2
QGCLabel {
Layout.fillWidth: true
text: qsTr("Firmware")
visible: _multipleFirmware
}
FactComboBox {
Layout.preferredWidth: _fieldWidth
fact: QGroundControl.settingsManager.appSettings.offlineEditingFirmwareType
indexModel: false
visible: _multipleFirmware
}
QGCLabel {
Layout.fillWidth: true
text: qsTr("Vehicle")
visible: _multipleVehicleTypes
}
FactComboBox {
Layout.preferredWidth: _fieldWidth
fact: QGroundControl.settingsManager.appSettings.offlineEditingVehicleType
indexModel: false
visible: _multipleVehicleTypes
}
QGCLabel {
Layout.fillWidth: true
text: qsTr("Mission Cruise Speed")
visible: _showCruiseSpeed
}
FactTextField {
Layout.preferredWidth: _fieldWidth
fact: QGroundControl.settingsManager.appSettings.offlineEditingCruiseSpeed
visible: _showCruiseSpeed
}
QGCLabel {
Layout.fillWidth: true
text: qsTr("Mission Hover Speed")
visible: _showHoverSpeed
}
FactTextField {
Layout.preferredWidth: _fieldWidth
fact: QGroundControl.settingsManager.appSettings.offlineEditingHoverSpeed
visible: _showHoverSpeed
}
}
}
}
}
/****************************************************************************
*
* (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.SettingsManager 1.0
import QGroundControl.Controls 1.0
FirstRunPrompt {
title: qsTr("Measurement Units")
promptId: QGroundControl.corePlugin.unitsFirstRunPromptId
property real _margins: ScreenTools.defaultFontPixelHeight / 2
property var _unitsSettings: QGroundControl.settingsManager.unitsSettings
property var _rgFacts: [ _unitsSettings.horizontalDistanceUnits, _unitsSettings.verticalDistanceUnits, _unitsSettings.areaUnits, _unitsSettings.speedUnits, _unitsSettings.temperatureUnits ]
property var _rgLabels: [ qsTr("Horizontal Distance"), qsTr("Vertical Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ]
property int _cVisibleFacts: 0
Component.onCompleted: {
var cVisibleFacts = 0
for (var i=0; i<_rgFacts.length; i++) {
if (_rgFacts[i].visible) {
cVisibleFacts++
}
}
_cVisibleFacts = cVisibleFacts
}
function changeSystemOfUnits(metric) {
if (_unitsSettings.horizontalDistanceUnits.visible) {
_unitsSettings.horizontalDistanceUnits.value = metric ? UnitsSettings.HorizontalDistanceUnitsMeters : UnitsSettings.HorizontalDistanceUnitsFeet
}
if (_unitsSettings.verticalDistanceUnits.visible) {
_unitsSettings.verticalDistanceUnits.value = metric ? UnitsSettings.VerticalDistanceUnitsMeters : UnitsSettings.VerticalDistanceUnitsFeet
}
if (_unitsSettings.areaUnits.visible) {
_unitsSettings.areaUnits.value = metric ? UnitsSettings.AreaUnitsSquareMeters : UnitsSettings.AreaUnitsSquareFeet
}
if (_unitsSettings.speedUnits.visible) {
_unitsSettings.speedUnits.value = metric ? UnitsSettings.SpeedUnitsMetersPerSecond : UnitsSettings.SpeedUnitsFeetPerSecond
}
if (_unitsSettings.temperatureUnits.visible) {
_unitsSettings.temperatureUnits.value = metric ? UnitsSettings.TemperatureUnitsCelsius : UnitsSettings.TemperatureUnitsFarenheit
}
}
ColumnLayout {
id: settingsColumn
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
id: unitsSectionLabel
text: qsTr("Choose the measurement units you want to use. You can also change it later in General Settings.")
Layout.preferredWidth: unitsGrid.width
wrapMode: Text.WordWrap
}
Rectangle {
Layout.preferredHeight: unitsGrid.height + (_margins * 2)
Layout.preferredWidth: unitsGrid.width + (_margins * 2)
color: qgcPal.windowShade
Layout.fillWidth: true
GridLayout {
id: unitsGrid
anchors.margins: _margins
anchors.top: parent.top
anchors.left: parent.left
rows: _cVisibleFacts + 1
flow: GridLayout.TopToBottom
QGCLabel { text: qsTr("System of units") }
Repeater {
model: _rgFacts.length
QGCLabel {
text: _rgLabels[index]
visible: _rgFacts[index].visible
}
}
QGCComboBox {
Layout.fillWidth: true
sizeToContents: true
model: [ qsTr("Metric System"), qsTr("Imperial System") ]
currentIndex: _unitsSettings.horizontalDistanceUnits.value === UnitsSettings.HorizontalDistanceUnitsMeters ? 0 : 1
onActivated: changeSystemOfUnits(currentIndex === 0 /* metric */)
}
Repeater {
model: _rgFacts.length
FactComboBox {
Layout.fillWidth: true
sizeToContents: true
fact: _rgFacts[index]
indexModel: false
visible: _rgFacts[index].visible
}
}
}
}
}
}
......@@ -176,7 +176,7 @@ T.HorizontalFactValueGrid {
var item = valueGrid.childAt(mouse.x, mouse.y)
//console.log(item, item ? item.instrumentValueData : "null", item && item.parent ? item.parent.instrumentValueData : "null")
if (item && item.instrumentValueData !== undefined) {
mainWindow.showPopupDialog(valueEditDialog, { instrumentValueData: item.instrumentValueData })
mainWindow.showPopupDialogFromComponent(valueEditDialog, { instrumentValueData: item.instrumentValueData })
}
}
......
......@@ -77,7 +77,7 @@ QGCPopupDialog {
instrumentValueData.text = ""
instrumentValueData.icon = instrumentValueData.factValueGrid.iconNames[0]
var updateFunction = function(icon){ instrumentValueData.icon = icon }
mainWindow.showPopupDialog(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: instrumentValueData.icon, updateIconFunction: updateFunction })
mainWindow.showPopupDialogFromComponent(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: instrumentValueData.icon, updateIconFunction: updateFunction })
}
}
......@@ -98,7 +98,7 @@ QGCPopupDialog {
anchors.fill: parent
onClicked: {
var updateFunction = function(icon){ instrumentValueData.icon = icon }
mainWindow.showPopupDialog(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: instrumentValueData.icon, updateIconFunction: updateFunction })
mainWindow.showPopupDialogFromComponent(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: instrumentValueData.icon, updateIconFunction: updateFunction })
}
}
......@@ -392,7 +392,7 @@ QGCPopupDialog {
anchors.fill: parent
onClicked: {
var updateFunction = function(icon){ updateIconValue(index, icon) }
mainWindow.showPopupDialog(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: modelData, updateIconFunction: updateFunction })
mainWindow.showPopupDialogFromComponent(iconPickerDialog, { iconNames: instrumentValueData.factValueGrid.iconNames, icon: modelData, updateIconFunction: updateFunction })
}
}
}
......
......@@ -290,7 +290,7 @@ QGCViewDialog {
text: qsTr("Set RC to Param")
width: _editFieldWidth
visible: _advanced.checked && !validate && showRCToParam
onClicked: mainWindow.showPopupDialog(rcToParamDialog)
onClicked: mainWindow.showPopupDialogFromComponent(rcToParamDialog)
}
} // Column
}
......
......@@ -18,10 +18,11 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Popup {
property var dialogComponent
property var dialogProperties
property var dialogComponent
property string dialogSource
property var dialogProperties
id: popupRoot
id: _root
anchors.centerIn: parent
width: mainColumnLayout.width + (padding * 2)
height: mainColumnLayout.y + mainColumnLayout.height + padding
......@@ -75,7 +76,7 @@ Popup {
}
Rectangle {
anchors.margins: popupRoot.padding
anchors.margins: _root.padding
anchors.fill: parent
color: _pal.window
}
......@@ -209,10 +210,11 @@ Popup {
Loader {
id: dialogComponentLoader
x: _contentMargin
source: dialogSource
sourceComponent: dialogComponent
focus: true
property var dialogProperties: popupRoot.dialogProperties
property var dialogProperties: _root.dialogProperties
property bool acceptAllowed: acceptButton.visible
property bool rejectAllowed: rejectButton.visible
}
......
......@@ -15,6 +15,7 @@ DropPanel 1.0 DropPanel.qml
EditPositionDialog 1.0 EditPositionDialog.qml
ExclusiveGroupItem 1.0 ExclusiveGroupItem.qml
FactSliderPanel 1.0 FactSliderPanel.qml
FirstRunPrompt 1.0 FirstRunPrompt.qml
FileButton 1.0 FileButton.qml
FlightModeDropdown 1.0 FlightModeDropdown.qml
FlightModeMenu 1.0 FlightModeMenu.qml
......
import QtQuick 2.12
Item {
// `null` for default which makes the wizzard display one of the buttons: "Next" if more pages or "Done" if the last
property string doneText: null
// Blocks user from closing the wizard or going to the next page until this becomes true
property bool forceConfirmation: false
signal closeView()
}
import QtQuick 2.11
import QtQuick.Layouts 1.11
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
import QGroundControl 1.0
import QGroundControl.Specific 1.0
Item {
id: _root
implicitWidth: contentColumn.implicitWidth + contentColumn.anchors.margins * 2.5
implicitHeight: contentColumn.implicitHeight + contentColumn.anchors.margins * 2 + contentColumn.spacing * 3
property bool forceKeepingOpen: _pageReady && pageLoader.item.forceConfirmation && !_armed
signal closeView()
property bool _pageReady: pageLoader.status === Loader.Ready
property int _currentIndex: 0
property int _pagesCount: QGroundControl.corePlugin.startupPages.length
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _armed: _activeVehicle && _activeVehicle.armed
function doneOrJumpToNext() {
if(_currentIndex < _pagesCount - 1)
_currentIndex += 1
else {
_root.closeView()
QGroundControl.settingsManager.appSettings.firstTimeStart.value = false
}
}
Connections {
target: _pageReady ? pageLoader.item : null
onCloseView: doneOrJumpToNext()
}
ColumnLayout {
id: contentColumn
anchors.fill: parent
anchors.margins: ScreenTools.defaultFontPixelHeight
spacing: ScreenTools.defaultFontPixelHeight * 0.5
QGCLabel {
id: titleLabel
text: qsTr("Welcome to " + QGroundControl.appName)
color: qgcPal.text
font.family: ScreenTools.demiboldFontFamily
font.pointSize: ScreenTools.mediumFontPointSize
}
Rectangle {
id: separatorRect
height: 1
color: qgcPal.windowShade
Layout.fillWidth: true
}
Flickable {
id: flickablePage
clip: true
contentWidth: pageLoader.item ? pageLoader.item.width : 0
contentHeight: pageLoader.item ? pageLoader.item.height : 0
Layout.fillHeight: true
Layout.preferredWidth: contentWidth
Layout.preferredHeight: contentHeight
Loader {
id: pageLoader
source: QGroundControl.corePlugin.startupPages[_currentIndex]
}
}
QGCButton {
id: confirmButton
property string _acknowledgeText: _pagesCount <= 1 ? qsTr("Next") : qsTr("Done")
text: (_pageReady && pageLoader.item && pageLoader.item.doneText) ? pageLoader.item.doneText : _acknowledgeText
onClicked: doneOrJumpToNext()
}
}
}
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QGroundControl 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.SettingsManager 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Specific 1.0
BaseStartupWizardPage {
width: settingsColumn.width
height: settingsColumn.height
property real _margins: ScreenTools.defaultFontPixelWidth
property real _comboFieldWidth: ScreenTools.defaultFontPixelWidth * 20
doneText: qsTr("Confirm")
ColumnLayout {
id: settingsColumn
anchors.horizontalCenter: parent.horizontalCenter
spacing: ScreenTools.defaultFontPixelHeight
QGCLabel {
id: unitsSectionLabel
text: qsTr("Choose the measurement units you want to use in the application. You can change it later on in General Settings.")
Layout.preferredWidth: unitsGrid.width
wrapMode: Text.WordWrap
}
Rectangle {
Layout.preferredHeight: unitsGrid.height + (_margins * 2)
Layout.preferredWidth: unitsGrid.width + (_margins * 2)
color: qgcPal.windowShade
Layout.fillWidth: true
GridLayout {
id: unitsGrid
anchors.topMargin: _margins
anchors.top: parent.top
Layout.fillWidth: false
anchors.horizontalCenter: parent.horizontalCenter
flow: GridLayout.TopToBottom
rows: 5
QGCLabel { text: qsTr("System of units") }
Repeater {
model: [ qsTr("Distance"), qsTr("Area"), qsTr("Speed"), qsTr("Temperature") ]
QGCLabel { text: modelData }
}
QGCComboBox {
model: [qsTr("Metric System"), qsTr("Imperial System")]
Layout.preferredWidth: _comboFieldWidth
currentIndex: QGroundControl.settingsManager.unitsSettings.horizontalDistanceUnits.value === UnitsSettings.HorizontalDistanceUnitsMeters ? 0 : 1
onActivated: {
var metric = (currentIndex === 0);
QGroundControl.settingsManager.unitsSettings.horizontalDistanceUnits.value = metric ? UnitsSettings.HorizontalDistanceUnitsMeters : UnitsSettings.HorizontalDistanceUnitsFeet
QGroundControl.settingsManager.unitsSettings.areaUnits.value = metric ? UnitsSettings.AreaUnitsSquareMeters : UnitsSettings.AreaUnitsSquareFeet
QGroundControl.settingsManager.unitsSettings.speedUnits.value = metric ? UnitsSettings.SpeedUnitsMetersPerSecond : UnitsSettings.SpeedUnitsFeetPerSecond
QGroundControl.settingsManager.unitsSettings.temperatureUnits.value = metric ? UnitsSettings.TemperatureUnitsCelsius : UnitsSettings.TemperatureUnitsFarenheit
}
}
Repeater {
model: [ QGroundControl.settingsManager.unitsSettings.horizontalDistanceUnits, QGroundControl.settingsManager.unitsSettings.areaUnits, QGroundControl.settingsManager.unitsSettings.speedUnits, QGroundControl.settingsManager.unitsSettings.temperatureUnits ]
FactComboBox {
Layout.preferredWidth: _comboFieldWidth
fact: modelData
indexModel: false
}
}
}
}
}
}
module QGroundControl.Specific
BaseStartupWizardPage 1.0 BaseStartupWizardPage.qml
StartupWizard 1.0 StartupWizard.qml
UnitsWizardPage 1.0 UnitsWizardPage.qml
......@@ -144,7 +144,7 @@ T.VerticalFactValueGrid {
var item = valueGrid.childAt(mouse.x, mouse.y)
//console.log(item, item ? item.instrumentValueData : "null", item && item.parent ? item.parent.instrumentValueData : "null")
if (item && item.instrumentValueData !== undefined) {
mainWindow.showPopupDialog(valueEditDialog, { instrumentValueData: item.instrumentValueData })
mainWindow.showPopupDialogFromComponent(valueEditDialog, { instrumentValueData: item.instrumentValueData })
}
}
......
......@@ -22,7 +22,7 @@
{
"name": "offlineEditingCruiseSpeed",
"shortDescription": "Offline editing cruise speed",
"longDescription": "This value defines the default cruising speed for forward flight vehicles for use in calculating mission statistics. It does not modify the flight speed for a specific flight plan.",
"longDescription": "This value defines the default speed for calculating mission statistics for vehicles which do not support hover or VTOL vehicles in fixed wing mode. It does not modify the flight speed for a specific flight plan.",
"type": "double",
"defaultValue": 15.0,
"min": 1.0,
......@@ -32,7 +32,7 @@
{
"name": "offlineEditingHoverSpeed",
"shortDescription": "Offline editing hover speed",
"longDescription": "This value defines the default cruising speed for multi-rotor vehicles for use in calculating mission statistics. It does not modify the flight speed for a specific flight plan.",
"longDescription": "This value defines the default speed for calculating mission statistics for multi-rotor vehicles or VTOL vehicle in multi-rotor mode. It does not modify the flight speed for a specific flight plan.",
"type": "double",
"defaultValue": 5.0,
"min": 1.0,
......@@ -282,11 +282,10 @@
"defaultValue": false
},
{
"name": "firstTimeStart",
"shortDescription": "True if we should popup first time wizard",
"longDescription": "If this option is enabled, the first time startup wizard will prompt the user at first application start on a new system.",
"type": "bool",
"defaultValue": true
"name": "firstRunPromptIdsShown",
"shortDescription": "Comma separated list of first run prompt ids which have already been shown.",
"type": "string",
"defaultValue": ""
}
]
}
......@@ -105,7 +105,7 @@ DECLARE_SETTINGSFACT(AppSettings, language)
DECLARE_SETTINGSFACT(AppSettings, disableAllPersistence)
DECLARE_SETTINGSFACT(AppSettings, usePairing)
DECLARE_SETTINGSFACT(AppSettings, saveCsvTelemetry)
DECLARE_SETTINGSFACT(AppSettings, firstTimeStart)
DECLARE_SETTINGSFACT(AppSettings, firstRunPromptIdsShown)
DECLARE_SETTINGSFACT_NO_FUNC(AppSettings, indoorPalette)
{
......@@ -224,3 +224,31 @@ MAV_TYPE AppSettings::offlineEditingVehicleTypeFromVehicleType(MAV_TYPE vehicleT
return MAV_TYPE_QUADROTOR;
}
}
QList<int> AppSettings::firstRunPromptsIdsVariantToList(const QVariant& firstRunPromptIds)
{
QList<int> rgIds;
QStringList strIdList = firstRunPromptIds.toString().split(",", QString::SkipEmptyParts);
for (const QString& strId: strIdList) {
rgIds.append(strId.toInt());
}
return rgIds;
}
QVariant AppSettings::firstRunPromptsIdsListToVariant(const QList<int>& rgIds)
{
QStringList strList;
for (int id: rgIds) {
strList.append(QString::number(id));
}
return QVariant(strList.join(","));
}
void AppSettings::firstRunPromptIdsMarkIdAsShown(int id)
{
QList<int> rgIds = firstRunPromptsIdsVariantToList(firstRunPromptIdsShown()->rawValue());
if (!rgIds.contains(id)) {
rgIds.append(id);
firstRunPromptIdsShown()->setRawValue(firstRunPromptsIdsListToVariant(rgIds));
}
}
......@@ -59,7 +59,7 @@ public:
DEFINE_SETTINGFACT(disableAllPersistence)
DEFINE_SETTINGFACT(usePairing)
DEFINE_SETTINGFACT(saveCsvTelemetry)
DEFINE_SETTINGFACT(firstTimeStart)
DEFINE_SETTINGFACT(firstRunPromptIdsShown)
// Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
......@@ -88,6 +88,11 @@ public:
QString videoSavePath ();
QString crashSavePath ();
// Helper methods for working with firstRunPromptIds QVariant settings string list
static QList<int> firstRunPromptsIdsVariantToList (const QVariant& firstRunPromptIds);
static QVariant firstRunPromptsIdsListToVariant (const QList<int>& rgIds);
Q_INVOKABLE void firstRunPromptIdsMarkIdAsShown (int id);
static MAV_AUTOPILOT offlineEditingFirmwareTypeFromFirmwareType (MAV_AUTOPILOT firmwareType);
static MAV_TYPE offlineEditingVehicleTypeFromVehicleType (MAV_TYPE vehicleType);
......
......@@ -533,12 +533,7 @@ QString QGCCorePlugin::stableVersionCheckFileUrl() const
#endif
}
QStringList QGCCorePlugin::startupPages()
{
return { "/qml/QGroundControl/Specific/UnitsWizardPage.qml" };
}
const QVariantList &QGCCorePlugin::toolBarIndicators(void)
const QVariantList& QGCCorePlugin::toolBarIndicators(void)
{
//-- Default list of indicators for all vehicles.
if(_toolBarIndicatorList.size() == 0) {
......@@ -548,3 +543,48 @@ const QVariantList &QGCCorePlugin::toolBarIndicators(void)
}
return _toolBarIndicatorList;
}
QList<int> QGCCorePlugin::firstRunPromptStdIds(void)
{
QList<int> rgStdIds = { unitsFirstRunPromptId, offlineVehicleFirstRunPromptId };
return rgStdIds;
}
QList<int> QGCCorePlugin::firstRunPromptCustomIds(void)
{
return QList<int>();
}
QVariantList QGCCorePlugin::firstRunPromptsToShow(void)
{
QList<int> rgIdsToShow;
rgIdsToShow.append(firstRunPromptStdIds());
rgIdsToShow.append(firstRunPromptCustomIds());
QList<int> rgAlreadyShownIds = AppSettings::firstRunPromptsIdsVariantToList(_toolbox->settingsManager()->appSettings()->firstRunPromptIdsShown()->rawValue());
for (int idToRemove: rgAlreadyShownIds) {
rgIdsToShow.removeOne(idToRemove);
}
QVariantList rgVarIdsToShow;
for (int id: rgIdsToShow) {
rgVarIdsToShow.append(id);
}
return rgVarIdsToShow;
}
QString QGCCorePlugin::firstRunPromptResource(int id)
{
switch (id) {
case unitsFirstRunPromptId:
return "/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml";
case offlineVehicleFirstRunPromptId:
return "/FirstRunPromptDialogs/OfflineVehicleFirstRunPrompt.qml";
break;
}
return QString();
}
......@@ -46,19 +46,20 @@ public:
QGCCorePlugin(QGCApplication* app, QGCToolbox* toolbox);
~QGCCorePlugin();
Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged)
Q_PROPERTY(QVariantList analyzePages READ analyzePages NOTIFY analyzePagesChanged)
Q_PROPERTY(QVariantList instrumentPages READ instrumentPages NOTIFY instrumentPagesChanged)
Q_PROPERTY(int defaultSettings READ defaultSettings CONSTANT)
Q_PROPERTY(QGCOptions* options READ options CONSTANT)
Q_PROPERTY(bool showTouchAreas READ showTouchAreas WRITE setShowTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI READ showAdvancedUI WRITE setShowAdvancedUI NOTIFY showAdvancedUIChanged)
Q_PROPERTY(QString showAdvancedUIMessage READ showAdvancedUIMessage CONSTANT)
Q_PROPERTY(QString brandImageIndoor READ brandImageIndoor CONSTANT)
Q_PROPERTY(QString brandImageOutdoor READ brandImageOutdoor CONSTANT)
Q_PROPERTY(QmlObjectListModel* customMapItems READ customMapItems CONSTANT)
Q_PROPERTY(QStringList startupPages READ startupPages NOTIFY startupPagesChanged)
Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators NOTIFY toolBarIndicatorsChanged)
Q_PROPERTY(QVariantList settingsPages READ settingsPages NOTIFY settingsPagesChanged)
Q_PROPERTY(QVariantList analyzePages READ analyzePages NOTIFY analyzePagesChanged)
Q_PROPERTY(QVariantList instrumentPages READ instrumentPages NOTIFY instrumentPagesChanged)
Q_PROPERTY(int defaultSettings READ defaultSettings CONSTANT)
Q_PROPERTY(QGCOptions* options READ options CONSTANT)
Q_PROPERTY(bool showTouchAreas READ showTouchAreas WRITE setShowTouchAreas NOTIFY showTouchAreasChanged)
Q_PROPERTY(bool showAdvancedUI READ showAdvancedUI WRITE setShowAdvancedUI NOTIFY showAdvancedUIChanged)
Q_PROPERTY(QString showAdvancedUIMessage READ showAdvancedUIMessage CONSTANT)
Q_PROPERTY(QString brandImageIndoor READ brandImageIndoor CONSTANT)
Q_PROPERTY(QString brandImageOutdoor READ brandImageOutdoor CONSTANT)
Q_PROPERTY(QmlObjectListModel* customMapItems READ customMapItems CONSTANT)
Q_PROPERTY(QVariantList toolBarIndicators READ toolBarIndicators NOTIFY toolBarIndicatorsChanged)
Q_PROPERTY(int unitsFirstRunPromptId MEMBER unitsFirstRunPromptId CONSTANT)
Q_PROPERTY(int offlineVehicleFirstRunPromptId MEMBER offlineVehicleFirstRunPromptId CONSTANT)
Q_INVOKABLE bool guidedActionsControllerLogging() const;
......@@ -165,18 +166,27 @@ public:
/// @return Complex items to be made available to user
virtual QStringList complexMissionItemNames(Vehicle* /*vehicle*/, const QStringList& complexMissionItemNames) { return complexMissionItemNames; }
/// Use it to customize the pages that are shown on startup. This will be queried
/// only if AppSettings::firstTimeStart Fact is true, that is reset to false when the user
/// goes for the fist time through all the pages.
/// Insert pages only if they are required to be displayed at start for a good user experience.
/// @return QML files paths that will be loaded using the StartupWizard control
virtual QStringList startupPages();
/// Returns the standard list of first run prompt ids for possible display. Actual display is based on the
/// current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts
/// will be displayed in.
virtual QList<int> firstRunPromptStdIds(void);
/// Returns the custom build list of first run prompt ids for possible display. Actual display is based on the
/// current AppSettings::firstRunPromptIds value. The order of this list also determines the order the prompts
/// will be displayed in.
virtual QList<int> firstRunPromptCustomIds(void);
/// Returns the resource which contains the specified first run prompt for display
Q_INVOKABLE virtual QString firstRunPromptResource(int id);
/// Returns the list of toolbar indicators which are not related to a vehicle
/// signals toolbarIndicatorsChanged
/// @return A list of QUrl with the indicators
virtual const QVariantList& toolBarIndicators(void);
/// Returns the list of first run prompt ids which need to be displayed according to current settings
Q_INVOKABLE QVariantList firstRunPromptsToShow(void);
bool showTouchAreas() const { return _showTouchAreas; }
bool showAdvancedUI() const { return _showAdvancedUI; }
void setShowTouchAreas(bool show);
......@@ -185,13 +195,19 @@ public:
// Override from QGCTool
void setToolbox (QGCToolbox* toolbox);
// Standard first run prompt ids
static const int unitsFirstRunPromptId = 1;
static const int offlineVehicleFirstRunPromptId = 2;
// Custom builds can start there first run prompt ids from here
static const int firstRunPromptIdsFirstCustomId = 10000;
signals:
void settingsPagesChanged ();
void analyzePagesChanged ();
void instrumentPagesChanged ();
void showTouchAreasChanged (bool showTouchAreas);
void showAdvancedUIChanged (bool showAdvancedUI);
void startupPagesChanged ();
void toolBarIndicatorsChanged ();
protected slots:
......
......@@ -19,7 +19,6 @@ import QGroundControl.Controls 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.FlightDisplay 1.0
import QGroundControl.FlightMap 1.0
import QGroundControl.Specific 1.0
/// @brief Native QML top level window
/// All properties defined here are visible to all QML pages.
......@@ -38,11 +37,34 @@ ApplicationWindow {
height = ScreenTools.isMobile ? Screen.height : Math.min(150 * Screen.pixelDensity, Screen.height)
}
// Startup experience wizard and provide the source using QGCCorePlugin
if (QGroundControl.settingsManager.appSettings.firstTimeStart.value) {
startupPopup.open()
} else {
showPreFlightChecklistIfNeeded()
// Start the sequence of first run prompt(s)
firstRunPromptManager.nextPrompt()
}
QtObject {
id: firstRunPromptManager
property var currentDialog: null
property var rgPromptIds: QGroundControl.corePlugin.firstRunPromptsToShow()
property int nextPromptIdIndex: 0
onRgPromptIdsChanged: console.log(QGroundControl.corePlugin, QGroundControl.corePlugin.firstRunPromptsToShow())
function clearNextPromptSignal() {
if (currentDialog) {
currentDialog.closed.disconnect(nextPrompt)
}
}
function nextPrompt() {
if (nextPromptIdIndex < rgPromptIds.length) {
currentDialog = showPopupDialogFromSource(QGroundControl.corePlugin.firstRunPromptResource(rgPromptIds[nextPromptIdIndex]))
currentDialog.closed.connect(nextPrompt)
nextPromptIdIndex++
} else {
currentDialog = null
showPreFlightChecklistIfNeeded()
}
}
}
......@@ -228,9 +250,18 @@ ApplicationWindow {
}
}
function showPopupDialog(component, properties) {
// Dialogs based on QGCPopupDialog
function showPopupDialogFromComponent(component, properties) {
var dialog = popupDialogContainerComponent.createObject(mainWindow, { dialogComponent: component, dialogProperties: properties })
dialog.open()
return dialog
}
function showPopupDialogFromSource(source, properties) {
var dialog = popupDialogContainerComponent.createObject(mainWindow, { dialogSource: source, dialogProperties: properties })
dialog.open()
return dialog
}
Component {
......@@ -241,9 +272,12 @@ ApplicationWindow {
property bool _forceClose: false
function finishCloseProcess() {
_forceClose = true
// For some reason on the Qml side Qt doesn't automatically disconnect a signal when an object is destroyed.
// So we have to do it ourselves otherwise the signal flows through on app shutdown to an object which no longer exists.
firstRunPromptManager.clearNextPromptSignal()
QGroundControl.linkManager.shutdown()
QGroundControl.videoManager.stopVideo();
_forceClose = true
mainWindow.close()
}
......@@ -684,35 +718,4 @@ ApplicationWindow {
indicatorDropdown.currentIndicator = null
}
}
//-- Startup PopUp wizard
Popup {
id: startupPopup
anchors.centerIn: parent
width: Math.min(startupWizard.implicitWidth, mainWindow.width - 2 * startupPopup._horizontalSpacing)
height: Math.min(startupWizard.implicitHeight, mainWindow.availableHeight - 2 * startupPopup._verticalSpacing)
modal: true
focus: true
closePolicy: (startupWizard && startupWizard.forceKeepingOpen !== undefined && startupWizard.forceKeepingOpen) ? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside
onClosed: mainWindow.showPreFlightChecklistIfNeeded()
property real _horizontalSpacing: ScreenTools.defaultFontPixelWidth * 5
property real _verticalSpacing: ScreenTools.defaultFontPixelHeight * 2
Connections {
target: startupWizard
onCloseView: startupPopup.close()
}
background: Rectangle {
radius: ScreenTools.defaultFontPixelHeight * 0.5
color: qgcPal.window
}
StartupWizard {
id: startupWizard
anchors.fill: parent
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment