Add kde patches

The nixpkgs patch is to clear out a conflict with a patch that's applied
to plasma-workspace by nixpkgs
This commit is contained in:
Toast 2025-07-04 22:31:07 +02:00
parent fd0f27145a
commit 98f9b3a8fc
23 changed files with 7818 additions and 0 deletions

View file

@ -0,0 +1,4 @@
Plasma 6.5.0:
Pr 439 https://invent.kde.org/plasma/plasma-nm/-/merge_requests/439
Pr 442 https://invent.kde.org/plasma/plasma-nm/-/merge_requests/442

View file

@ -0,0 +1,140 @@
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

View file

@ -0,0 +1,168 @@
From 63a9d544dc4f5160f28e5f3203a2c0a5e639e5ac Mon Sep 17 00:00:00 2001
From: Nate Graham <nate@kde.org>
Date: Fri, 13 Jun 2025 12:24:22 -0600
Subject: [PATCH] applet: use standard section headers
We have them, so we might as well use them. This lets us get rid of a
bunch of complex and fragile code that's responsible for the existing
separator.
---
applet/contents/ui/ConnectionItem.qml | 14 -----
applet/contents/ui/ConnectionListPage.qml | 10 ++--
applet/contents/ui/ListItem.qml | 64 -----------------------
libs/models/networkmodelitem.cpp | 8 ++-
4 files changed, 12 insertions(+), 84 deletions(-)
delete mode 100644 applet/contents/ui/ListItem.qml
diff --git a/applet/contents/ui/ConnectionItem.qml b/applet/contents/ui/ConnectionItem.qml
index ed154e633..5bb5c530c 100644
--- a/applet/contents/ui/ConnectionItem.qml
+++ b/applet/contents/ui/ConnectionItem.qml
@@ -321,20 +321,6 @@ PlasmaExtras.ExpandableListItem {
}
}
- onDeactivatedChanged: {
- /* Separator is part of section, which is visible only when available connections exist. Need to determine
- if there is a connection in use, to show Separator. Otherwise need to hide it from the top of the list.
- Connections in use are always on top, only need to check the first one. */
- if (appletProxyModel.data(appletProxyModel.index(0, 0), PlasmaNM.NetworkModel.SectionRole) !== "Available connections") {
- if (connectionView.showSeparator != true) {
- connectionView.showSeparator = true
- }
- return
- }
- connectionView.showSeparator = false
- return
- }
-
onItemCollapsed: {
connectionItem.customExpandedViewContent = detailsComponent;
setDelayModelUpdates(false);
diff --git a/applet/contents/ui/ConnectionListPage.qml b/applet/contents/ui/ConnectionListPage.qml
index b62da252c..d8ebd2c54 100644
--- a/applet/contents/ui/ConnectionListPage.qml
+++ b/applet/contents/ui/ConnectionListPage.qml
@@ -8,7 +8,7 @@ import QtQuick 2.15
import QtQuick.Layouts 1.2
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.kirigami 2.20 as Kirigami
-import org.kde.plasma.extras 2.0 as PlasmaExtras
+import org.kde.plasma.extras as PlasmaExtras
import org.kde.plasma.networkmanagement as PlasmaNM
import org.kde.networkmanager as NMQt
@@ -55,7 +55,6 @@ ColumnLayout {
id: connectionView
property int currentVisibleButtonIndex: -1
- property bool showSeparator: false
Keys.onDownPressed: event => {
connectionView.incrementCurrentIndex();
@@ -80,9 +79,10 @@ ColumnLayout {
model: appletProxyModel
currentIndex: -1
boundsBehavior: Flickable.StopAtBounds
- section.property: showSeparator ? "Section" : ""
- section.delegate: ListItem {
- separator: true
+ section.property: "Section"
+ section.delegate: PlasmaExtras.ListSectionHeader {
+ width: connectionView.width - connectionView.leftMargin - connectionView.rightMargin
+ text: section
}
highlight: PlasmaExtras.Highlight { }
highlightMoveDuration: Kirigami.Units.shortDuration
diff --git a/applet/contents/ui/ListItem.qml b/applet/contents/ui/ListItem.qml
deleted file mode 100644
index bfe1390d1..000000000
--- a/applet/contents/ui/ListItem.qml
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- SPDX-FileCopyrightText: 2010 Marco Martin <notmart@gmail.com>
- SPDX-FileCopyrightText: 2016 Jan Grulich <jgrulich@redhat.com>
- SPDX-FileCopyrightText: 2020 George Vogiatzis <gvgeo@protonmail.com>
-
- SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
-*/
-
-import QtQuick 2.1
-import org.kde.kirigami 2.20 as Kirigami
-import org.kde.ksvg 1.0 as KSvg
-
-/**
- * Ignores the theme's listItem margins, and uses custom highlight(pressed) area.
- * Could break some themes but the majority look fine.
- * Also includes a separator to be used in sections.
- */
-MouseArea {
- id: listItem
-
- property bool checked: false
- property bool separator: false
- property rect highlightRect: Qt.rect(0, 0, width, height)
-
- width: parent.width
-
- // Sections have spacing above but not below. Will use 2 of them below.
- height: separator ? separatorLine.height + Kirigami.Units.smallSpacing * 3 : parent.height
- hoverEnabled: true
-
- KSvg.SvgItem {
- id: separatorLine
- anchors {
- horizontalCenter: parent.horizontalCenter
- top: parent.top
- topMargin: Kirigami.Units.smallSpacing
- }
- imagePath: "widgets/line"
- elementId: "horizontal-line"
- width: parent.width - Kirigami.Units.gridUnit * 2
- visible: listItem.separator
- }
-
- KSvg.FrameSvgItem {
- id: background
- imagePath: "widgets/listitem"
- prefix: "normal"
- anchors.fill: parent
- visible: listItem.separator ? false : true
- }
-
- KSvg.FrameSvgItem {
- id: pressed
- imagePath: "widgets/listitem"
- prefix: "pressed"
- opacity: listItem.checked ? 1 : 0
- Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } }
-
- x: listItem.highlightRect.x
- y: listItem.highlightRect.y
- height: listItem.highlightRect.height
- width: listItem.highlightRect.width
- }
-}
diff --git a/libs/models/networkmodelitem.cpp b/libs/models/networkmodelitem.cpp
index b92ec0df2..4d7cbd77d 100644
--- a/libs/models/networkmodelitem.cpp
+++ b/libs/models/networkmodelitem.cpp
@@ -344,7 +344,13 @@ QString NetworkModelItem::originalName() const
QString NetworkModelItem::sectionType() const
{
if (m_connectionState == NetworkManager::ActiveConnection::Deactivated) {
- return QStringLiteral("Available connections");
+ return i18nc("@title:column header for list of available network connections", "Available");
+ // clang-format off
+ } else if (m_connectionState == NetworkManager::ActiveConnection::Activating
+ || m_connectionState == NetworkManager::ActiveConnection::Activated
+ || m_connectionState == NetworkManager::ActiveConnection::Deactivating) {
+ // clang-format on
+ return i18nc("@title:column header for list of connected network connections", "Connected");
} else {
return {};
}
--
GitLab