23 changed files with 462 additions and 290 deletions
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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) |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,105 @@
@@ -0,0 +1,105 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,115 @@
@@ -0,0 +1,115 @@
|
||||
/**************************************************************************** |
||||
* |
||||
* (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 |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,10 +0,0 @@
@@ -1,10 +0,0 @@
|
||||
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() |
||||
} |
@ -1,87 +0,0 @@
@@ -1,87 +0,0 @@
|
||||
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() |
||||
} |
||||
} |
||||
} |
@ -1,81 +0,0 @@
@@ -1,81 +0,0 @@
|
||||
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 |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,5 +0,0 @@
@@ -1,5 +0,0 @@
|
||||
module QGroundControl.Specific |
||||
|
||||
BaseStartupWizardPage 1.0 BaseStartupWizardPage.qml |
||||
StartupWizard 1.0 StartupWizard.qml |
||||
UnitsWizardPage 1.0 UnitsWizardPage.qml |
Loading…
Reference in new issue