From f04418376c952be6b927a56a6dddf613ad6c83bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Sat, 28 Jul 2018 10:01:02 +0200 Subject: [PATCH] add overwrite confirmation to file dialogs --- layer-selector.c | 2 ++ main-window.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/layer-selector.c b/layer-selector.c index 6eb9e1a..19ae71b 100644 --- a/layer-selector.c +++ b/layer-selector.c @@ -399,6 +399,8 @@ static void save_mapping_clicked(GtkWidget *button, gpointer user_data) dialog = gtk_file_chooser_dialog_new("Save Mapping File", GTK_WINDOW(user_data), GTK_FILE_CHOOSER_ACTION_SAVE, "Cancel", GTK_RESPONSE_CANCEL, "Save Mapping", GTK_RESPONSE_ACCEPT, NULL); + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE); + res = gtk_dialog_run(GTK_DIALOG(dialog)); if (res == GTK_RESPONSE_ACCEPT) { file_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); diff --git a/main-window.c b/main-window.c index fabc19f..931bac9 100644 --- a/main-window.c +++ b/main-window.c @@ -260,6 +260,8 @@ static void on_convert_clicked(gpointer button, gpointer user) } gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); + gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(dialog), TRUE); + res = gtk_dialog_run(GTK_DIALOG(dialog)); if (res == GTK_RESPONSE_ACCEPT) { file_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));