The nixpkgs patch is to clear out a conflict with a patch that's applied to plasma-workspace by nixpkgs
140 lines
5.9 KiB
Diff
140 lines
5.9 KiB
Diff
From ac32824009397188131aab4fcc3394fcc4551c5c Mon Sep 17 00:00:00 2001
|
|
From: Nate Graham <nate@kde.org>
|
|
Date: Tue, 10 Jun 2025 15:43:13 -0600
|
|
Subject: [PATCH 1/2] applet: handle some more states
|
|
|
|
1. Looking for Wi-Fi networks but haven't found any yet
|
|
2. NetworkManager isn't running
|
|
|
|
FEATURE: 485982
|
|
BUG: 462454
|
|
FIXED-IN: 6.5.0
|
|
---
|
|
applet/contents/ui/ConnectionListPage.qml | 15 ++++++++++++---
|
|
applet/contents/ui/Toolbar.qml | 3 ++-
|
|
applet/metadata.json | 1 -
|
|
libs/networkstatus.h | 3 +--
|
|
4 files changed, 15 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/applet/contents/ui/ConnectionListPage.qml b/applet/contents/ui/ConnectionListPage.qml
|
|
index b9a949d87..056f52de3 100644
|
|
--- a/applet/contents/ui/ConnectionListPage.qml
|
|
+++ b/applet/contents/ui/ConnectionListPage.qml
|
|
@@ -101,9 +101,12 @@ ColumnLayout {
|
|
if (toolbar.displayplaneModeMessage) {
|
|
return "network-flightmode-on"
|
|
}
|
|
- if (toolbar.displayWifiMessage) {
|
|
+ if (toolbar.displayWifiOffMessage) {
|
|
return "network-wireless-off"
|
|
}
|
|
+ if (toolbar.displayWifiConnectingMessage) {
|
|
+ return "view-refresh-symbolic"
|
|
+ }
|
|
if (toolbar.displayWwanMessage) {
|
|
return "network-mobile-off"
|
|
}
|
|
@@ -113,19 +116,25 @@ ColumnLayout {
|
|
if (toolbar.displayplaneModeMessage) {
|
|
return i18n("Airplane mode is enabled")
|
|
}
|
|
- if (toolbar.displayWifiMessage) {
|
|
+ if (toolbar.displayWifiOffMessage) {
|
|
if (toolbar.displayWwanMessage) {
|
|
return i18n("Wireless and mobile networks are deactivated")
|
|
}
|
|
return i18n("Wireless is deactivated")
|
|
}
|
|
+ if (toolbar.displayWifiConnectingMessage) {
|
|
+ return i18n("Looking for wireless networks")
|
|
+ }
|
|
if (toolbar.displayWwanMessage) {
|
|
return i18n("Mobile network is deactivated")
|
|
}
|
|
if (toolbar.searchTextField.text.length > 0) {
|
|
return i18n("No matches")
|
|
}
|
|
- return i18n("No available connections")
|
|
+ if (connectionListPage.nmStatus.connectivity === NMQt.NetworkManager.Full) {
|
|
+ return i18n("No available connections")
|
|
+ }
|
|
+ return nmStatus.checkUnknownReason()
|
|
}
|
|
}
|
|
}
|
|
diff --git a/applet/contents/ui/Toolbar.qml b/applet/contents/ui/Toolbar.qml
|
|
index 87b3f1654..0d382109b 100644
|
|
--- a/applet/contents/ui/Toolbar.qml
|
|
+++ b/applet/contents/ui/Toolbar.qml
|
|
@@ -16,7 +16,8 @@ import org.kde.kcmutils as KCMUtils
|
|
RowLayout {
|
|
id: toolbar
|
|
|
|
- readonly property var displayWifiMessage: !wifiSwitchButton.checked && wifiSwitchButton.visible
|
|
+ readonly property var displayWifiOffMessage: !wifiSwitchButton.checked && wifiSwitchButton.visible
|
|
+ readonly property var displayWifiConnectingMessage: wifiSwitchButton.checked && wifiSwitchButton.visible
|
|
readonly property var displayWwanMessage: !wwanSwitchButton.checked && wwanSwitchButton.visible
|
|
readonly property var displayplaneModeMessage: planeModeSwitchButton.checked && planeModeSwitchButton.visible
|
|
|
|
diff --git a/applet/metadata.json b/applet/metadata.json
|
|
index 0ca36a2b7..2f12891b5 100644
|
|
--- a/applet/metadata.json
|
|
+++ b/applet/metadata.json
|
|
@@ -210,6 +210,5 @@
|
|
"X-KDE-Keywords[zh_CN]": "network,internet,ethernet,wireless,wifi,wlan,vpn,wangluo,hulianwang,yitaiwang,juyuwang,wuxianwangluo,xunizhuanyongwangluo,网络,互联网,以太网,局域网,无线网络,虚拟专用网络",
|
|
"X-KDE-Keywords[zh_TW]": "網路,網絡,網際網路,乙太網路,以太網路,無線",
|
|
"X-Plasma-API-Minimum-Version": "6.0",
|
|
- "X-Plasma-DBusActivationService": "org.freedesktop.NetworkManager",
|
|
"X-Plasma-NotificationAreaCategory": "Hardware"
|
|
}
|
|
diff --git a/libs/networkstatus.h b/libs/networkstatus.h
|
|
index aa88bf7c5..a885f04dd 100644
|
|
--- a/libs/networkstatus.h
|
|
+++ b/libs/networkstatus.h
|
|
@@ -59,6 +59,7 @@ public:
|
|
QString activeConnections() const;
|
|
QString networkStatus() const;
|
|
NetworkManager::Connectivity connectivity() const;
|
|
+ Q_INVOKABLE QString checkUnknownReason() const;
|
|
|
|
private Q_SLOTS:
|
|
void activeConnectionsChanged();
|
|
@@ -75,8 +76,6 @@ private:
|
|
QString m_activeConnections;
|
|
QString m_networkStatus;
|
|
NetworkManager::Connectivity m_connectivity = NetworkManager::UnknownConnectivity;
|
|
-
|
|
- QString checkUnknownReason() const;
|
|
};
|
|
|
|
#endif // PLAMA_NM_NETWORK_STATUS_H
|
|
--
|
|
GitLab
|
|
|
|
|
|
From a45534cd9c19f267075fe4261087045f1f3a9318 Mon Sep 17 00:00:00 2001
|
|
From: Nate Graham <nate@kde.org>
|
|
Date: Wed, 11 Jun 2025 10:14:40 -0600
|
|
Subject: [PATCH 2/2] Rephrase "NetworkManager not running" message to be more
|
|
user-friendly
|
|
|
|
---
|
|
libs/networkstatus.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/libs/networkstatus.cpp b/libs/networkstatus.cpp
|
|
index c89ca9fca..b778eedda 100644
|
|
--- a/libs/networkstatus.cpp
|
|
+++ b/libs/networkstatus.cpp
|
|
@@ -253,7 +253,7 @@ QString NetworkStatus::checkUnknownReason() const
|
|
{
|
|
// Check if NetworkManager is running.
|
|
if (!QDBusConnection::systemBus().interface()->isServiceRegistered(QStringLiteral(NM_DBUS_INTERFACE))) {
|
|
- return i18n("NetworkManager not running");
|
|
+ return i18nc("@info:status", "NetworkManager service is not running");
|
|
}
|
|
|
|
// Check for compatible NetworkManager version.
|
|
--
|
|
GitLab
|
|
|