From beb473b94d0dc6e9d69b80ac7b01bec19e86e3db Mon Sep 17 00:00:00 2001 From: vthriller Date: Sat, 26 Aug 2023 17:08:32 +0300 Subject: [PATCH] Ask before overwriting existing file Closes #1399 --- src/platform/guigtk.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platform/guigtk.cpp b/src/platform/guigtk.cpp index 378d3b49..a05da6ab 100644 --- a/src/platform/guigtk.cpp +++ b/src/platform/guigtk.cpp @@ -1398,6 +1398,9 @@ public: gtkDialog.add_button(isSave ? C_("button", "_Save") : C_("button", "_Open"), Gtk::RESPONSE_OK); gtkDialog.set_default_response(Gtk::RESPONSE_OK); + if(isSave) { + gtkDialog.set_do_overwrite_confirmation(true); + } InitFileChooser(gtkDialog); } @@ -1431,6 +1434,9 @@ public: isSave ? C_("button", "_Save") : C_("button", "_Open"), C_("button", "_Cancel")); + if(isSave) { + gtkNative->set_do_overwrite_confirmation(true); + } // Seriously, GTK?! InitFileChooser(*gtkNative.operator->()); }