diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-10-23 08:32:39 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-10-23 08:57:46 -0400 |
commit | 6f46e95c754c71dc7051714925bdd312b6b6a62d (patch) | |
tree | d9a4124dea2b23efb05aa89c3418a9fbaaccdc7d /gtk/gtkfilechooserwidget.c | |
parent | 799fb41937950e32cace797c142ac66e290b192b (diff) | |
download | gtk+-deprecate-gtkdialog.tar.gz |
Deprecate GtkDialogdeprecate-gtkdialog
GtkDialog API is archaic and over-complicated.
What is needed for dialogs can typically achieved
more easily by adding buttons directly to a window.
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 08220387d5..7cc85eacf1 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -1166,9 +1166,12 @@ confirm_delete (GtkFileChooserWidget *impl, name); gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), _("If you delete an item, it will be permanently lost.")); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL); gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Delete"), GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); +G_GNUC_END_IGNORE_DEPRECATIONS if (gtk_window_has_group (toplevel)) gtk_window_group_add_window (gtk_window_get_group (toplevel), GTK_WINDOW (dialog)); @@ -2113,7 +2116,9 @@ get_accept_action_widget (GtkDialog *dialog, for (i = 0; i < G_N_ELEMENTS (response); i++) { +G_GNUC_BEGIN_IGNORE_DEPRECATIONS widget = gtk_dialog_get_widget_for_response (dialog, response[i]); +G_GNUC_END_IGNORE_DEPRECATIONS if (widget) { if (!sensitive_only) @@ -4937,7 +4942,9 @@ add_custom_button_to_dialog (GtkDialog *dialog, button = gtk_button_new_with_mnemonic (mnemonic_label); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, response_id); +G_GNUC_END_IGNORE_DEPRECATIONS } /* Every time we request a response explicitly, we need to save the selection to @@ -4991,9 +4998,11 @@ confirm_dialog_should_accept_filename (GtkFileChooserWidget *impl, "overwrite its contents."), folder_display_name); +G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_dialog_add_button (GTK_DIALOG (dialog), _("_Cancel"), GTK_RESPONSE_CANCEL); add_custom_button_to_dialog (GTK_DIALOG (dialog), _("_Replace"), GTK_RESPONSE_ACCEPT); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); +G_GNUC_END_IGNORE_DEPRECATIONS if (gtk_window_has_group (toplevel)) gtk_window_group_add_window (gtk_window_get_group (toplevel), GTK_WINDOW (dialog)); |