From 2bb9cd068fe64ab82215a8bc24d82b2a631b2e95 Mon Sep 17 00:00:00 2001 From: ATMDA Date: Thu, 13 Nov 2025 19:56:44 -0500 Subject: nmcli: migrated all of ethernet controlcenter --- modules/controlcenter/ethernet/EthernetDetails.qml | 13 ++++++------- modules/controlcenter/ethernet/EthernetList.qml | 9 ++++----- modules/controlcenter/ethernet/EthernetSettings.qml | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) (limited to 'modules/controlcenter/ethernet') diff --git a/modules/controlcenter/ethernet/EthernetDetails.qml b/modules/controlcenter/ethernet/EthernetDetails.qml index d9a004b..68510da 100644 --- a/modules/controlcenter/ethernet/EthernetDetails.qml +++ b/modules/controlcenter/ethernet/EthernetDetails.qml @@ -18,15 +18,15 @@ Item { Component.onCompleted: { if (device && device.interface) { - Network.updateEthernetDeviceDetails(device.interface); + Nmcli.getEthernetDeviceDetails(device.interface, () => {}); } } onDeviceChanged: { if (device && device.interface) { - Network.updateEthernetDeviceDetails(device.interface); + Nmcli.getEthernetDeviceDetails(device.interface, () => {}); } else { - Network.ethernetDeviceDetails = null; + Nmcli.ethernetDeviceDetails = null; } } @@ -59,11 +59,10 @@ Item { checked: root.device?.connected ?? false toggle.onToggled: { if (checked) { - // Use connection name if available, otherwise use interface - Network.connectEthernet(root.device?.connection || "", root.device?.interface || ""); + Nmcli.connectEthernet(root.device?.connection || "", root.device?.interface || "", () => {}); } else { if (root.device?.connection) { - Network.disconnectEthernet(root.device.connection); + Nmcli.disconnectEthernet(root.device.connection, () => {}); } } } @@ -103,7 +102,7 @@ Item { SectionContainer { ConnectionInfoSection { - deviceDetails: Network.ethernetDeviceDetails + deviceDetails: Nmcli.ethernetDeviceDetails } } diff --git a/modules/controlcenter/ethernet/EthernetList.qml b/modules/controlcenter/ethernet/EthernetList.qml index b8c485b..45c9481 100644 --- a/modules/controlcenter/ethernet/EthernetList.qml +++ b/modules/controlcenter/ethernet/EthernetList.qml @@ -49,7 +49,7 @@ ColumnLayout { spacing: Appearance.spacing.small StyledText { - text: qsTr("Devices (%1)").arg(Network.ethernetDeviceCount || Network.ethernetDevices.length) + text: qsTr("Devices (%1)").arg(Nmcli.ethernetDevices.length) font.pointSize: Appearance.font.size.large font.weight: 500 } @@ -66,7 +66,7 @@ ColumnLayout { Layout.fillWidth: true Layout.fillHeight: true - model: Network.ethernetDevices + model: Nmcli.ethernetDevices spacing: Appearance.spacing.small / 2 clip: true @@ -145,10 +145,9 @@ ColumnLayout { StateLayer { function onClicked(): void { if (modelData.connected && modelData.connection) { - Network.disconnectEthernet(modelData.connection); + Nmcli.disconnectEthernet(modelData.connection, () => {}); } else { - // Use connection name if available, otherwise use interface - Network.connectEthernet(modelData.connection || "", modelData.interface || ""); + Nmcli.connectEthernet(modelData.connection || "", modelData.interface || "", () => {}); } } } diff --git a/modules/controlcenter/ethernet/EthernetSettings.qml b/modules/controlcenter/ethernet/EthernetSettings.qml index 68a1f61..161492c 100644 --- a/modules/controlcenter/ethernet/EthernetSettings.qml +++ b/modules/controlcenter/ethernet/EthernetSettings.qml @@ -64,7 +64,7 @@ ColumnLayout { } StyledText { - text: qsTr("%1").arg(Network.ethernetDeviceCount || Network.ethernetDevices.length) + text: qsTr("%1").arg(Nmcli.ethernetDevices.length) color: Colours.palette.m3outline font.pointSize: Appearance.font.size.small } @@ -75,7 +75,7 @@ ColumnLayout { } StyledText { - text: qsTr("%1").arg(Network.ethernetDevices.filter(d => d.connected).length) + text: qsTr("%1").arg(Nmcli.ethernetDevices.filter(d => d.connected).length) color: Colours.palette.m3outline font.pointSize: Appearance.font.size.small } -- cgit v1.2.3-freya