[gnome-shell] status/network: Give bluetooth its own category



commit 73f4bb13d0d1f0f4b9c447bd7f5d402a43c03f64
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Aug 1 15:13:06 2022 +0200

    status/network: Give bluetooth its own category
    
    In the quick settings future, each device type will use a separate
    toggle. We still have a long way to go, but start with giving
    bluetooth its own section/category. Baby steps …
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>

 js/ui/status/network.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 5e0c05634d..8b08dd56be 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -24,6 +24,7 @@ const NMConnectionCategory = {
     INVALID: 'invalid',
     WIRED: 'wired',
     WIRELESS: 'wireless',
+    BLUETOOTH: 'bluetooth',
     WWAN: 'wwan',
     VPN: 'vpn',
 };
@@ -564,7 +565,7 @@ var NMBluetoothDeviceItem = class extends NMDeviceItem {
     }
 
     get category() {
-        return NMConnectionCategory.WWAN;
+        return NMConnectionCategory.BLUETOOTH;
     }
 
     _getDescription() {
@@ -1544,6 +1545,7 @@ var DeviceCategory = class extends PopupMenu.PopupMenuSection {
         case NMConnectionCategory.WIRED:
             return 'network-wired-symbolic';
         case NMConnectionCategory.WIRELESS:
+        case NMConnectionCategory.BLUETOOTH:
         case NMConnectionCategory.WWAN:
             return 'network-wireless-symbolic';
         }
@@ -1560,6 +1562,11 @@ var DeviceCategory = class extends PopupMenu.PopupMenuSection {
             return ngettext("%s Wi-Fi Connection",
                             "%s Wi-Fi Connections",
                             nDevices).format(nDevices);
+        case NMConnectionCategory.BLUETOOTH:
+            return ngettext(
+                '%s Bluetooth Connection',
+                '%s Bluetooth Connections',
+                nDevices).format(nDevices);
         case NMConnectionCategory.WWAN:
             return ngettext("%s Modem Connection",
                             "%s Modem Connections",
@@ -1588,7 +1595,7 @@ class Indicator extends PanelMenu.SystemIndicator {
         this._ctypes = { };
         this._ctypes[NM.SETTING_WIRED_SETTING_NAME] = NMConnectionCategory.WIRED;
         this._ctypes[NM.SETTING_WIRELESS_SETTING_NAME] = NMConnectionCategory.WIRELESS;
-        this._ctypes[NM.SETTING_BLUETOOTH_SETTING_NAME] = NMConnectionCategory.WWAN;
+        this._ctypes[NM.SETTING_BLUETOOTH_SETTING_NAME] = NMConnectionCategory.BLUETOOTH;
         this._ctypes[NM.SETTING_CDMA_SETTING_NAME] = NMConnectionCategory.WWAN;
         this._ctypes[NM.SETTING_GSM_SETTING_NAME] = NMConnectionCategory.WWAN;
         this._ctypes[NM.SETTING_VPN_SETTING_NAME] = NMConnectionCategory.VPN;
@@ -1614,6 +1621,7 @@ class Indicator extends PanelMenu.SystemIndicator {
         const categories = [
             NMConnectionCategory.WIRED,
             NMConnectionCategory.WIRELESS,
+            NMConnectionCategory.BLUETOOTH,
             NMConnectionCategory.WWAN,
         ];
         for (let category of categories) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]