diff options
| author | ATMDA <atdma2600@gmail.com> | 2025-11-10 11:51:43 -0500 |
|---|---|---|
| committer | ATMDA <atdma2600@gmail.com> | 2025-11-10 11:51:43 -0500 |
| commit | 817156aec079852141d52d484dd14eec3fa0a88e (patch) | |
| tree | 33ffa5bd9aa5611c05661202b54489d25335e513 /modules | |
| parent | controlcenter: ethernet panel (debug) (diff) | |
| download | caelestia-shell-817156aec079852141d52d484dd14eec3fa0a88e.tar.gz caelestia-shell-817156aec079852141d52d484dd14eec3fa0a88e.tar.bz2 caelestia-shell-817156aec079852141d52d484dd14eec3fa0a88e.zip | |
controlcenter: polished ethernet panel
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/controlcenter/ethernet/EthernetDetails.qml | 95 | ||||
| -rw-r--r-- | modules/controlcenter/ethernet/EthernetList.qml | 5 | ||||
| -rw-r--r-- | modules/controlcenter/ethernet/EthernetSettings.qml | 50 |
3 files changed, 95 insertions, 55 deletions
diff --git a/modules/controlcenter/ethernet/EthernetDetails.qml b/modules/controlcenter/ethernet/EthernetDetails.qml index 9be3ddc..1db3db0 100644 --- a/modules/controlcenter/ethernet/EthernetDetails.qml +++ b/modules/controlcenter/ethernet/EthernetDetails.qml @@ -16,6 +16,20 @@ Item { required property Session session readonly property var device: session.ethernet.active + Component.onCompleted: { + if (device && device.interface) { + Network.updateEthernetDeviceDetails(device.interface); + } + } + + onDeviceChanged: { + if (device && device.interface) { + Network.updateEthernetDeviceDetails(device.interface); + } else { + Network.ethernetDeviceDetails = null; + } + } + StyledFlickable { anchors.fill: parent @@ -79,9 +93,8 @@ Item { checked: root.device?.connected ?? false toggle.onToggled: { if (checked) { - if (root.device?.connection) { - Network.connectEthernet(root.device.connection); - } + // Use connection name if available, otherwise use interface + Network.connectEthernet(root.device?.connection || "", root.device?.interface || ""); } else { if (root.device?.connection) { Network.disconnectEthernet(root.device.connection); @@ -155,6 +168,82 @@ Item { } } + StyledText { + Layout.topMargin: Appearance.spacing.large + text: qsTr("Connection information") + font.pointSize: Appearance.font.size.larger + font.weight: 500 + } + + StyledText { + text: qsTr("Network connection details") + color: Colours.palette.m3outline + } + + StyledRect { + Layout.fillWidth: true + implicitHeight: connectionInfo.implicitHeight + Appearance.padding.large * 2 + + radius: Appearance.rounding.normal + color: Colours.tPalette.m3surfaceContainer + + ColumnLayout { + id: connectionInfo + + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + anchors.margins: Appearance.padding.large + + spacing: Appearance.spacing.small / 2 + + StyledText { + text: qsTr("IP Address") + } + + StyledText { + text: Network.ethernetDeviceDetails?.ipAddress || qsTr("Not available") + color: Colours.palette.m3outline + font.pointSize: Appearance.font.size.small + } + + StyledText { + Layout.topMargin: Appearance.spacing.normal + text: qsTr("Subnet Mask") + } + + StyledText { + text: Network.ethernetDeviceDetails?.subnet || qsTr("Not available") + color: Colours.palette.m3outline + font.pointSize: Appearance.font.size.small + } + + StyledText { + Layout.topMargin: Appearance.spacing.normal + text: qsTr("Gateway") + } + + StyledText { + text: Network.ethernetDeviceDetails?.gateway || qsTr("Not available") + color: Colours.palette.m3outline + font.pointSize: Appearance.font.size.small + } + + StyledText { + Layout.topMargin: Appearance.spacing.normal + text: qsTr("DNS Servers") + } + + StyledText { + text: (Network.ethernetDeviceDetails && Network.ethernetDeviceDetails.dns && Network.ethernetDeviceDetails.dns.length > 0) ? Network.ethernetDeviceDetails.dns.join(", ") : qsTr("Not available") + color: Colours.palette.m3outline + font.pointSize: Appearance.font.size.small + wrapMode: Text.Wrap + Layout.maximumWidth: parent.width + } + } + } + } } diff --git a/modules/controlcenter/ethernet/EthernetList.qml b/modules/controlcenter/ethernet/EthernetList.qml index d239fc6..6ed50fd 100644 --- a/modules/controlcenter/ethernet/EthernetList.qml +++ b/modules/controlcenter/ethernet/EthernetList.qml @@ -144,8 +144,9 @@ ColumnLayout { function onClicked(): void { if (modelData.connected && modelData.connection) { Network.disconnectEthernet(modelData.connection); - } else if (modelData.connection) { - Network.connectEthernet(modelData.connection); + } else { + // Use connection name if available, otherwise use interface + Network.connectEthernet(modelData.connection || "", modelData.interface || ""); } } } diff --git a/modules/controlcenter/ethernet/EthernetSettings.qml b/modules/controlcenter/ethernet/EthernetSettings.qml index b780b55..33b1449 100644 --- a/modules/controlcenter/ethernet/EthernetSettings.qml +++ b/modules/controlcenter/ethernet/EthernetSettings.qml @@ -81,56 +81,6 @@ ColumnLayout { } } } - - StyledText { - Layout.topMargin: Appearance.spacing.large - text: qsTr("Debug Info") - font.pointSize: Appearance.font.size.larger - font.weight: 500 - } - - StyledRect { - Layout.fillWidth: true - implicitHeight: debugInfo.implicitHeight + Appearance.padding.large * 2 - - radius: Appearance.rounding.normal - color: Colours.tPalette.m3surfaceContainer - - ColumnLayout { - id: debugInfo - - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.margins: Appearance.padding.large - - spacing: Appearance.spacing.small / 2 - - StyledText { - text: qsTr("Process running: %1").arg(Network.ethernetProcessRunning ? "Yes" : "No") - font.pointSize: Appearance.font.size.small - } - - StyledText { - text: qsTr("List length: %1").arg(Network.ethernetDevices.length) - font.pointSize: Appearance.font.size.small - } - - StyledText { - text: qsTr("Device count: %1").arg(Network.ethernetDeviceCount) - font.pointSize: Appearance.font.size.small - } - - StyledText { - Layout.topMargin: Appearance.spacing.normal - text: qsTr("Debug: %1").arg(Network.ethernetDebugInfo || "No info") - font.pointSize: Appearance.font.size.small - color: Colours.palette.m3outline - wrapMode: Text.Wrap - Layout.maximumWidth: parent.width - } - } - } } |