[gnome-shell/wip/sadiq/wwan-panel-settings: 128/128] status/network: Use wwan settings panel for GSM/LTE Modems




commit ae56a4212d73b8a7ef5220b3252a47b37594b71d
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Mon Aug 9 21:57:59 2021 +0530

    status/network: Use wwan settings panel for GSM/LTE Modems
    
    GSM/UMTS/LTE modems now have better support with wwan panel in GNOME
    Settings.  So, if the modem supports, open wwan panel, otherwise
    fallback to opening network panel when "Mobile Broadband Settings"
    item is clicked.
    
    See https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/583

 js/ui/status/network.js | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 377f44e48c..d6ad92418f 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -537,11 +537,15 @@ var NMDeviceModem = class extends NMConnectionDevice {
     constructor(client, device) {
         super(client, device);
 
-        this.item.menu.addSettingsAction(_("Mobile Broadband Settings"), 'gnome-network-panel.desktop');
+        const capabilities = device.current_capabilities;
+        const settingsPanel = capabilities & (NM.DeviceModemCapabilities.GSM_UMTS | 
NM.DeviceModemCapabilities.LTE)
+            ? 'gnome-wwan-panel.desktop'
+            : 'gnome-network-panel.desktop';
+
+        this.item.menu.addSettingsAction(_('Mobile Broadband Settings'), settingsPanel);
 
         this._mobileDevice = null;
 
-        let capabilities = device.current_capabilities;
         if (device.udi.indexOf('/org/freedesktop/ModemManager1/Modem') == 0)
             this._mobileDevice = new ModemManager.BroadbandModem(device.udi, capabilities);
         else if (capabilities & NM.DeviceModemCapabilities.GSM_UMTS)
@@ -564,7 +568,12 @@ var NMDeviceModem = class extends NMConnectionDevice {
     }
 
     _autoConnect() {
-        launchSettingsPanel('network', 'connect-3g', this._device.get_path());
+        // wwan panel doesn't support CDMA_EVDO modems
+        if (this._mobileDevice &&
+            this._device.current_capabilities & (NM.DeviceModemCapabilities.GSM_UMTS | 
NM.DeviceModemCapabilities.LTE))
+            launchSettingsPanel('wwan', 'show-device', this._device.udi);
+        else
+            launchSettingsPanel('network', 'connect-3g', this._device.get_path());
     }
 
     destroy() {


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