[libnma/lr/gtk-4.0: 16/23] cert-chooser-button: replace use of API gone from Gtk4
- From: Lubomir Rintel <lkundrak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libnma/lr/gtk-4.0: 16/23] cert-chooser-button: replace use of API gone from Gtk4
- Date: Mon, 25 Oct 2021 13:06:09 +0000 (UTC)
commit 59a13ce89ca671844f74ac38d8582c72b9a5fae8
Author: Lubomir Rintel <lkundrak v3 sk>
Date: Wed Oct 13 13:50:10 2021 +0200
cert-chooser-button: replace use of API gone from Gtk4
Gtk3 compatibility is kept with a compatibility shim.
src/nma-cert-chooser-button.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/nma-cert-chooser-button.c b/src/nma-cert-chooser-button.c
index e4d57773..9d4fc528 100644
--- a/src/nma-cert-chooser-button.c
+++ b/src/nma-cert-chooser-button.c
@@ -188,11 +188,11 @@ static void
select_from_token (NMACertChooserButton *button, GckSlot *slot)
{
NMACertChooserButtonPrivate *priv = NMA_CERT_CHOOSER_BUTTON_GET_PRIVATE (button);
- GtkWidget *toplevel;
+ GtkRoot *toplevel;
GtkWidget *dialog;
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
- if (!gtk_widget_is_toplevel (toplevel) || !GTK_IS_WINDOW (toplevel))
+ toplevel = gtk_widget_get_root (GTK_WIDGET (button));
+ if (toplevel && !GTK_IS_WINDOW (toplevel))
toplevel = NULL;
dialog = nma_pkcs11_cert_chooser_dialog_new (slot,
@@ -200,7 +200,7 @@ select_from_token (NMACertChooserButton *button, GckSlot *slot)
? CKO_PRIVATE_KEY
: CKO_CERTIFICATE,
priv->title,
- GTK_WINDOW (toplevel),
+ (GtkWindow *) toplevel,
GTK_FILE_CHOOSER_ACTION_OPEN | GTK_DIALOG_USE_HEADER_BAR,
_("Select"), GTK_RESPONSE_ACCEPT,
_("Cancel"), GTK_RESPONSE_CANCEL,
@@ -222,15 +222,15 @@ static void
select_from_file (NMACertChooserButton *button)
{
NMACertChooserButtonPrivate *priv = NMA_CERT_CHOOSER_BUTTON_GET_PRIVATE (button);
- GtkWidget *toplevel;
+ GtkRoot *toplevel;
GtkWidget *dialog;
- toplevel = gtk_widget_get_toplevel (GTK_WIDGET (button));
- if (!gtk_widget_is_toplevel (toplevel) || !GTK_IS_WINDOW (toplevel))
+ toplevel = gtk_widget_get_root (GTK_WIDGET (button));
+ if (toplevel && !GTK_IS_WINDOW (toplevel))
toplevel = NULL;
dialog = gtk_file_chooser_dialog_new (priv->title,
- GTK_WINDOW (toplevel),
+ (GtkWindow *) toplevel,
GTK_FILE_CHOOSER_ACTION_OPEN,
_("Select"), GTK_RESPONSE_ACCEPT,
_("Cancel"), GTK_RESPONSE_CANCEL,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]