From f676fc2bad71c23605c846027a6d3691508075fd Mon Sep 17 00:00:00 2001 From: Nippy Date: Thu, 17 Sep 2026 15:49:50 +0200 Subject: wifi fix --- .../welcome/RaveWelcomeViewStep.cpp | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp') diff --git a/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp b/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp index 6c4e4a3..b2108c6 100644 --- a/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp +++ b/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,10 @@ void RaveWelcomeViewStep::buildWidget() m_langCombo->setCurrentIndex(m_currentLocaleIndex); + // Make the live keyboard layout match the initial language right away, + // so the WiFi password input is not stuck on the boot default (US). + applyLiveKeyboardLayout(m_localeIds.value(m_currentLocaleIndex)); + connect(m_langCombo, QOverload::of(&QComboBox::activated), this, &RaveWelcomeViewStep::onLanguageChanged); @@ -168,6 +173,10 @@ void RaveWelcomeViewStep::onLanguageChanged(int index) gs->insert("locale", lang); } } + + // Apply the matching live keyboard layout immediately, so the WiFi + // password input follows the selected language (before the keyboard page). + applyLiveKeyboardLayout(localeId); } QString RaveWelcomeViewStep::brandingTranslationsPrefix() const @@ -177,6 +186,29 @@ QString RaveWelcomeViewStep::brandingTranslationsPrefix() const return QString(); } +void RaveWelcomeViewStep::applyLiveKeyboardLayout(const QString& localeId) +{ + QString layout = QStringLiteral("us"); + if (localeId.startsWith(QLatin1String("hu"))) + { + layout = QStringLiteral("hu"); + } + else if (localeId.startsWith(QLatin1String("de"))) + { + layout = QStringLiteral("de"); + } + else if (localeId == QLatin1String("en_GB")) + { + layout = QStringLiteral("gb"); + } + + // Best effort: apply the layout to the running X11 session so the WiFi + // password input matches the selected language immediately. A missing + // setxkbmap or non-X11 session must not break the installer. + const QStringList args { QStringLiteral("-layout"), layout }; + QProcess::startDetached(QStringLiteral("setxkbmap"), args); +} + bool RaveWelcomeViewStep::isNextEnabled() const { return true; } bool RaveWelcomeViewStep::isBackEnabled() const { return false; } bool RaveWelcomeViewStep::isAtBeginning() const { return true; } -- cgit v1.3