[libnma/lr/gtk-4.0: 2/22] all: destroy windows with gtk_window_destroy()
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libnma/lr/gtk-4.0: 2/22] all: destroy windows with gtk_window_destroy()
- Date: Wed, 20 Oct 2021 09:53:01 +0000 (UTC)
commit c3c0bb9ab9f40046320220fb95de410ec53a35e1
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Thu Oct 14 09:57:33 2021 +0200
all: destroy windows with gtk_window_destroy()
In Gtk4, only the windows can be destroyed explicitly and they in turn
take care of their children. Let's use the Gtk4 API we provide a compat
shim for.
src/nma-cert-chooser-button.c | 8 +++++---
src/nma-mobile-wizard.c | 2 +-
src/nma-pkcs11-cert-chooser-dialog.c | 5 +++--
src/nma-wifi-dialog.c | 4 ++--
src/tests/vpn-password-dialog.c | 25 +++++++++++++------------
src/tests/wifi-dialog-secrets.c | 5 +++--
src/tests/wifi-dialog.c | 3 ++-
7 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/src/nma-cert-chooser-button.c b/src/nma-cert-chooser-button.c
index 9d5287f5..eacaf9c1 100644
--- a/src/nma-cert-chooser-button.c
+++ b/src/nma-cert-chooser-button.c
@@ -3,10 +3,12 @@
*
* Lubomir Rintel <lkundrak v3 sk>
*
- * Copyright (C) 2016,2017 Red Hat, Inc.
+ * Copyright (C) 2016 - 2021 Red Hat, Inc.
*/
#include "nm-default.h"
+#include "nma-private.h"
+
#include "nma-cert-chooser-button.h"
#include "nma-pkcs11-cert-chooser-dialog.h"
#include "utils.h"
@@ -213,7 +215,7 @@ select_from_token (NMACertChooserButton *button, GckSlot *slot)
priv->remember_pin = nma_pkcs11_cert_chooser_dialog_get_remember_pin
(NMA_PKCS11_CERT_CHOOSER_DIALOG (dialog));
update_title (button);
}
- gtk_widget_destroy (dialog);
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
@@ -253,7 +255,7 @@ select_from_file (NMACertChooserButton *button)
priv->remember_pin = FALSE;
update_title (button);
}
- gtk_widget_destroy (dialog);
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
diff --git a/src/nma-mobile-wizard.c b/src/nma-mobile-wizard.c
index 64728230..3416f849 100644
--- a/src/nma-mobile-wizard.c
+++ b/src/nma-mobile-wizard.c
@@ -1563,5 +1563,5 @@ nma_mobile_wizard_destroy (NMAMobileWizard *self)
{
NMAMobileWizardPrivate *priv = NMA_MOBILE_WIZARD_GET_PRIVATE (self);
- gtk_widget_destroy (GTK_WIDGET (priv->assistant));
+ gtk_window_destroy (GTK_WINDOW (priv->assistant));
}
diff --git a/src/nma-pkcs11-cert-chooser-dialog.c b/src/nma-pkcs11-cert-chooser-dialog.c
index 188aac0f..c632105a 100644
--- a/src/nma-pkcs11-cert-chooser-dialog.c
+++ b/src/nma-pkcs11-cert-chooser-dialog.c
@@ -3,10 +3,11 @@
*
* Lubomir Rintel <lkundrak v3 sk>
*
- * Copyright (C) 2016,2017 Red Hat, Inc.
+ * Copyright (C) 2016 - 2021 Red Hat, Inc.
*/
#include "nm-default.h"
+#include "nma-private.h"
#include "nma-pkcs11-cert-chooser-dialog.h"
#include "nma-pkcs11-token-login-dialog.h"
@@ -347,7 +348,7 @@ login_clicked (GtkButton *button, gpointer user_data)
gck_slot_open_session_async (priv->slot, GCK_SESSION_READ_ONLY, NULL, session_opened, self);
}
- gtk_widget_destroy (dialog);
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
static void
diff --git a/src/nma-wifi-dialog.c b/src/nma-wifi-dialog.c
index 5c27c9b4..60f718f5 100644
--- a/src/nma-wifi-dialog.c
+++ b/src/nma-wifi-dialog.c
@@ -1343,7 +1343,7 @@ internal_new_dialog (NMClient *client,
if (!internal_init (self, connection, device, secrets_only, secrets_setting_name,
secrets_hints)) {
g_warning ("Couldn't create Wi-Fi security dialog.");
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
self = NULL;
}
}
@@ -1453,7 +1453,7 @@ internal_new_operation (NMClient *client,
if (!internal_init (self, NULL, NULL, FALSE, NULL, NULL)) {
g_warning ("Couldn't create Wi-Fi security dialog.");
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
return NULL;
}
diff --git a/src/tests/vpn-password-dialog.c b/src/tests/vpn-password-dialog.c
index 2a65b432..c66263af 100644
--- a/src/tests/vpn-password-dialog.c
+++ b/src/tests/vpn-password-dialog.c
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * Copyright 2018 Red Hat, Inc.
+ * Copyright (C) 2018 - 2021 Red Hat, Inc.
*/
#include "nm-default.h"
+#include "nma-private.h"
#include <gtk/gtk.h>
#include "nma-vpn-password-dialog.h"
@@ -11,7 +12,7 @@
int
main (int argc, char *argv[])
{
- GtkWidget *widget;
+ GtkWidget *dialog;
#if GTK_CHECK_VERSION(3,90,0)
gtk_init ();
@@ -19,18 +20,18 @@ main (int argc, char *argv[])
gtk_init (&argc, &argv);
#endif
- widget = nma_vpn_password_dialog_new ("Title", "Message", "Password");
+ dialog = nma_vpn_password_dialog_new ("Title", "Message", "Password");
- nma_vpn_password_dialog_set_password (NMA_VPN_PASSWORD_DIALOG (widget), "Password One");
- nma_vpn_password_dialog_set_password_label (NMA_VPN_PASSWORD_DIALOG (widget), "First _Label");
+ nma_vpn_password_dialog_set_password (NMA_VPN_PASSWORD_DIALOG (dialog), "Password One");
+ nma_vpn_password_dialog_set_password_label (NMA_VPN_PASSWORD_DIALOG (dialog), "First _Label");
- nma_vpn_password_dialog_set_password_secondary (NMA_VPN_PASSWORD_DIALOG (widget), "");
- nma_vpn_password_dialog_set_password_secondary_label (NMA_VPN_PASSWORD_DIALOG (widget), "_Second
Label");
- nma_vpn_password_dialog_set_show_password_secondary (NMA_VPN_PASSWORD_DIALOG (widget), TRUE);
+ nma_vpn_password_dialog_set_password_secondary (NMA_VPN_PASSWORD_DIALOG (dialog), "");
+ nma_vpn_password_dialog_set_password_secondary_label (NMA_VPN_PASSWORD_DIALOG (dialog), "_Second
Label");
+ nma_vpn_password_dialog_set_show_password_secondary (NMA_VPN_PASSWORD_DIALOG (dialog), TRUE);
- nma_vpn_password_dialog_set_password_ternary_label (NMA_VPN_PASSWORD_DIALOG (widget), "_Third Label");
- nma_vpn_password_dialog_set_show_password_ternary (NMA_VPN_PASSWORD_DIALOG (widget), TRUE);
+ nma_vpn_password_dialog_set_password_ternary_label (NMA_VPN_PASSWORD_DIALOG (dialog), "_Third Label");
+ nma_vpn_password_dialog_set_show_password_ternary (NMA_VPN_PASSWORD_DIALOG (dialog), TRUE);
- nma_vpn_password_dialog_run_and_block (NMA_VPN_PASSWORD_DIALOG (widget));
- gtk_widget_destroy (widget);
+ nma_vpn_password_dialog_run_and_block (NMA_VPN_PASSWORD_DIALOG (dialog));
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
diff --git a/src/tests/wifi-dialog-secrets.c b/src/tests/wifi-dialog-secrets.c
index f6d9ef95..99004ce3 100644
--- a/src/tests/wifi-dialog-secrets.c
+++ b/src/tests/wifi-dialog-secrets.c
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0+
/*
- * Copyright 2018 Red Hat, Inc.
+ * Copyright (C) 2018 - 2021 Red Hat, Inc.
*/
#include "nm-default.h"
+#include "nma-private.h"
#include <gtk/gtk.h>
#include <NetworkManager.h>
@@ -94,7 +95,7 @@ main (int argc, char *argv[])
hints);
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), connection);
gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ gtk_window_destroy (GTK_WINDOW (dialog));
g_object_unref (connection);
}
diff --git a/src/tests/wifi-dialog.c b/src/tests/wifi-dialog.c
index 1f8219ae..5957373e 100644
--- a/src/tests/wifi-dialog.c
+++ b/src/tests/wifi-dialog.c
@@ -4,6 +4,7 @@
*/
#include "nm-default.h"
+#include "nma-private.h"
#include <gtk/gtk.h>
#include "nma-wifi-dialog.h"
@@ -56,5 +57,5 @@ main (int argc, char *argv[])
dialog = nma_wifi_dialog_new (client, connection, device, ap, secrets_only);
gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ gtk_window_destroy (GTK_WINDOW (dialog));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]