Skip to content

Commit 5c82dde

Browse files
committed
feat(QmlControls): add QGCStyle module
1 parent 5bc5dfb commit 5c82dde

64 files changed

Lines changed: 3145 additions & 446 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/install-dependencies/action.yml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,37 @@ runs:
8282

8383
- name: Install apt packages (Linux)
8484
if: runner.os == 'Linux'
85-
# Retry: a slow apt mirror can stall the download past the job timeout; fast-fail and retry.
86-
uses: nick-fields/retry@v4
85+
shell: bash
8786
env:
8887
APT_PACKAGES: ${{ steps.linux-deps.outputs.packages }}
89-
with:
90-
timeout_minutes: 20
91-
max_attempts: 3
92-
shell: bash
93-
# Acquire::*::Timeout aborts a stalled mirror connection so retries can fire.
94-
command: |
95-
APT_OPTS="-o Acquire::Retries=3 -o Acquire::http::Timeout=30 -o Acquire::https::Timeout=30"
96-
# shellcheck disable=SC2086
97-
sudo apt-get $APT_OPTS update -qq
98-
# shellcheck disable=SC2086
99-
sudo apt-get $APT_OPTS install -y --no-install-recommends $APT_PACKAGES
88+
run: |
89+
# shellcheck disable=SC2153 # Supplied through the step environment.
90+
read -r -a apt_packages <<< "$APT_PACKAGES"
91+
92+
for attempt in 1 2 3; do
93+
# Run timeout as root so it can terminate the privileged apt process tree.
94+
if sudo timeout --signal=TERM --kill-after=30s 20m bash -c '
95+
set -euo pipefail
96+
apt_opts=(
97+
-o Acquire::Retries=3
98+
-o Acquire::ForceIPv4=true
99+
-o Acquire::http::Timeout=30
100+
-o Acquire::https::Timeout=30
101+
)
102+
apt-get "${apt_opts[@]}" update -qq
103+
apt-get "${apt_opts[@]}" install -y --no-install-recommends "$@"
104+
' -- "${apt_packages[@]}"; then
105+
exit 0
106+
fi
107+
108+
if [[ "$attempt" -eq 3 ]]; then
109+
echo "::error::apt package installation failed after $attempt attempts"
110+
exit 1
111+
fi
112+
113+
echo "::warning::apt package installation attempt $attempt failed; retrying in 10 seconds"
114+
sleep 10
115+
done
100116
101117
- name: Fix apt alternatives (Linux)
102118
if: runner.os == 'Linux'
@@ -134,4 +150,3 @@ runs:
134150
max_attempts: 3
135151
command: |
136152
python3 tools/setup/install_dependencies --platform macos
137-

CMakeLists.txt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ find_package(Qt6
213213
Core
214214
Gui
215215
HttpServer
216+
LabsStyleKit
216217
LinguistTools
217218
Location
218219
LocationPrivate
@@ -373,16 +374,6 @@ qt_add_translations(${CMAKE_PROJECT_NAME}
373374
MERGE_QT_TRANSLATIONS
374375
)
375376

376-
# ----------------------------------------------------------------------------
377-
# Qt Quick Controls Configuration
378-
# ----------------------------------------------------------------------------
379-
qgc_set_qt_resource_alias("${CMAKE_SOURCE_DIR}/resources/qtquickcontrols2.conf")
380-
381-
qt_add_resources(${CMAKE_PROJECT_NAME} "qgcresources_cmake"
382-
PREFIX "/"
383-
FILES "${CMAKE_SOURCE_DIR}/resources/qtquickcontrols2.conf"
384-
)
385-
386377
# ----------------------------------------------------------------------------
387378
# Qt Plugin Configuration
388379
# ----------------------------------------------------------------------------

deploy/docker/install-sysroot-aarch64.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -euo pipefail
1919

2020
SYSROOT="${SYSROOT:-/opt/sysroot}"
2121
UBUNTU_SUITE="${UBUNTU_SUITE:-noble}"
22-
MIRROR="${MIRROR:-http://ports.ubuntu.com/ubuntu-ports}"
22+
MIRROR="${MIRROR:-https://ports.ubuntu.com/ubuntu-ports}"
2323

2424
# Reject newlines/junk in overrides — they land verbatim in the apt sources heredoc.
2525
if [[ ! "$UBUNTU_SUITE" =~ ^[a-z][-a-z0-9]*$ ]]; then
@@ -96,7 +96,13 @@ EOF
9696
}
9797

9898
configure_apt
99-
apt_retry apt-get -o Acquire::Retries=3 update -y --quiet
99+
# apt-get update normally exits successfully when an index download fails. Make
100+
# partial updates fatal so apt_retry can recover instead of continuing with no
101+
# arm64 package metadata and producing an empty dependency closure.
102+
apt_retry apt-get \
103+
-o APT::Update::Error-Mode=any \
104+
-o Acquire::Retries=3 \
105+
update -y --quiet
100106

101107
# Target-side libraries are single-sourced from install_dependencies
102108
# (DEBIAN_PACKAGES["cross_arm64"]) so they can't drift from the native build;

resources/qtquickcontrols2.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/AppSettings/LinkConfigurationManager.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ SettingsGroupLayout {
9292
buttonText: qsTr("Add")
9393

9494
onClicked: {
95-
var editingConfig = _linkManager.createConfiguration(ScreenTools.isSerialAvailable ? LinkConfiguration.TypeSerial : LinkConfiguration.TypeUdp, "")
95+
const editingConfig = _root._linkManager.createConfiguration()
9696
linkDialogFactory.open({ editingConfig: editingConfig, originalConfig: null })
9797
}
9898
}

src/AppSettings/QmlTest.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import QtQuick.Layouts
44

55
import QGroundControl
66
import QGroundControl.Controls
7-
87
Rectangle {
98
id: _root
109
anchors.fill: parent

src/AppSettings/pages/General.SettingsUI.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"groups": [
88
{
99
"heading": "General",
10-
"keywords": ["language", "locale", "color scheme", "dark mode", "theme", "palette", "follow me", "audio", "volume", "sound", "gstreamer", "debug level", "ui scale", "font size", "zoom", "save path", "storage", "reset", "clear settings", "factory reset"],
10+
"keywords": ["language", "locale", "color scheme", "dark mode", "theme", "palette", "follow me", "audio", "volume", "sound", "gstreamer", "debug level", "ui scale", "font size", "zoom", "accessibility", "contrast", "motion", "touch", "pointer", "density", "save path", "storage", "reset", "clear settings", "factory reset"],
1111
"controls": [
1212
{
1313
"setting": "appSettings.qLocaleLanguage",
@@ -40,6 +40,16 @@
4040
"setting": "appSettings.uiScalePercent",
4141
"control": "scaler"
4242
},
43+
{
44+
"setting": "appSettings.forceHighContrast"
45+
},
46+
{
47+
"setting": "appSettings.reducedMotion"
48+
},
49+
{
50+
"setting": "appSettings.touchModeOverride",
51+
"control": "combobox"
52+
},
4353
{
4454
"setting": "appSettings.savePath",
4555
"control": "browse",

src/AppSettings/pages/SettingsPages.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,19 +107,19 @@
107107
"name": "Mock Link",
108108
"qml": "MockLink.qml",
109109
"icon": "qrc:/InstrumentValueIcons/drone.svg",
110-
"visible": "ScreenTools.isDebug"
110+
"visible": "QGroundControl.isDebugBuild"
111111
},
112112
{
113113
"name": "Debug",
114114
"qml": "DebugWindow.qml",
115115
"icon": "qrc:/InstrumentValueIcons/bug.svg",
116-
"visible": "ScreenTools.isDebug"
116+
"visible": "QGroundControl.isDebugBuild"
117117
},
118118
{
119119
"name": "Palette Test",
120120
"qml": "QmlTest.qml",
121121
"icon": "qrc:/InstrumentValueIcons/photo.svg",
122-
"visible": "ScreenTools.isDebug"
122+
"visible": "QGroundControl.isDebugBuild"
123123
}
124124
]
125125
}

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
106106
Qt6::Gui
107107
Qt6::GuiPrivate
108108
Qt6::HttpServer
109+
Qt6::LabsStyleKit
109110
Qt6::Network
110111
Qt6::StateMachine
111112
Qt6::Svg
@@ -140,6 +141,8 @@ target_link_libraries(${CMAKE_PROJECT_NAME}
140141
FlightMapModule
141142
PlanViewModule
142143
QGroundControlControlsModule
144+
QGCStyle
145+
QGCStyleplugin
143146
QGroundControlModule
144147
ToolbarModule
145148
VehicleSetupModule

src/Comms/LinkManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ class LinkManager : public QObject
5151
void init();
5252

5353
/// Create/Edit Link Configuration
54-
Q_INVOKABLE LinkConfiguration *createConfiguration(int type, const QString &name);
54+
/// Default type is the first LinkType enum entry (serial when available, otherwise UDP)
55+
Q_INVOKABLE LinkConfiguration *createConfiguration(int type = 0, const QString &name = QString());
5556
Q_INVOKABLE LinkConfiguration *startConfigurationEditing(LinkConfiguration *config);
5657
Q_INVOKABLE void cancelConfigurationEditing(LinkConfiguration *config) const { delete config; }
5758
Q_INVOKABLE void endConfigurationEditing(LinkConfiguration *config, LinkConfiguration *editedConfig);

0 commit comments

Comments
 (0)