Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
6c071631
Commit
6c071631
authored
Apr 03, 2020
by
Stefan Dunca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add first time wizard so user can change/confirm the default locales
parent
74942a50
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
252 additions
and
0 deletions
+252
-0
qgroundcontrol.pro
qgroundcontrol.pro
+3
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+4
-0
BaseStartupWizardPage.qml
...ontrols/QGroundControl/Specific/BaseStartupWizardPage.qml
+10
-0
StartupWizard.qml
src/QmlControls/QGroundControl/Specific/StartupWizard.qml
+87
-0
UnitsWizardPage.qml
src/QmlControls/QGroundControl/Specific/UnitsWizardPage.qml
+81
-0
qmldir
src/QmlControls/QGroundControl/Specific/qmldir
+5
-0
App.SettingsGroup.json
src/Settings/App.SettingsGroup.json
+7
-0
AppSettings.cc
src/Settings/AppSettings.cc
+1
-0
AppSettings.h
src/Settings/AppSettings.h
+2
-0
QGCCorePlugin.cc
src/api/QGCCorePlugin.cc
+6
-0
QGCCorePlugin.h
src/api/QGCCorePlugin.h
+10
-0
MainRootWindow.qml
src/ui/MainRootWindow.qml
+36
-0
No files found.
qgroundcontrol.pro
View file @
6c071631
...
...
@@ -1384,3 +1384,6 @@ contains (CONFIG, QGC_DISABLE_INSTALLER_SETUP) {
}
else
{
include
(
QGCInstaller
.
pri
)
}
DISTFILES
+=
\
src
/
QmlControls
/
QGroundControl
/
Specific
/
qmldir
qgroundcontrol.qrc
View file @
6c071631
...
...
@@ -244,6 +244,10 @@
<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="/json">
<file alias="ADSBVehicleManager.SettingsGroup.json">src/Settings/ADSBVehicleManager.SettingsGroup.json</file>
...
...
src/QmlControls/QGroundControl/Specific/BaseStartupWizardPage.qml
0 → 100644
View file @
6c071631
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
()
}
src/QmlControls/QGroundControl/Specific/StartupWizard.qml
0 → 100644
View file @
6c071631
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
()
}
}
}
src/QmlControls/QGroundControl/Specific/UnitsWizardPage.qml
0 → 100644
View file @
6c071631
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
.
distanceUnits
.
value
===
UnitsSettings
.
DistanceUnitsMeters
?
0
:
1
onActivated
:
{
var
metric
=
(
currentIndex
===
0
);
QGroundControl
.
settingsManager
.
unitsSettings
.
distanceUnits
.
value
=
metric
?
UnitsSettings
.
DistanceUnitsMeters
:
UnitsSettings
.
DistanceUnitsFeet
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
.
distanceUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
areaUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
speedUnits
,
QGroundControl
.
settingsManager
.
unitsSettings
.
temperatureUnits
]
FactComboBox
{
Layout.preferredWidth
:
_comboFieldWidth
fact
:
modelData
indexModel
:
false
}
}
}
}
}
}
src/QmlControls/QGroundControl/Specific/qmldir
0 → 100644
View file @
6c071631
module QGroundControl.Specific
BaseStartupWizardPage 1.0 BaseStartupWizardPage.qml
StartupWizard 1.0 StartupWizard.qml
UnitsWizardPage 1.0 UnitsWizardPage.qml
src/Settings/App.SettingsGroup.json
View file @
6c071631
...
...
@@ -276,5 +276,12 @@
"longDescription"
:
"If this option is enabled, all Facts will be written to a CSV file with a 1 Hertz frequency."
,
"type"
:
"bool"
,
"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
}
]
src/Settings/AppSettings.cc
View file @
6c071631
...
...
@@ -99,6 +99,7 @@ DECLARE_SETTINGSFACT(AppSettings, language)
DECLARE_SETTINGSFACT
(
AppSettings
,
disableAllPersistence
)
DECLARE_SETTINGSFACT
(
AppSettings
,
usePairing
)
DECLARE_SETTINGSFACT
(
AppSettings
,
saveCsvTelemetry
)
DECLARE_SETTINGSFACT
(
AppSettings
,
firstTimeStart
)
DECLARE_SETTINGSFACT_NO_FUNC
(
AppSettings
,
indoorPalette
)
{
...
...
src/Settings/AppSettings.h
View file @
6c071631
...
...
@@ -59,6 +59,8 @@ public:
DEFINE_SETTINGFACT
(
disableAllPersistence
)
DEFINE_SETTINGFACT
(
usePairing
)
DEFINE_SETTINGFACT
(
saveCsvTelemetry
)
DEFINE_SETTINGFACT
(
firstTimeStart
)
// Although this is a global setting it only affects ArduPilot vehicle since PX4 automatically starts the stream from the vehicle side
DEFINE_SETTINGFACT
(
apmStartMavlinkStreams
)
...
...
src/api/QGCCorePlugin.cc
View file @
6c071631
...
...
@@ -507,3 +507,9 @@ QString QGCCorePlugin::stableVersionCheckFileUrl() const
return
QString
(
"https://s3-us-west-2.amazonaws.com/qgroundcontrol/latest/QGC.version.txt"
);
#endif
}
QStringList
QGCCorePlugin
::
startupPages
()
{
return
{
"/qml/QGroundControl/Specific/UnitsWizardPage.qml"
};
}
src/api/QGCCorePlugin.h
View file @
6c071631
...
...
@@ -56,6 +56,8 @@ public:
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_INVOKABLE
bool
guidedActionsControllerLogging
()
const
;
...
...
@@ -158,6 +160,13 @@ 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
();
bool
showTouchAreas
()
const
{
return
_showTouchAreas
;
}
bool
showAdvancedUI
()
const
{
return
_showAdvancedUI
;
}
void
setShowTouchAreas
(
bool
show
);
...
...
@@ -172,6 +181,7 @@ signals:
void
instrumentPagesChanged
();
void
showTouchAreasChanged
(
bool
showTouchAreas
);
void
showAdvancedUIChanged
(
bool
showAdvancedUI
);
void
startupPagesChanged
();
protected
slots
:
void
_activeVehicleChanged
(
Vehicle
*
activeVehicle
);
...
...
src/ui/MainRootWindow.qml
View file @
6c071631
...
...
@@ -20,6 +20,7 @@ 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.
...
...
@@ -37,6 +38,11 @@ ApplicationWindow {
width
=
ScreenTools
.
isMobile
?
Screen
.
width
:
Math
.
min
(
250
*
Screen
.
pixelDensity
,
Screen
.
width
)
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
()
}
}
property
var
_rgPreventViewSwitch
:
[
false
]
...
...
@@ -677,4 +683,34 @@ ApplicationWindow {
}
}
//-- 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
)
property
real
_horizontalSpacing
:
ScreenTools
.
defaultFontPixelWidth
*
5
property
real
_verticalSpacing
:
ScreenTools
.
defaultFontPixelHeight
*
2
modal
:
true
focus
:
true
closePolicy
:
(
startupWizard
&&
startupWizard
.
forceKeepingOpen
!==
undefined
&&
startupWizard
.
forceKeepingOpen
)
?
Popup
.
NoAutoClose
:
Popup
.
CloseOnEscape
|
Popup
.
CloseOnPressOutside
Connections
{
target
:
startupWizard
onCloseView
:
startupPopup
.
close
()
}
background
:
Rectangle
{
radius
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
color
:
qgcPal
.
window
}
StartupWizard
{
id
:
startupWizard
anchors.fill
:
parent
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment