commit: 92578a663bbb9a931a1771cd25922915cd014849
parent: 95138deae3a523bf10b59ec13b6e5b4b0a1456a6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Sat, 7 Dec 2019 11:50:42 +0100
Move from GtkFileChooserDialog to GtkFileChooserNative
Diffstat:
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/badwolf.c b/badwolf.c
@@ -445,28 +445,22 @@ downloadCb_decide_destination(WebKitDownload *download,
gint chooser_response;
GtkWindow *parent_window = GTK_WINDOW(browser->window->main_window);
- GtkWidget *file_dialog = gtk_file_chooser_dialog_new(NULL,
- parent_window,
- GTK_FILE_CHOOSER_ACTION_SAVE,
- _("_Cancel"),
- GTK_RESPONSE_CANCEL,
- _("_Save"),
- GTK_RESPONSE_ACCEPT,
- NULL);
+ GtkFileChooserNative *file_dialog =
+ gtk_file_chooser_native_new(NULL, parent_window, GTK_FILE_CHOOSER_ACTION_SAVE, NULL, NULL);
GtkFileChooser *file_chooser = GTK_FILE_CHOOSER(file_dialog);
gtk_file_chooser_set_current_name(file_chooser, suggested_filename);
gtk_file_chooser_set_do_overwrite_confirmation(file_chooser, TRUE);
webkit_download_set_allow_overwrite(download, TRUE);
- chooser_response = gtk_dialog_run(GTK_DIALOG(file_dialog));
+ chooser_response = gtk_native_dialog_run(GTK_NATIVE_DIALOG(file_dialog));
if(chooser_response == GTK_RESPONSE_ACCEPT)
webkit_download_set_destination(download, gtk_file_chooser_get_uri(file_chooser));
else
webkit_download_cancel(download);
- gtk_widget_destroy(file_dialog);
+ g_object_unref(file_dialog);
return FALSE; /* Let it propagate */
}