[nautilus/wip/cdavis/use-adw-message-dialog: 4/5] application: Use AdwMessageDialog for help error




commit 98bf2a405a9bf129817af385ea7f250ccf7e2b1d
Author: Christopher Davis <christopherdavis gnome org>
Date:   Wed Jul 6 20:55:53 2022 -0400

    application: Use AdwMessageDialog for help error

 src/nautilus-application.c | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 77fd7d045..081c650d4 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -765,18 +765,14 @@ action_help (GSimpleAction *action,
 
     if (error)
     {
-        dialog = gtk_message_dialog_new (window ? GTK_WINDOW (window) : NULL,
-                                         GTK_DIALOG_MODAL,
-                                         GTK_MESSAGE_ERROR,
-                                         GTK_BUTTONS_OK,
-                                         _("There was an error displaying help: \n%s"),
-                                         error->message);
-        g_signal_connect (G_OBJECT (dialog), "response",
-                          G_CALLBACK (gtk_window_destroy),
-                          NULL);
-
-        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
-        gtk_widget_show (dialog);
+        dialog = adw_message_dialog_new (window ? GTK_WINDOW (window) : NULL,
+                                         NULL, NULL);
+        adw_message_dialog_format_heading (ADW_MESSAGE_DIALOG (dialog),
+                                           _("There was an error displaying help: \n%s"),
+                                           error->message);
+        adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (dialog), "ok", _("_OK"));
+
+        gtk_window_present (GTK_WINDOW (dialog));
         g_error_free (error);
     }
 }


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