nmcli: migrated all of ethernet controlcenter
This commit is contained in:
parent
7799ec67fd
commit
2bb9cd068f
3 changed files with 12 additions and 14 deletions
|
|
@ -18,15 +18,15 @@ Item {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (device && device.interface) {
|
if (device && device.interface) {
|
||||||
Network.updateEthernetDeviceDetails(device.interface);
|
Nmcli.getEthernetDeviceDetails(device.interface, () => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onDeviceChanged: {
|
onDeviceChanged: {
|
||||||
if (device && device.interface) {
|
if (device && device.interface) {
|
||||||
Network.updateEthernetDeviceDetails(device.interface);
|
Nmcli.getEthernetDeviceDetails(device.interface, () => {});
|
||||||
} else {
|
} else {
|
||||||
Network.ethernetDeviceDetails = null;
|
Nmcli.ethernetDeviceDetails = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,11 +59,10 @@ Item {
|
||||||
checked: root.device?.connected ?? false
|
checked: root.device?.connected ?? false
|
||||||
toggle.onToggled: {
|
toggle.onToggled: {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
// Use connection name if available, otherwise use interface
|
Nmcli.connectEthernet(root.device?.connection || "", root.device?.interface || "", () => {});
|
||||||
Network.connectEthernet(root.device?.connection || "", root.device?.interface || "");
|
|
||||||
} else {
|
} else {
|
||||||
if (root.device?.connection) {
|
if (root.device?.connection) {
|
||||||
Network.disconnectEthernet(root.device.connection);
|
Nmcli.disconnectEthernet(root.device.connection, () => {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -103,7 +102,7 @@ Item {
|
||||||
|
|
||||||
SectionContainer {
|
SectionContainer {
|
||||||
ConnectionInfoSection {
|
ConnectionInfoSection {
|
||||||
deviceDetails: Network.ethernetDeviceDetails
|
deviceDetails: Nmcli.ethernetDeviceDetails
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ ColumnLayout {
|
||||||
spacing: Appearance.spacing.small
|
spacing: Appearance.spacing.small
|
||||||
|
|
||||||
StyledText {
|
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.pointSize: Appearance.font.size.large
|
||||||
font.weight: 500
|
font.weight: 500
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
model: Network.ethernetDevices
|
model: Nmcli.ethernetDevices
|
||||||
|
|
||||||
spacing: Appearance.spacing.small / 2
|
spacing: Appearance.spacing.small / 2
|
||||||
clip: true
|
clip: true
|
||||||
|
|
@ -145,10 +145,9 @@ ColumnLayout {
|
||||||
StateLayer {
|
StateLayer {
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
if (modelData.connected && modelData.connection) {
|
if (modelData.connected && modelData.connection) {
|
||||||
Network.disconnectEthernet(modelData.connection);
|
Nmcli.disconnectEthernet(modelData.connection, () => {});
|
||||||
} else {
|
} else {
|
||||||
// Use connection name if available, otherwise use interface
|
Nmcli.connectEthernet(modelData.connection || "", modelData.interface || "", () => {});
|
||||||
Network.connectEthernet(modelData.connection || "", modelData.interface || "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: qsTr("%1").arg(Network.ethernetDeviceCount || Network.ethernetDevices.length)
|
text: qsTr("%1").arg(Nmcli.ethernetDevices.length)
|
||||||
color: Colours.palette.m3outline
|
color: Colours.palette.m3outline
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
}
|
}
|
||||||
|
|
@ -75,7 +75,7 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
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
|
color: Colours.palette.m3outline
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue