diff options
| -rw-r--r-- | raveos-calamares-module/PKGBUILD | 4 | ||||
| -rw-r--r-- | raveos-calamares-module/welcome/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp | 32 | ||||
| -rw-r--r-- | raveos-calamares-module/welcome/RaveWelcomeViewStep.h | 1 | ||||
| -rw-r--r-- | raveos-calamares-module/wifi/ui/Translations.qml | 8 | ||||
| -rw-r--r-- | raveos-calamares-module/wifi/ui/wifi.qml | 61 |
6 files changed, 91 insertions, 18 deletions
diff --git a/raveos-calamares-module/PKGBUILD b/raveos-calamares-module/PKGBUILD index 42d749a..0b15843 100644 --- a/raveos-calamares-module/PKGBUILD +++ b/raveos-calamares-module/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: nippy <nippy@tuta.io> pkgname=raveos-calamares-module pkgver=2.0.0 -pkgrel=23 +pkgrel=24 pkgdesc="RaveOS Calamares modules: Wi-Fi, Welcome, Desktop Selector" arch=('x86_64') options=('!debug') @@ -9,7 +9,7 @@ url="https://git.rp1.hu/RaveOS" license=('GPL') makedepends=('cmake' 'qt6-tools' 'kcoreaddons' 'calamares') -depends=('qt6-base' 'qt6-declarative' 'networkmanager') +depends=('qt6-base' 'qt6-declarative' 'networkmanager' 'xorg-setxkbmap') source=() sha256sums=() diff --git a/raveos-calamares-module/welcome/CMakeLists.txt b/raveos-calamares-module/welcome/CMakeLists.txt index e2b3f5b..9d28587 100644 --- a/raveos-calamares-module/welcome/CMakeLists.txt +++ b/raveos-calamares-module/welcome/CMakeLists.txt @@ -1,4 +1,4 @@ -find_package(Qt6 REQUIRED COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Widgets) calamares_add_plugin(ravewelcome TYPE viewmodule @@ -6,6 +6,7 @@ calamares_add_plugin(ravewelcome SOURCES RaveWelcomeViewStep.cpp LINK_LIBRARIES + Qt6::Core Qt6::Widgets Calamares::calamares ) 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 <QLabel> #include <QLocale> #include <QPainter> +#include <QProcess> #include <QPixmap> #include <QResizeEvent> #include <QVBoxLayout> @@ -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<int>::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; } diff --git a/raveos-calamares-module/welcome/RaveWelcomeViewStep.h b/raveos-calamares-module/welcome/RaveWelcomeViewStep.h index 83c9264..af7bdff 100644 --- a/raveos-calamares-module/welcome/RaveWelcomeViewStep.h +++ b/raveos-calamares-module/welcome/RaveWelcomeViewStep.h @@ -37,6 +37,7 @@ private slots: private: void buildWidget(); QString brandingTranslationsPrefix() const; + void applyLiveKeyboardLayout(const QString& localeId); QWidget* m_widget = nullptr; QLabel* m_bgLabel = nullptr; diff --git a/raveos-calamares-module/wifi/ui/Translations.qml b/raveos-calamares-module/wifi/ui/Translations.qml index 32b7972..a07e8c8 100644 --- a/raveos-calamares-module/wifi/ui/Translations.qml +++ b/raveos-calamares-module/wifi/ui/Translations.qml @@ -59,6 +59,10 @@ QtObject { // Jelszó mező placeholder property string passwordPlaceholder: "Password" + // Jelszó megjelenítő/elrejtő gomb + property string showPassword: "Show" + property string hidePassword: "Hide" + // ========================================= // ÁLLAPOT ÜZENETEK // ========================================= @@ -112,6 +116,8 @@ QtObject { connect = "Csatlakozás" ssidPlaceholder = "Hálózat neve (SSID)" passwordPlaceholder = "Jelszó" + showPassword = "Mutat" + hidePassword = "Elrejt" connected = "Sikeresen csatlakozva!" connecting = "Csatlakozás..." noNetworks = "Nem található hálózat.\nKattints a Frissítés gombra." @@ -131,6 +137,8 @@ QtObject { connect = "Connect" ssidPlaceholder = "Network name (SSID)" passwordPlaceholder = "Password" + showPassword = "Show" + hidePassword = "Hide" connected = "Successfully connected!" connecting = "Connecting..." noNetworks = "No networks found.\nClick Refresh to scan." diff --git a/raveos-calamares-module/wifi/ui/wifi.qml b/raveos-calamares-module/wifi/ui/wifi.qml index 2bb6cf6..aee3ddc 100644 --- a/raveos-calamares-module/wifi/ui/wifi.qml +++ b/raveos-calamares-module/wifi/ui/wifi.qml @@ -10,6 +10,7 @@ Rectangle { property string selectedSsid: "" property bool showHiddenNetwork: false property bool isConnecting: false + property bool showPassword: false // Function to update language - called from C++ function updateLanguage() { @@ -284,23 +285,53 @@ Rectangle { } } - // Password field - TextField { - id: passField + // Password field with show/hide toggle + Item { Layout.fillWidth: true - placeholderText: WifiModule.Translations.passwordPlaceholder - echoMode: TextInput.Password - color: WifiModule.Style.textColor - placeholderTextColor: WifiModule.Style.inputPlaceholderColor - font.pixelSize: WifiModule.Style.fontSizeNormal - enabled: selectedSsid !== "" || showHiddenNetwork - opacity: 1 + Layout.preferredHeight: WifiModule.Style.inputHeight - background: Rectangle { - color: passField.enabled ? WifiModule.Style.inputBackgroundColor : WifiModule.Style.inputDisabledColor - radius: WifiModule.Style.borderRadius - border.color: passField.focus ? WifiModule.Style.inputFocusBorderColor : WifiModule.Style.inputBorderColor - border.width: 1 + TextField { + id: passField + anchors.fill: parent + rightPadding: showPasswordButton.width + 16 + placeholderText: WifiModule.Translations.passwordPlaceholder + echoMode: showPassword ? TextInput.Normal : TextInput.Password + color: WifiModule.Style.textColor + placeholderTextColor: WifiModule.Style.inputPlaceholderColor + font.pixelSize: WifiModule.Style.fontSizeNormal + enabled: selectedSsid !== "" || showHiddenNetwork + opacity: 1 + + background: Rectangle { + color: passField.enabled ? WifiModule.Style.inputBackgroundColor : WifiModule.Style.inputDisabledColor + radius: WifiModule.Style.borderRadius + border.color: passField.focus ? WifiModule.Style.inputFocusBorderColor : WifiModule.Style.inputBorderColor + border.width: 1 + } + } + + Button { + id: showPasswordButton + anchors.right: parent.right + anchors.rightMargin: 8 + anchors.verticalCenter: parent.verticalCenter + height: 32 + text: showPassword ? WifiModule.Translations.hidePassword : WifiModule.Translations.showPassword + enabled: passField.enabled + onClicked: showPassword = !showPassword + + background: Rectangle { + color: parent.hovered ? WifiModule.Style.buttonSecondaryHoverColor : WifiModule.Style.buttonSecondaryColor + radius: 4 + } + + contentItem: Label { + text: parent.text + color: parent.enabled ? WifiModule.Style.textColor : WifiModule.Style.textDisabledColor + font.pixelSize: WifiModule.Style.fontSizeSmall + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } } } |