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




commit 544caa0311b999eb412045488acd6b9bf5f6dc56
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 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index 8b32ce686..de37d4fde 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -16,6 +16,8 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <libadwaita-1/adwaita.h>
+
 #include "nautilus-mime-actions.h"
 #include "nautilus-places-view.h"
 
@@ -127,16 +129,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);
+    dialog = adw_message_dialog_new (GTK_WINDOW (window), primary, secondary);
+    adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (dialog),
+                                     "close", _("_Close"));
 
-    g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL);
-    gtk_widget_show (dialog);
+    gtk_window_present (GTK_WINDOW (dialog));
 }
 
 static void


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