diff options
author | Christopher Davis <christopherdavis@gnome.org> | 2022-12-22 19:23:59 -0600 |
---|---|---|
committer | Christopher Davis <christopherdavis@gnome.org> | 2023-01-04 18:19:00 -0500 |
commit | 9f7e64ece8fe840b557ba044a2743fb56f0835ec (patch) | |
tree | 8dd22bb6cadde6c6c824846306dd58a25263507b | |
parent | b8cb578cc2beab91b8d599d34bea577ab1ab9d28 (diff) | |
download | gnome-logs-wip/cdavis/deprecation-cleanups.tar.gz |
window: Use AdwMessageDialog instead of GtkMessageDialogwip/cdavis/deprecation-cleanups
GtkMessageDialog has been deprecated. GNOME applications should
use AdwMessageDialog instead.
-rw-r--r-- | src/gl-window.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/gl-window.c b/src/gl-window.c index 021248c..dc663cf 100644 --- a/src/gl-window.c +++ b/src/gl-window.c @@ -98,13 +98,6 @@ on_search (GSimpleAction *action, } static void -on_error_dialog_response (GtkDialog *dialog, - gint res) -{ - gtk_window_destroy (GTK_WINDOW (dialog)); -} - -static void on_save_finish (GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -127,12 +120,10 @@ on_save_finish (GObject *source_object, if (error != NULL) { - have_error = TRUE; g_warning ("Error while replacing exported log messages file: %s", error->message); g_clear_error (&error); - g_object_unref (output_file); return; } @@ -177,14 +168,13 @@ on_save_finish (GObject *source_object, if (have_error == TRUE) { - error_dialog = gtk_message_dialog_new (GTK_WINDOW (user_data), - GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_CLOSE, - "%s", + error_dialog = adw_message_dialog_new (GTK_WINDOW (user_data), + _("Export Failed"), _("Unable to export log messages to a file")); - g_signal_connect (error_dialog, "response", G_CALLBACK (on_error_dialog_response), NULL); - gtk_window_present (GTK_WINDOW (error_dialog)); + adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (error_dialog), + "close", _("_Close")); + adw_message_dialog_choose (ADW_MESSAGE_DIALOG (error_dialog), + NULL, NULL, NULL); } g_free (file_content); |