[gnome-shell] status/network: Stop summarizing device sections
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] status/network: Stop summarizing device sections
- Date: Wed, 10 Aug 2022 13:56:31 +0000 (UTC)
commit b4ff426a939dcdd82343904c289272f4c27ffd44
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Aug 3 18:33:53 2022 +0200
status/network: Stop summarizing device sections
Now that the number of displayed items is capped, there's no need
for a summary anymore.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2407>
js/ui/status/network.js | 68 -------------------------------------------------
1 file changed, 68 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 822bbafb08..825f160d4d 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -17,7 +17,6 @@ Gio._promisify(NM.Client, 'new_async');
Gio._promisify(NM.Client.prototype, 'check_connectivity_async');
const MAX_VISIBLE_NETWORKS = 8;
-var MAX_DEVICE_ITEMS = 4;
// small optimization, to avoid using [] all the time
const NM80211Mode = NM['80211Mode'];
@@ -1458,14 +1457,6 @@ class NMDeviceSection extends NMSection {
this._deviceType = deviceType;
this._nmDevices = new Set();
-
- this._summaryItem = new PopupMenu.PopupSubMenuMenuItem('', true);
- this._summaryItem.icon.icon_name = this._getSummaryIcon();
- this.addMenuItem(this._summaryItem);
-
- this._summaryItem.menu.addSettingsAction(_('Network Settings'),
- 'gnome-network-panel.desktop');
- this._summaryItem.hide();
}
setClient(client) {
@@ -1585,21 +1576,6 @@ class NMDeviceSection extends NMSection {
const nItems = this._items.size;
this._items.forEach(item => (item.singleDeviceMode = nItems === 1));
-
- let nDevices = this._itemsSection.box.get_children().reduce(
- (prev, child) => prev + (child.visible ? 1 : 0), 0);
- this._summaryItem.label.text = this._getSummaryLabel(nDevices);
- let shouldSummarize = nDevices > MAX_DEVICE_ITEMS;
- this._summaryItem.visible = shouldSummarize;
- this._itemsSection.actor.visible = !shouldSummarize;
- }
-
- _getSummaryIcon() {
- throw new GObject.NotImplementedError();
- }
-
- _getSummaryLabel() {
- throw new GObject.NotImplementedError();
}
}
@@ -1614,17 +1590,6 @@ class NMWirelessSection extends NMDeviceSection {
_createDeviceMenuItem(device) {
return new NMWirelessDeviceItem(this._client, device);
}
-
- _getSummaryIcon() {
- return 'network-wireless-symbolic';
- }
-
- _getSummaryLabel(nDevices) {
- return ngettext(
- '%s Wi-Fi Connection',
- '%s Wi-Fi Connections',
- nDevices).format(nDevices);
- }
}
class NMWiredSection extends NMDeviceSection {
@@ -1638,17 +1603,6 @@ class NMWiredSection extends NMDeviceSection {
_createDeviceMenuItem(device) {
return new NMWiredDeviceItem(this._client, device);
}
-
- _getSummaryIcon() {
- return 'network-wired-symbolic';
- }
-
- _getSummaryLabel(nDevices) {
- return ngettext(
- '%s Wired Connection',
- '%s Wired Connections',
- nDevices).format(nDevices);
- }
}
class NMBluetoothSection extends NMDeviceSection {
@@ -1662,17 +1616,6 @@ class NMBluetoothSection extends NMDeviceSection {
_createDeviceMenuItem(device) {
return new NMBluetoothDeviceItem(this._client, device);
}
-
- _getSummaryIcon() {
- return 'network-wireless-symbolic';
- }
-
- _getSummaryLabel(nDevices) {
- return ngettext(
- '%s Bluetooth Connection',
- '%s Bluetooth Connections',
- nDevices).format(nDevices);
- }
}
class NMModemSection extends NMDeviceSection {
@@ -1690,17 +1633,6 @@ class NMModemSection extends NMDeviceSection {
return new NMModemDeviceItem(this._client, device);
}
- _getSummaryIcon() {
- return 'network-wireless-symbolic';
- }
-
- _getSummaryLabel(nDevices) {
- return ngettext(
- '%s Modem Connection',
- '%s Modem Connections',
- nDevices).format(nDevices);
- }
-
_sync() {
super._sync();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]