From 9d75d777c72e4ddc9b05c06f0077484b7002625e Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 6 Feb 2023 08:22:48 -0300 Subject: [PATCH] status/network: Only show custom wired names Thanks to NetworkManager's connection name disambiguation, it's pretty common for single wired connections to be named "Wired". This is fine and what we want almost all times, but in the specific case of quick settings, we already have a "Wired" string set as title of the quick settings toggle, so having that as subtitle is reduntant. Hide the subtitle label (by returning null) when the subtitle of a wired network matches the title. Fixes ab10b95d2dc6bda1fc0fcc3b451e535f2fc160a8 Closes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6369 Part-of: --- js/ui/status/network.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 28e3d70a2..d3297a504 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1821,6 +1821,13 @@ class NMWiredToggle extends NMDeviceToggle { 'gnome-network-panel.desktop'); } + _transformSubtitle(source) { + const subtitle = super._transformSubtitle(source); + if (subtitle === this.title) + return null; + return subtitle; + } + _createDeviceMenuItem(device) { return new NMWiredDeviceItem(this._client, device); }