From a64ef966534f8dba6af889ba4bfce15691bfc85b Mon Sep 17 00:00:00 2001 From: Nippy Date: Sun, 1 Nov 2026 18:13:54 +0100 Subject: új telepítő MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- raveos-calamares-module/wifi/ui/Style.qml | 161 ------ raveos-calamares-module/wifi/ui/Translations.qml | 219 +++----- raveos-calamares-module/wifi/ui/qmldir | 1 - raveos-calamares-module/wifi/ui/wifi.qml | 673 ++++++++++++----------- 4 files changed, 399 insertions(+), 655 deletions(-) delete mode 100644 raveos-calamares-module/wifi/ui/Style.qml (limited to 'raveos-calamares-module/wifi/ui') diff --git a/raveos-calamares-module/wifi/ui/Style.qml b/raveos-calamares-module/wifi/ui/Style.qml deleted file mode 100644 index 360d4d2..0000000 --- a/raveos-calamares-module/wifi/ui/Style.qml +++ /dev/null @@ -1,161 +0,0 @@ -pragma Singleton -import QtQuick 2.15 - -/** - * WiFi Modul Stílus Beállítások - * ============================== - * - * Itt tudod testreszabni a modul kinézetét. - * Minden szín hexadecimális formátumban van megadva: #RRGGBB - * - * Példa színek: - * Fehér: #ffffff - * Fekete: #000000 - * Piros: #ff0000 - * Zöld: #00ff00 - * Kék: #0000ff - */ - -QtObject { - // ========================================= - // HÁTTÉR SZÍNEK - // ========================================= - - // Fő háttérszín (az egész modul háttere) - readonly property color backgroundColor: "#404040" - - // Lista háttérszín (ahol a WiFi hálózatok vannak) - readonly property color listBackgroundColor: "#2B2B2B" - - // Lista fejléc háttérszín ("Elérhető hálózatok" sor) - readonly property color listHeaderColor: "#3d7839" - - // Elem hover háttérszín (amikor az egér fölötte van) - readonly property color itemHoverColor: "#2d3238" - - // Kiválasztott elem háttérszín - readonly property color itemSelectedColor: "#3d7839" - - // ========================================= - // SZÖVEG SZÍNEK - // ========================================= - - // Fő szöveg szín (címek, hálózat nevek) - readonly property color textColor: "#ffffff" - - // Másodlagos szöveg szín (leírások, információk) - readonly property color textSecondaryColor: "#b2b2b2" - - // Halványított szöveg szín (tippek, kihagyható info) - readonly property color textMutedColor: "#707070" - - // Letiltott szöveg szín - readonly property color textDisabledColor: "#606060" - - // ========================================= - // GOMB SZÍNEK - // ========================================= - - // Fő gomb háttérszín (Csatlakozás gomb) - readonly property color buttonPrimaryColor: "#3d7839" - - // Fő gomb hover szín - readonly property color buttonPrimaryHoverColor: "#3d7839" - - // Másodlagos gomb háttérszín (Frissítés gomb) - readonly property color buttonSecondaryColor: "#3d4248" - - // Másodlagos gomb hover szín - readonly property color buttonSecondaryHoverColor: "#4a5058" - - // Letiltott gomb háttérszín - readonly property color buttonDisabledColor: "#3d4248" - - // ========================================= - // INPUT MEZŐ SZÍNEK - // ========================================= - - // Input mező háttérszín - readonly property color inputBackgroundColor: "#2B2B2B" - - // Input mező letiltott háttérszín - readonly property color inputDisabledColor: "#2B2B2B" - - // Input mező placeholder szöveg szín - readonly property color inputPlaceholderColor: "#FFFFFF" - - // Input mező keret szín - readonly property color inputBorderColor: "#3d4248" - - // Input mező fókuszált keret szín - readonly property color inputFocusBorderColor: "#3d7839" - - // ========================================= - // ÁLLAPOT SZÍNEK - // ========================================= - - // Sikeres állapot szín (csatlakozva) - readonly property color successColor: "#2e7d32" - - // Sikeres pipa szín - readonly property color successCheckColor: "#4CAF50" - - // Folyamatban állapot szín (csatlakozás...) - readonly property color progressColor: "#37474f" - - // Toggle bekapcsolt szín - readonly property color toggleOnColor: "#4CAF50" - - // Toggle kikapcsolt szín - readonly property color toggleOffColor: "#555555" - - // ========================================= - // KERET ÉS VONAL SZÍNEK - // ========================================= - - // Lista keret szín - readonly property color borderColor: "#3d4248" - - // Elválasztó vonal szín (lista elemek között) - readonly property color separatorColor: "#3d4248" - - // ========================================= - // MÉRETEK - // ========================================= - - // Címsor betűméret - readonly property int fontSizeTitle: 24 - - // Alcím betűméret - readonly property int fontSizeSubtitle: 12 - - // Normál szöveg betűméret - readonly property int fontSizeNormal: 14 - - // Kis szöveg betűméret - readonly property int fontSizeSmall: 12 - - // Apró szöveg betűméret - readonly property int fontSizeTiny: 11 - - // Lista elem magasság - readonly property int listItemHeight: 48 - - // Gomb magasság - readonly property int buttonHeight: 48 - - // Input mező magasság - readonly property int inputHeight: 44 - - // Kerekítés sugara - readonly property int borderRadius: 6 - - // Nagy kerekítés sugara (lista) - readonly property int borderRadiusLarge: 8 - - // Belső margó - readonly property int spacing: 16 - - // Külső margó - readonly property int margin: 20 -} \ No newline at end of file diff --git a/raveos-calamares-module/wifi/ui/Translations.qml b/raveos-calamares-module/wifi/ui/Translations.qml index 21ef6df..601e8eb 100644 --- a/raveos-calamares-module/wifi/ui/Translations.qml +++ b/raveos-calamares-module/wifi/ui/Translations.qml @@ -1,183 +1,88 @@ pragma Singleton import QtQuick 2.15 -/** - * WiFi Modul Fordítások - * ====================== - * - * Támogatott nyelvek: - * - hu_HU: Magyar - * - de_DE: Német - * - en_US, en_GB, stb.: Angol (alapértelmezett) - * - * Új nyelv hozzáadása: - * 1. Adj hozzá egy új "else if" blokkot a setLanguage függvényben - * 2. Másold be az összes szöveget és fordítsd le - * - * Használat QML-ben: - * Text { text: Translations.title } - */ - QtObject { - id: root - - // Aktuális nyelv kód (pl. "hu_HU", "en_US") - property string currentLanguage: "en_US" - - // ========================================= - // CÍMEK ÉS FEJLÉCEK - // ========================================= - - // Sidebar név (bal oldali menüben) - property string sidebarName: "Hálózat" - - // Modul fő címe - property string title: "Wi-Fi Network" - - // Alcím / leírás - property string subtitle: "Select a network from the list, or enter a hidden network name manually." - - // Lista fejléc + property string eyebrow: "WI-FI" + property string title: "CONNECT TO A NETWORK" + property string subtitle: "The installer downloads the latest packages from the internet. With a cable connection this step is skipped automatically." property string availableNetworks: "Available networks" - - // ========================================= - // GOMBOK - // ========================================= - - // Frissítés gomb property string refresh: "Refresh" - - // Csatlakozás gomb + property string noNetworks: "No networks found. Click Refresh to search again." + property string selected: "Selected" + property string noSelection: "Select a network from the list" + property string password: "Password" property string connect: "Connect" - - // ========================================= - // INPUT MEZŐK - // ========================================= - - // SSID mező placeholder - property string ssidPlaceholder: "Network name (SSID)" - - // Jelszó mező placeholder - property string passwordPlaceholder: "Password" - - // Jelszó megjelenítő/elrejtő gomb - property string showPassword: "Show" - property string hidePassword: "Hide" - - // ========================================= - // ÁLLAPOT ÜZENETEK - // ========================================= - - // Sikeres csatlakozás - property string connected: "Successfully connected!" - - // Csatlakozás folyamatban - property string connecting: "Connecting..." - - // Nincs hálózat - property string noNetworks: "No networks found.\nClick Refresh to scan." - - // ========================================= - // TOGGLE ÉS OPCIÓK - // ========================================= - - // Rejtett hálózat toggle property string hiddenNetwork: "Hidden network" + property string ssidLabel: "Network name (SSID)" + property string statusLabel: "Status" + property string statusDisconnected: "not connected" + property string statusConnecting: "connecting..." + property string statusConnected: "connected" + property string statusFailed: "connection failed" + property string secured: "Password protected" + property string showPassword: "Show password" - // ========================================= - // INFORMÁCIÓS SZÖVEGEK - // ========================================= - - // Sikeres csatlakozás után - property string clickNextToContinue: "Click Next to continue." - - // Ha van vezetékes kapcsolat - property string canSkipWithEthernet: "If you have a wired connection, you can skip this step." - - // ========================================= - // NYELV BEÁLLÍTÁS FÜGGVÉNY - // ========================================= - - /** - * Nyelv beállítása a locale kód alapján - * @param locale - Nyelv kód (pl. "hu_HU", "en_US") - */ function setLanguage(locale) { - currentLanguage = locale - - // ================== - // MAGYAR - // ================== if (locale.startsWith("hu")) { - sidebarName = "Hálózat" - title = "Wi-Fi hálózat" - subtitle = "Válassz egy hálózatot a listából, vagy add meg kézzel a rejtett hálózat nevét." + eyebrow = "WI-FI" + title = "CSATLAKOZÁS A HÁLÓZATHOZ" + subtitle = "A telepítő az internetről tölti le a legfrissebb csomagokat. Kábellel csatlakozva ez a lépés magától kimarad." availableNetworks = "Elérhető hálózatok" refresh = "Frissítés" + noNetworks = "Nem található hálózat. Kattints a Frissítésre az újbóli kereséshez." + selected = "Kiválasztva" + noSelection = "Válassz egy hálózatot a listából" + password = "Jelszó" 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." hiddenNetwork = "Rejtett hálózat" - clickNextToContinue = "Kattints a Tovább gombra a folytatáshoz." - canSkipWithEthernet = "Ha van vezetékes kapcsolatod, kihagyhatod ezt a lépést." - } - // ================== - // NÉMET - // ================== - else if (locale.startsWith("de")) { - sidebarName = "Netzwerk" - title = "WLAN-Netzwerk" - subtitle = "Wählen Sie ein Netzwerk aus der Liste oder geben Sie den Namen eines versteckten Netzwerks manuell ein." + ssidLabel = "Hálózat neve (SSID)" + statusLabel = "Állapot" + statusDisconnected = "nincs kapcsolat" + statusConnecting = "csatlakozás..." + statusConnected = "csatlakozva" + statusFailed = "a csatlakozás nem sikerült" + secured = "Jelszóval védett" + showPassword = "Jelszó megjelenítése" + } else if (locale.startsWith("de")) { + eyebrow = "WLAN" + title = "MIT EINEM NETZWERK VERBINDEN" + subtitle = "Der Installer lädt die neuesten Pakete aus dem Internet. Mit Kabelverbindung wird dieser Schritt automatisch übersprungen." availableNetworks = "Verfügbare Netzwerke" refresh = "Aktualisieren" + noNetworks = "Keine Netzwerke gefunden. Klicke auf Aktualisieren, um erneut zu suchen." + selected = "Ausgewählt" + noSelection = "Wähle ein Netzwerk aus der Liste" + password = "Passwort" connect = "Verbinden" - ssidPlaceholder = "Netzwerkname (SSID)" - passwordPlaceholder = "Passwort" - showPassword = "Anzeigen" - hidePassword = "Ausblenden" - connected = "Erfolgreich verbunden!" - connecting = "Verbinden..." - noNetworks = "Keine Netzwerke gefunden.\nZum Scannen auf Aktualisieren klicken." hiddenNetwork = "Verstecktes Netzwerk" - clickNextToContinue = "Klicken Sie auf Weiter, um fortzufahren." - canSkipWithEthernet = "Wenn Sie eine Kabelverbindung haben, können Sie diesen Schritt überspringen." - } - // ================== - // ANGOL (alapértelmezett) - // ================== - else { - sidebarName = "Network" - title = "Wi-Fi Network" - subtitle = "Select a network from the list, or enter a hidden network name manually." + ssidLabel = "Netzwerkname (SSID)" + statusLabel = "Status" + statusDisconnected = "nicht verbunden" + statusConnecting = "verbinde..." + statusConnected = "verbunden" + statusFailed = "Verbindung fehlgeschlagen" + secured = "Passwortgeschützt" + showPassword = "Passwort anzeigen" + } else { + eyebrow = "WI-FI" + title = "CONNECT TO A NETWORK" + subtitle = "The installer downloads the latest packages from the internet. With a cable connection this step is skipped automatically." availableNetworks = "Available networks" refresh = "Refresh" + noNetworks = "No networks found. Click Refresh to search again." + selected = "Selected" + noSelection = "Select a network from the list" + password = "Password" 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." hiddenNetwork = "Hidden network" - clickNextToContinue = "Click Next to continue." - canSkipWithEthernet = "If you have a wired connection, you can skip this step." + ssidLabel = "Network name (SSID)" + statusLabel = "Status" + statusDisconnected = "not connected" + statusConnecting = "connecting..." + statusConnected = "connected" + statusFailed = "connection failed" + secured = "Password protected" + showPassword = "Show password" } - - // ================== - // TOVÁBBI NYELVEK IDE - // ================== - // Példa német nyelv hozzáadása: - // - // else if (locale.startsWith("de")) { - // title = "WLAN-Netzwerk" - // subtitle = "Wählen Sie ein Netzwerk aus der Liste..." - // // ... stb. - // } } } diff --git a/raveos-calamares-module/wifi/ui/qmldir b/raveos-calamares-module/wifi/ui/qmldir index e80b555..6f9105d 100644 --- a/raveos-calamares-module/wifi/ui/qmldir +++ b/raveos-calamares-module/wifi/ui/qmldir @@ -1,3 +1,2 @@ module WifiModule -singleton Style 1.0 Style.qml singleton Translations 1.0 Translations.qml diff --git a/raveos-calamares-module/wifi/ui/wifi.qml b/raveos-calamares-module/wifi/ui/wifi.qml index aee3ddc..e3b0b0c 100644 --- a/raveos-calamares-module/wifi/ui/wifi.qml +++ b/raveos-calamares-module/wifi/ui/wifi.qml @@ -1,404 +1,405 @@ import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 +import RaveOS 1.0 import "." as WifiModule Rectangle { id: root - color: WifiModule.Style.backgroundColor + color: Stilus.hatter - property string selectedSsid: "" - property bool showHiddenNetwork: false - property bool isConnecting: false - property bool showPassword: false + readonly property var t: WifiModule.Translations + property var kivalasztott: null + property bool rejtett: false + property bool csatlakozik: false + property bool sikertelen: false + property bool jelszoLatszik: false + + readonly property string ssid: rejtett ? ssidMezo.text : (kivalasztott ? kivalasztott.ssid : "") + readonly property bool jelszoKell: rejtett || (kivalasztott !== null && kivalasztott.secured) - // Function to update language - called from C++ function updateLanguage() { WifiModule.Translations.setLanguage(systemLocale) } - // Initialize translations on load - Component.onCompleted: { - WifiModule.Translations.setLanguage(systemLocale) + function savok(erosseg) { + if (erosseg >= 75) return 4 + if (erosseg >= 50) return 3 + if (erosseg >= 25) return 2 + return 1 } - ColumnLayout { - anchors.fill: parent - anchors.margins: WifiModule.Style.margin - spacing: WifiModule.Style.spacing - - // Header - Label { - text: WifiModule.Translations.title - font.pixelSize: WifiModule.Style.fontSizeTitle - font.bold: true - color: WifiModule.Style.textColor - Layout.alignment: Qt.AlignHCenter + function allapotSzoveg() { + if (nm.connected) return t.statusConnected + if (csatlakozik) return t.statusConnecting + if (sikertelen) return t.statusFailed + return t.statusDisconnected + } + + Component.onCompleted: WifiModule.Translations.setLanguage(systemLocale) + + Connections { + target: nm + function onConnectionChanged() { + if (nm.connected) + root.csatlakozik = false } + function onConnectionFailed(error) { + root.csatlakozik = false + root.sikertelen = true + } + } - Label { - text: WifiModule.Translations.subtitle - font.pixelSize: WifiModule.Style.fontSizeSubtitle - color: WifiModule.Style.textSecondaryColor - wrapMode: Text.WordWrap - Layout.fillWidth: true - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter + Timer { + interval: 30000 + running: root.csatlakozik + onTriggered: { + if (!nm.connected) { + root.csatlakozik = false + root.sikertelen = true + } + } + } + + component SzovegLink: Text { + signal kattint() + color: linkHover.hovered ? Stilus.zoldHover : Stilus.zold + font.family: Stilus.font + font.pixelSize: 13 + font.weight: Font.DemiBold + + HoverHandler { + id: linkHover + cursorShape: Qt.PointingHandCursor + } + + TapHandler { + onTapped: parent.kattint() } + } + + ColumnLayout { + anchors.fill: parent + anchors.topMargin: 40 + anchors.bottomMargin: 32 + anchors.leftMargin: 56 + anchors.rightMargin: 56 + spacing: 20 - // Connection status banner - Rectangle { + ColumnLayout { Layout.fillWidth: true - height: 40 - radius: WifiModule.Style.borderRadius - color: nm.connected ? WifiModule.Style.successColor : WifiModule.Style.progressColor - visible: nm.connected || isConnecting - - RowLayout { - anchors.centerIn: parent - spacing: 10 - - BusyIndicator { - running: isConnecting && !nm.connected - visible: isConnecting && !nm.connected - Layout.preferredWidth: 24 - Layout.preferredHeight: 24 - } + spacing: 10 - Label { - text: nm.connected ? WifiModule.Translations.connected : WifiModule.Translations.connecting - color: WifiModule.Style.textColor - font.pixelSize: WifiModule.Style.fontSizeNormal - font.bold: true - } + Fejlec { + Layout.fillWidth: true + felirat: root.t.eyebrow + cim: root.t.title + } + + Text { + Layout.fillWidth: true + text: root.t.subtitle + wrapMode: Text.WordWrap + color: Stilus.szovegMasodlagos + font.family: Stilus.font + font.pixelSize: 14 } } - // Network list - Rectangle { + RowLayout { Layout.fillWidth: true Layout.fillHeight: true - color: WifiModule.Style.listBackgroundColor - radius: WifiModule.Style.borderRadiusLarge - border.color: WifiModule.Style.borderColor - border.width: 1 + spacing: 24 ColumnLayout { - anchors.fill: parent - anchors.margins: 1 - spacing: 0 + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 8 - // List header with refresh button - Rectangle { + RowLayout { Layout.fillWidth: true - height: 44 - color: WifiModule.Style.listHeaderColor - radius: WifiModule.Style.borderRadiusLarge - - Rectangle { - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - height: 8 - color: parent.color - } - RowLayout { - anchors.fill: parent - anchors.leftMargin: 12 - anchors.rightMargin: 8 - - Label { - text: WifiModule.Translations.availableNetworks - color: WifiModule.Style.textColor - font.pixelSize: WifiModule.Style.fontSizeSmall - font.bold: true - } - - Item { Layout.fillWidth: true } - - Button { - text: WifiModule.Translations.refresh - Layout.preferredHeight: 32 - onClicked: nm.scan() - - background: Rectangle { - color: parent.hovered ? WifiModule.Style.buttonSecondaryHoverColor : WifiModule.Style.buttonSecondaryColor - radius: 4 - } + Text { + Layout.fillWidth: true + text: root.t.availableNetworks + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + font.weight: Font.Medium + font.letterSpacing: 1 + font.capitalization: Font.AllUppercase + } - contentItem: Label { - text: parent.text - color: WifiModule.Style.textColor - font.pixelSize: WifiModule.Style.fontSizeSmall - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } + SzovegLink { + text: root.t.refresh + onKattint: nm.scan() } } - // WiFi list - ListView { - id: networkList + Rectangle { Layout.fillWidth: true Layout.fillHeight: true - clip: true - model: nm.networks - - delegate: Rectangle { - width: networkList.width - height: WifiModule.Style.listItemHeight - color: modelData === selectedSsid ? WifiModule.Style.itemSelectedColor : - (mouseArea.containsMouse ? WifiModule.Style.itemHoverColor : "transparent") - - RowLayout { - anchors.fill: parent - anchors.leftMargin: 16 - anchors.rightMargin: 16 - spacing: 12 - - Label { - text: "" - font.pixelSize: 18 + color: Stilus.felulet + border.width: 1 + border.color: Stilus.keret + + ListView { + id: lista + anchors.fill: parent + anchors.margins: 1 + clip: true + model: nm.accessPoints + boundsBehavior: Flickable.StopAtBounds + ScrollBar.vertical: Gorgeto {} + + delegate: Rectangle { + id: sor + readonly property bool kijelolt: !root.rejtett && root.kivalasztott !== null && root.kivalasztott.ssid === modelData.ssid + width: lista.width + height: 48 + color: kijelolt ? Stilus.aktiv : (sorHover.hovered ? Stilus.aktiv : "transparent") + + Rectangle { + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: 1 + color: Stilus.aktiv } - Label { - text: modelData - color: WifiModule.Style.textColor - font.pixelSize: WifiModule.Style.fontSizeNormal - Layout.fillWidth: true - elide: Text.ElideRight + Rectangle { + visible: sor.kijelolt + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + width: 2 + color: Stilus.zold } - Label { - text: modelData === selectedSsid ? "✓" : "" - color: WifiModule.Style.successCheckColor - font.pixelSize: 16 - font.bold: true + RowLayout { + anchors.fill: parent + anchors.leftMargin: 14 + anchors.rightMargin: 14 + spacing: 12 + + Row { + Layout.alignment: Qt.AlignVCenter + spacing: 2 + height: 14 + + Repeater { + model: 4 + Rectangle { + anchors.bottom: parent.bottom + width: 3 + height: 4 + index * 3.3 + color: index < root.savok(modelData.strength) + ? (sor.kijelolt ? Stilus.zold : Stilus.szoveg) + : Stilus.keretErosebb + } + } + } + + Text { + Layout.fillWidth: true + text: modelData.ssid + elide: Text.ElideRight + color: Stilus.szoveg + font.family: Stilus.font + font.pixelSize: 14 + font.weight: sor.kijelolt ? Font.DemiBold : Font.Normal + } + + Canvas { + visible: modelData.secured + Layout.preferredWidth: 14 + Layout.preferredHeight: 14 + Accessible.name: root.t.secured + onPaint: { + var c = getContext("2d") + c.reset() + c.strokeStyle = Stilus.szovegHalvany + c.lineWidth = 1.5 + c.strokeRect(3, 6.5, 8, 6) + c.beginPath() + c.moveTo(4.5, 6.5) + c.lineTo(4.5, 4.5) + c.arc(7, 4.5, 2.5, Math.PI, 0) + c.lineTo(9.5, 6.5) + c.stroke() + } + } + + Text { + Layout.preferredWidth: 52 + horizontalAlignment: Text.AlignRight + text: modelData.band + color: Stilus.szovegHalvany + font.family: Stilus.mono + font.pixelSize: 11 + } } - } - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: { - selectedSsid = modelData - showHiddenNetwork = false - ssidField.text = modelData + HoverHandler { id: sorHover } + + TapHandler { + onTapped: { + root.rejtett = false + root.sikertelen = false + root.kivalasztott = modelData + jelszoMezo.text = "" + } } } - Rectangle { - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 16 - anchors.rightMargin: 16 - height: 1 - color: WifiModule.Style.separatorColor + Text { + anchors.centerIn: parent + width: parent.width - 40 + visible: lista.count === 0 + text: root.t.noNetworks + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 13 } } + } - Label { - anchors.centerIn: parent - text: WifiModule.Translations.noNetworks - color: WifiModule.Style.textMutedColor - font.pixelSize: WifiModule.Style.fontSizeSmall - horizontalAlignment: Text.AlignHCenter - visible: nm.networks.length === 0 + SzovegLink { + text: root.t.hiddenNetwork + onKattint: { + root.rejtett = true + root.kivalasztott = null + root.sikertelen = false } } } - } - // Hidden network toggle - Rectangle { - Layout.fillWidth: true - height: WifiModule.Style.inputHeight - color: "#3d7839" - radius: WifiModule.Style.borderRadius - - MouseArea { - anchors.fill: parent - onClicked: { - showHiddenNetwork = !showHiddenNetwork - if (showHiddenNetwork) { - selectedSsid = "" - ssidField.text = "" - ssidField.focus = true + Rectangle { + Layout.preferredWidth: 300 + Layout.alignment: Qt.AlignTop + implicitHeight: panel.implicitHeight + 36 + color: Stilus.felulet + border.width: 1 + border.color: Stilus.keret + + ColumnLayout { + id: panel + x: 18 + y: 18 + width: parent.width - 36 + spacing: 14 + + Text { + text: root.t.selected + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + font.letterSpacing: 1 + font.capitalization: Font.AllUppercase } - } - } - RowLayout { - anchors.fill: parent - anchors.leftMargin: 16 - anchors.rightMargin: 16 + Text { + visible: !root.rejtett + Layout.fillWidth: true + text: root.kivalasztott ? root.kivalasztott.ssid : root.t.noSelection + elide: Text.ElideRight + color: root.kivalasztott ? Stilus.szoveg : Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: root.kivalasztott ? 16 : 13 + font.weight: root.kivalasztott ? Font.DemiBold : Font.Normal + } - Label { - text: WifiModule.Translations.hiddenNetwork - color: WifiModule.Style.textColor - font.pixelSize: WifiModule.Style.fontSizeNormal - } + ColumnLayout { + visible: root.rejtett + Layout.fillWidth: true + spacing: 6 - Item { Layout.fillWidth: true } + Text { + text: root.t.ssidLabel + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + } - Rectangle { - width: 44 - height: 24 - radius: 12 - color: showHiddenNetwork ? WifiModule.Style.toggleOnColor : WifiModule.Style.toggleOffColor - - Rectangle { - width: 20 - height: 20 - radius: 10 - color: WifiModule.Style.textColor - x: showHiddenNetwork ? 22 : 2 - anchors.verticalCenter: parent.verticalCenter - - Behavior on x { - NumberAnimation { duration: 150 } + TextField { + id: ssidMezo + Layout.fillWidth: true + implicitHeight: 44 + leftPadding: 12 + color: Stilus.szoveg + font.family: Stilus.font + font.pixelSize: 14 + background: Rectangle { + color: Stilus.hatter + border.width: 1 + border.color: ssidMezo.activeFocus ? Stilus.zold : Stilus.keretErosebb + } } } - } - } - } - - // SSID field (for hidden networks) - TextField { - id: ssidField - Layout.fillWidth: true - placeholderText: WifiModule.Translations.ssidPlaceholder - visible: showHiddenNetwork - color: WifiModule.Style.textColor - placeholderTextColor: WifiModule.Style.inputPlaceholderColor - font.pixelSize: WifiModule.Style.fontSizeNormal - - background: Rectangle { - color: WifiModule.Style.inputBackgroundColor - radius: WifiModule.Style.borderRadius - border.color: ssidField.focus ? WifiModule.Style.inputFocusBorderColor : WifiModule.Style.inputBorderColor - border.width: 1 - } - } - - // Password field with show/hide toggle - Item { - Layout.fillWidth: true - Layout.preferredHeight: WifiModule.Style.inputHeight - - 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 - } - } - } - - // Connect button - Button { - Layout.fillWidth: true - Layout.preferredHeight: WifiModule.Style.buttonHeight - text: WifiModule.Translations.connect - enabled: (selectedSsid !== "" || (showHiddenNetwork && ssidField.text !== "")) && - passField.text !== "" && !isConnecting && !nm.connected - - onClicked: { - isConnecting = true - var ssid = showHiddenNetwork ? ssidField.text : selectedSsid - nm.connectTo(ssid, passField.text) - } + ColumnLayout { + visible: root.jelszoKell + Layout.fillWidth: true + spacing: 6 - background: Rectangle { - color: parent.enabled ? (parent.hovered ? WifiModule.Style.buttonPrimaryHoverColor : WifiModule.Style.buttonPrimaryColor) : WifiModule.Style.buttonDisabledColor - radius: WifiModule.Style.borderRadius - } - - contentItem: Label { - text: parent.text - color: parent.enabled ? WifiModule.Style.textColor : WifiModule.Style.textDisabledColor - font.pixelSize: 15 - font.bold: true - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - } - } + Text { + text: root.t.password + color: Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 12 + } - // Skip info - Label { - text: nm.connected ? - WifiModule.Translations.clickNextToContinue : - WifiModule.Translations.canSkipWithEthernet - color: WifiModule.Style.textMutedColor - font.pixelSize: WifiModule.Style.fontSizeTiny - Layout.alignment: Qt.AlignHCenter - horizontalAlignment: Text.AlignHCenter - } - } + JelszoMezo { + id: jelszoMezo + Layout.fillWidth: true + reveal: root.jelszoLatszik + revealName: root.t.showPassword + onRevealClicked: root.jelszoLatszik = !root.jelszoLatszik + onAccepted: csatlakozGomb.clicked() + } + } - // Connection state change handler - Connections { - target: nm - function onConnectionChanged() { - if (nm.connected) { - isConnecting = false - } - } - function onConnectionFailed(error) { - isConnecting = false - console.log("Connection failed: " + error) - } - } + Button { + id: csatlakozGomb + Layout.fillWidth: true + implicitHeight: 44 + text: root.t.connect + enabled: root.ssid !== "" && (!root.jelszoKell || jelszoMezo.text !== "") && !root.csatlakozik + onClicked: { + if (!enabled) + return + root.sikertelen = false + root.csatlakozik = true + nm.connectTo(root.ssid, root.jelszoKell ? jelszoMezo.text : "") + } + background: Rectangle { + color: !csatlakozGomb.enabled ? "transparent" : (csatlakozGomb.hovered ? Stilus.zoldHover : Stilus.zold) + border.width: csatlakozGomb.enabled ? 0 : 1 + border.color: Stilus.keret + } + contentItem: Text { + text: csatlakozGomb.text + color: csatlakozGomb.enabled ? Stilus.zoldonSzoveg : Stilus.szovegHalvany + font.family: Stilus.font + font.pixelSize: 14 + font.weight: Font.DemiBold + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } - // Timer to reset connecting state if it takes too long - Timer { - id: connectTimeout - interval: 30000 - running: isConnecting - onTriggered: { - if (!nm.connected) { - isConnecting = false + Text { + Layout.fillWidth: true + text: root.t.statusLabel + ": " + root.allapotSzoveg() + wrapMode: Text.WordWrap + color: nm.connected ? Stilus.zold : (root.sikertelen ? Stilus.sarga : Stilus.szovegHalvany) + font.family: Stilus.mono + font.pixelSize: 12 + } + } } } } -} \ No newline at end of file +} -- cgit v1.3