From be6a016138d56a04202238855794a0859aab571f Mon Sep 17 00:00:00 2001 From: John-Michael Burke <43353147+john-michaelburke@users.noreply.github.com> Date: Mon, 1 Aug 2022 12:32:17 -0700 Subject: [PATCH 1/2] Manually set qt style/fallback style. (#677) --- swiftnav_console/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swiftnav_console/main.py b/swiftnav_console/main.py index 6eea8b6b9..e8a443dc3 100644 --- a/swiftnav_console/main.py +++ b/swiftnav_console/main.py @@ -23,6 +23,8 @@ from PySide2.QtQml import QQmlComponent, qmlRegisterType +from PySide2.QtQuickControls2 import QQuickStyle + import swiftnav_console.console_resources # type: ignore # pylint: disable=unused-import from .constants import ApplicationMetadata, ConnectionState, ConnectionType, Keys, Tabs @@ -724,6 +726,8 @@ def main(passed_args: Optional[Tuple[str, ...]] = None) -> int: QFontDatabase.addApplicationFont(":/fonts/Roboto-Regular.ttf") QFontDatabase.addApplicationFont(":/fonts/Roboto-Bold.ttf") QFontDatabase.addApplicationFont(":/fonts/RobotoCondensed-Regular.ttf") + QQuickStyle.setStyle("SwiftNav") + QQuickStyle.setFallbackStyle("Material") # We specifically *don't* want the RobotoCondensed-Bold.ttf font so we get the right look when bolded. qmlRegisterType(LogPanelData, "SwiftConsole", 1, 0, "LogPanelData") # type: ignore From 8fb1ff1641670d90557b3383cb5d7dec155c844a Mon Sep 17 00:00:00 2001 From: John-Michael Burke <43353147+john-michaelburke@users.noreply.github.com> Date: Tue, 2 Aug 2022 10:59:17 -0700 Subject: [PATCH 2/2] Add a handle_debug that dumps envionrment vars. (#680) --- entrypoint/src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint/src/main.rs b/entrypoint/src/main.rs index 6db020667..c2624ca6e 100644 --- a/entrypoint/src/main.rs +++ b/entrypoint/src/main.rs @@ -37,6 +37,14 @@ fn handle_splash() { } } +fn handle_debug() { + if std::env::var("SWIFTNAV_CONSOLE_DEBUG").is_ok() { + for (key, value) in std::env::vars() { + eprintln!("{key}={value}"); + } + } +} + fn app_dir() -> Result { let current_exe = std::env::current_exe()?; current_exe @@ -66,6 +74,7 @@ fn pythonhome_dir() -> Result { fn main() -> Result<()> { attach_console(); handle_wayland(); + handle_debug(); let args: Vec<_> = std::env::args().collect(); std::env::set_var("SWIFTNAV_CONSOLE_FROZEN", app_dir()?); std::env::set_var("PYTHONHOME", pythonhome_dir()?);