[epiphany/mcatanzaro/#1570: 73/73] passwords-view: fix the Clear All action




commit c084516e271387e03033db32bbb14b647c2747fc
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Sun Aug 1 09:16:16 2021 -0500

    passwords-view: fix the Clear All action
    
    Apparently people don't try to delete all their passwords very often,
    because this has been broken for the past year and nobody noticed until
    now. Whatever. The dialog is no longer a GtkWindow so we just have to
    find the parent window instead.
    
    Fixes #1570
    
    Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/993>

 src/preferences/passwords-view.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/preferences/passwords-view.c b/src/preferences/passwords-view.c
index b4df843af..66d0fe2d4 100644
--- a/src/preferences/passwords-view.c
+++ b/src/preferences/passwords-view.c
@@ -183,9 +183,13 @@ confirmation_dialog_response_cb (GtkWidget         *dialog,
 static GtkWidget *
 confirmation_dialog_construct (EphyPasswordsView *self)
 {
-  GtkWidget *dialog, *button;
+  GtkWidget *dialog;
+  GtkWidget *button;
+  GtkWidget *window;
 
-  dialog = gtk_message_dialog_new (GTK_WINDOW (self),
+  window = gtk_widget_get_toplevel (GTK_WIDGET (self));
+
+  dialog = gtk_message_dialog_new (GTK_WINDOW (window),
                                    GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_WARNING,
                                    GTK_BUTTONS_CANCEL,
@@ -194,7 +198,7 @@ confirmation_dialog_construct (EphyPasswordsView *self)
   gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
                                             _("This will clear all locally stored passwords, and can not be 
undone."));
 
-  gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (self)),
+  gtk_window_group_add_window (ephy_gui_ensure_window_group (GTK_WINDOW (window)),
                                GTK_WINDOW (dialog));
 
   button = gtk_button_new_with_mnemonic (_("_Delete"));


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