[gnome-logs] Port to GtkFileChooserNative



commit 16b7f2ea1bc211488883a51d7fc1f108cdd562cd
Author: Bas De Bue <bas de bue edpnet be>
Date:   Sat Aug 1 17:47:32 2020 +0200

    Port to GtkFileChooserNative

 src/gl-window.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/gl-window.c b/src/gl-window.c
index a81c456..ca8b3ce 100644
--- a/src/gl-window.c
+++ b/src/gl-window.c
@@ -104,24 +104,23 @@ on_export (GSimpleAction *action,
     GlWindowPrivate *priv;
     GlEventViewList *event_list;
     GtkFileChooser *file_chooser;
-    GtkWidget *dialog;
+    GtkFileChooserNative *dialog;
     gint res;
 
     priv = gl_window_get_instance_private (GL_WINDOW (user_data));
     event_list = GL_EVENT_VIEW_LIST (priv->event_list);
 
-    dialog = gtk_file_chooser_dialog_new (_("Save logs"),
+    dialog = gtk_file_chooser_native_new (_("Save logs"),
                                           GTK_WINDOW (user_data),
                                           GTK_FILE_CHOOSER_ACTION_SAVE,
-                                          _("_Cancel"), GTK_RESPONSE_CANCEL,
-                                          _("_Save"), GTK_RESPONSE_ACCEPT,
-                                          NULL);
+                                          _("_Save"),
+                                          _("_Cancel"));
 
     file_chooser = GTK_FILE_CHOOSER (dialog);
     gtk_file_chooser_set_do_overwrite_confirmation (file_chooser, TRUE);
     gtk_file_chooser_set_current_name (file_chooser, _("log messages"));
 
-    res = gtk_dialog_run (GTK_DIALOG (dialog));
+    res = gtk_native_dialog_run (GTK_NATIVE_DIALOG (dialog));
     if (res == GTK_RESPONSE_ACCEPT)
     {
         gboolean have_error = FALSE;
@@ -188,7 +187,7 @@ on_export (GSimpleAction *action,
         g_object_unref (output_file);
     }
 
-    gtk_widget_destroy (dialog);
+    g_object_unref (dialog);
 }
 
 static void


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