diff options
author | Logan Rathbone <poprocks@gmail.com> | 2023-01-25 17:07:35 +0000 |
---|---|---|
committer | Logan Rathbone <poprocks@gmail.com> | 2023-01-25 17:07:35 +0000 |
commit | a0c55e36136eb4469156f57877829ea39c016cbb (patch) | |
tree | 16764729f29839281597dc7d8ab332cfc81bcd4b /src/fileselection.c | |
parent | 7e3cf22aba795935154c25e65e6fe8bc2895f05c (diff) | |
parent | 008c677ec2546cf9c3c267d9f1df0d248b41c630 (diff) | |
download | zenity-a0c55e36136eb4469156f57877829ea39c016cbb.tar.gz |
zenity4: Port to libadwaita/AdwMessageDialog
See merge request GNOME/zenity!22
Diffstat (limited to 'src/fileselection.c')
-rw-r--r-- | src/fileselection.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/fileselection.c b/src/fileselection.c index e495f76..cf6a481 100644 --- a/src/fileselection.c +++ b/src/fileselection.c @@ -4,7 +4,7 @@ * fileselection.c * * Copyright © 2002 Sun Microsystems, Inc. - * Copyright © 2021 Logan Rathbone + * Copyright © 2021-2023 Logan Rathbone * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,10 +31,13 @@ #include <config.h> +/* TODO: port to GtkFileDialog. + */ +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + static ZenityData *zen_data; -static void zenity_fileselection_dialog_response (GtkDialog *dialog, - int response, gpointer data); +static void zenity_fileselection_dialog_response (GtkWidget *widget, int response, gpointer data); void zenity_fileselection (ZenityData *data, ZenityFileData *file_data) @@ -63,8 +66,7 @@ zenity_fileselection (ZenityData *data, ZenityFileData *file_data) if (data->extra_label) g_warning ("Cannot add extra labels to GtkFileChooserNative"); - g_signal_connect (dialog, "response", - G_CALLBACK(zenity_fileselection_dialog_response), file_data); + g_signal_connect (dialog, "response", G_CALLBACK(zenity_fileselection_dialog_response), file_data); if (file_data->uri) { @@ -179,11 +181,10 @@ zenity_fileselection_dialog_output (GtkFileChooser *chooser, } static void -zenity_fileselection_dialog_response (GtkDialog *dialog, - int response, gpointer data) +zenity_fileselection_dialog_response (GtkWidget *widget, int response, gpointer data) { ZenityFileData *file_data = data; - GtkFileChooser *chooser = GTK_FILE_CHOOSER (dialog); + GtkFileChooser *chooser = GTK_FILE_CHOOSER (widget); switch (response) { @@ -192,7 +193,7 @@ zenity_fileselection_dialog_response (GtkDialog *dialog, zenity_util_exit_code_with_data (ZENITY_OK, zen_data); break; - case GTK_RESPONSE_CANCEL: + case GTK_RESPONSE_REJECT: zen_data->exit_code = zenity_util_return_exit_code (ZENITY_CANCEL); break; @@ -209,5 +210,7 @@ zenity_fileselection_dialog_response (GtkDialog *dialog, zen_data->exit_code = zenity_util_return_exit_code (ZENITY_ESC); break; } - zenity_util_gapp_quit (NULL); + zenity_util_gapp_quit (NULL, zen_data); } + +G_GNUC_END_IGNORE_DEPRECATIONS |