Skip to content

Commit

Permalink
network: fix crash when adding cellular connection (#329)
Browse files Browse the repository at this point in the history
As GTK is loaded first, while libNMA is loaded later with the network panel
extension, the GtkBuilder for the wizard GUI doesn't know the libNMA types.

To fix that, we need to ensure the registration of these types.

Fixes: #225, #246
  • Loading branch information
okaestne authored May 14, 2024
1 parent 27c7bb2 commit 4d9be89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions panels/network/network-dialogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <NetworkManager.h>
#include <nma-wifi-dialog.h>
#include <nma-mobile-wizard.h>
#include <nma-mobile-providers.h>

#include "network-dialogs.h"

Expand Down Expand Up @@ -472,6 +473,10 @@ cc_network_panel_connect_to_3g_network (GtkWidget *toplevel,
closure->client = g_object_ref (client);
closure->device = g_object_ref (device);

g_type_ensure (NMA_TYPE_COUNTRY_INFO);
g_type_ensure (NMA_TYPE_MOBILE_ACCESS_METHOD);
g_type_ensure (NMA_TYPE_MOBILE_PROVIDER);

caps = nm_device_modem_get_current_capabilities (NM_DEVICE_MODEM (device));
if (caps & NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS) {
wizard = nma_mobile_wizard_new (GTK_WINDOW (toplevel), NULL, NM_DEVICE_MODEM_CAPABILITY_GSM_UMTS, FALSE,
Expand Down

0 comments on commit 4d9be89

Please sign in to comment.