[nautilus/wip/cdavis/use-adw-message-dialog: 2/2] places-view: Use AdwMessageDialog




commit 4fbf26e52ed8b7a263cbdd3524b88a222d45f7f9
Author: Christopher Davis <christopherdavis gnome org>
Date:   Thu Jul 7 00:18:38 2022 -0400

    places-view: Use AdwMessageDialog

 src/nautilus-places-view.c | 15 +++++----------
 src/nautilus-places-view.h |  1 +
 2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 30c944c8a..36e3fbcd6 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -127,16 +127,11 @@ show_error_message_cb (NautilusGtkPlacesView *view,
 
     window = gtk_widget_get_root (GTK_WIDGET (view));
 
-    dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                     GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
-                                     GTK_MESSAGE_ERROR,
-                                     GTK_BUTTONS_CLOSE,
-                                     "%s", primary);
-    gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
-                                              "%s", secondary);
-
-    g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
-    gtk_widget_show (dialog);
+    dialog = adw_message_dialog_new (GTK_WINDOW (window), primary, secondary);
+    adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (dialog),
+                                     "close", _("_Close"));
+
+    gtk_window_present (GTK_WINDOW (dialog));
 }
 
 static void
diff --git a/src/nautilus-places-view.h b/src/nautilus-places-view.h
index e961d3995..8abc5872f 100644
--- a/src/nautilus-places-view.h
+++ b/src/nautilus-places-view.h
@@ -20,6 +20,7 @@
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
+#include <libadwaita-1/adwaita.h>
 
 G_BEGIN_DECLS
 


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