summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Sadiq <sadiq@sadiqpk.org>2019-10-04 16:02:23 +0530
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2021-08-13 19:25:41 +0000
commit169f537e4b31bf5c119a5fc262bb3e3c708d1ba1 (patch)
treeda2acb9debff94df419be53913b85b6dcc3d9c5e
parentdc840f0aec346f3fb297789eb1641255574c47a4 (diff)
downloadgnome-control-center-169f537e4b31bf5c119a5fc262bb3e3c708d1ba1.tar.gz
network: Don't show modems supported by cellular panel
Cellular panel is already handling it
-rw-r--r--panels/network/cc-network-panel.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/panels/network/cc-network-panel.c b/panels/network/cc-network-panel.c
index 01b164ea0..bd4e55df8 100644
--- a/panels/network/cc-network-panel.c
+++ b/panels/network/cc-network-panel.c
@@ -382,6 +382,27 @@ update_bluetooth_section (CcNetworkPanel *self)
gtk_widget_set_visible (self->container_bluetooth, self->bluetooth_devices->len > 0);
}
+static gboolean
+wwan_panel_supports_modem (GDBusObject *object)
+{
+ MMObject *mm_object;
+ MMModem *modem;
+ MMModemCapability capability, supported_capabilities;
+
+ g_assert (G_IS_DBUS_OBJECT (object));
+
+ supported_capabilities = MM_MODEM_CAPABILITY_GSM_UMTS | MM_MODEM_CAPABILITY_LTE;
+#if MM_CHECK_VERSION (1,14,0)
+ supported_capabilities |= MM_MODEM_CAPABILITY_5GNR;
+#endif
+
+ mm_object = MM_OBJECT (object);
+ modem = mm_object_get_modem (mm_object);
+ capability = mm_modem_get_current_capabilities (modem);
+
+ return capability & supported_capabilities;
+}
+
static void
panel_add_device (CcNetworkPanel *self, NMDevice *device)
{
@@ -425,6 +446,10 @@ panel_add_device (CcNetworkPanel *self, NMDevice *device)
nm_device_get_udi (device));
return;
}
+
+ /* This will be handled by cellular panel */
+ if (wwan_panel_supports_modem (modem_object))
+ return;
}
device_mobile = net_device_mobile_new (self->client, device, modem_object);