summaryrefslogtreecommitdiff
path: root/raveos-calamares-module/wifi/ui
diff options
context:
space:
mode:
authornippy <you@example.com>2026-04-12 16:43:55 +0200
committernippy <you@example.com>2026-04-12 16:43:55 +0200
commit8e94c144b376015cf67750bbf2727204c4bb213b (patch)
tree8961ba989c1b4cf9fa3d7174d1e29ec3324b9362 /raveos-calamares-module/wifi/ui
parente023d81615abfeaaac7a22807f7d722072280ea8 (diff)
downloadRaveOS-PKGBUILD-8e94c144b376015cf67750bbf2727204c4bb213b.tar.gz
RaveOS-PKGBUILD-8e94c144b376015cf67750bbf2727204c4bb213b.zip
update Live
Diffstat (limited to 'raveos-calamares-module/wifi/ui')
-rw-r--r--raveos-calamares-module/wifi/ui/Style.qml161
-rw-r--r--raveos-calamares-module/wifi/ui/Translations.qml153
-rw-r--r--raveos-calamares-module/wifi/ui/qmldir3
-rw-r--r--raveos-calamares-module/wifi/ui/wifi.qml373
4 files changed, 690 insertions, 0 deletions
diff --git a/raveos-calamares-module/wifi/ui/Style.qml b/raveos-calamares-module/wifi/ui/Style.qml
new file mode 100644
index 0000000..360d4d2
--- /dev/null
+++ b/raveos-calamares-module/wifi/ui/Style.qml
@@ -0,0 +1,161 @@
+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
new file mode 100644
index 0000000..32b7972
--- /dev/null
+++ b/raveos-calamares-module/wifi/ui/Translations.qml
@@ -0,0 +1,153 @@
+pragma Singleton
+import QtQuick 2.15
+
+/**
+ * WiFi Modul Fordítások
+ * ======================
+ *
+ * Támogatott nyelvek:
+ * - hu_HU: Magyar
+ * - 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álozat"
+
+ // 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 availableNetworks: "Available networks"
+
+ // =========================================
+ // GOMBOK
+ // =========================================
+
+ // Frissítés gomb
+ property string refresh: "Refresh"
+
+ // Csatlakozás gomb
+ property string connect: "Connect"
+
+ // =========================================
+ // INPUT MEZŐK
+ // =========================================
+
+ // SSID mező placeholder
+ property string ssidPlaceholder: "Network name (SSID)"
+
+ // Jelszó mező placeholder
+ property string passwordPlaceholder: "Password"
+
+ // =========================================
+ // Á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"
+
+ // =========================================
+ // 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álozat"
+ 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."
+ availableNetworks = "Elérhető hálózatok"
+ refresh = "Frissítés"
+ connect = "Csatlakozás"
+ ssidPlaceholder = "Hálózat neve (SSID)"
+ passwordPlaceholder = "Jelszó"
+ 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."
+ }
+ // ==================
+ // ANGOL (alapértelmezett)
+ // ==================
+ else {
+ sidebarName = "Network"
+ title = "Wi-Fi Network"
+ subtitle = "Select a network from the list, or enter a hidden network name manually."
+ availableNetworks = "Available networks"
+ refresh = "Refresh"
+ connect = "Connect"
+ ssidPlaceholder = "Network name (SSID)"
+ passwordPlaceholder = "Password"
+ 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."
+ }
+
+ // ==================
+ // 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
new file mode 100644
index 0000000..e80b555
--- /dev/null
+++ b/raveos-calamares-module/wifi/ui/qmldir
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 0000000..2bb6cf6
--- /dev/null
+++ b/raveos-calamares-module/wifi/ui/wifi.qml
@@ -0,0 +1,373 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import QtQuick.Layouts 1.15
+import "." as WifiModule
+
+Rectangle {
+ id: root
+ color: WifiModule.Style.backgroundColor
+
+ property string selectedSsid: ""
+ property bool showHiddenNetwork: false
+ property bool isConnecting: false
+
+ // Function to update language - called from C++
+ function updateLanguage() {
+ WifiModule.Translations.setLanguage(systemLocale)
+ }
+
+ // Initialize translations on load
+ Component.onCompleted: {
+ WifiModule.Translations.setLanguage(systemLocale)
+ }
+
+ 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
+ }
+
+ 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
+ }
+
+ // Connection status banner
+ Rectangle {
+ 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
+ }
+
+ Label {
+ text: nm.connected ? WifiModule.Translations.connected : WifiModule.Translations.connecting
+ color: WifiModule.Style.textColor
+ font.pixelSize: WifiModule.Style.fontSizeNormal
+ font.bold: true
+ }
+ }
+ }
+
+ // Network list
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ color: WifiModule.Style.listBackgroundColor
+ radius: WifiModule.Style.borderRadiusLarge
+ border.color: WifiModule.Style.borderColor
+ border.width: 1
+
+ ColumnLayout {
+ anchors.fill: parent
+ anchors.margins: 1
+ spacing: 0
+
+ // List header with refresh button
+ Rectangle {
+ 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
+ }
+
+ contentItem: Label {
+ text: parent.text
+ color: WifiModule.Style.textColor
+ font.pixelSize: WifiModule.Style.fontSizeSmall
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
+ }
+ }
+
+ // WiFi list
+ ListView {
+ id: networkList
+ 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
+ }
+
+ Label {
+ text: modelData
+ color: WifiModule.Style.textColor
+ font.pixelSize: WifiModule.Style.fontSizeNormal
+ Layout.fillWidth: true
+ elide: Text.ElideRight
+ }
+
+ Label {
+ text: modelData === selectedSsid ? "✓" : ""
+ color: WifiModule.Style.successCheckColor
+ font.pixelSize: 16
+ font.bold: true
+ }
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ hoverEnabled: true
+ onClicked: {
+ selectedSsid = modelData
+ showHiddenNetwork = false
+ ssidField.text = modelData
+ }
+ }
+
+ 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
+ }
+ }
+
+ 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
+ }
+ }
+ }
+ }
+
+ // 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
+ }
+ }
+ }
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: 16
+ anchors.rightMargin: 16
+
+ Label {
+ text: WifiModule.Translations.hiddenNetwork
+ color: WifiModule.Style.textColor
+ font.pixelSize: WifiModule.Style.fontSizeNormal
+ }
+
+ Item { Layout.fillWidth: true }
+
+ 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 }
+ }
+ }
+ }
+ }
+ }
+
+ // 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
+ TextField {
+ id: passField
+ 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
+
+ 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
+ }
+ }
+
+ // 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)
+ }
+
+ 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
+ }
+ }
+
+ // 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
+ }
+ }
+
+ // Connection state change handler
+ Connections {
+ target: nm
+ function onConnectionChanged() {
+ if (nm.connected) {
+ isConnecting = false
+ }
+ }
+ function onConnectionFailed(error) {
+ isConnecting = false
+ console.log("Connection failed: " + error)
+ }
+ }
+
+ // Timer to reset connecting state if it takes too long
+ Timer {
+ id: connectTimeout
+ interval: 30000
+ running: isConnecting
+ onTriggered: {
+ if (!nm.connected) {
+ isConnecting = false
+ }
+ }
+ }
+} \ No newline at end of file