summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_export_audio.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2015-10-12 13:01:05 +0200
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-21 23:28:44 -0400
commit2c4e79d0a087ab1aafb5aa53ce0e88c3b74220bc (patch)
treef046ede6e4482e8f5c090b0a767dc35978ce70e7 /gtk2_ardour/editor_export_audio.cc
parent5d50abed75de5428c025e61224068387ab15e26d (diff)
Also use overwrite_file_dialog at all the other places.
Diffstat (limited to 'gtk2_ardour/editor_export_audio.cc')
-rw-r--r--gtk2_ardour/editor_export_audio.cc34
1 files changed, 9 insertions, 25 deletions
diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc
index 57baf2ce2d..c886885dd2 100644
--- a/gtk2_ardour/editor_export_audio.cc
+++ b/gtk2_ardour/editor_export_audio.cc
@@ -51,6 +51,7 @@
#include "public_editor.h"
#include "selection.h"
#include "time_axis_view.h"
+#include "utils.h"
#include "i18n.h"
@@ -141,35 +142,18 @@ Editor::export_region ()
string path = dialog.get_path ();
if (Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
+ bool overwrite = ARDOUR_UI_UTILS::overwrite_file_dialog (_("Confirm MIDI File Overwrite"),
+ _("A file with the same name already exists. Do you want to overwrite it?"));
- MessageDialog checker (_("File Exists!"),
- true,
- Gtk::MESSAGE_WARNING,
- Gtk::BUTTONS_NONE);
-
- checker.set_title (_("File Exists!"));
-
- checker.add_button (Stock::CANCEL, RESPONSE_CANCEL);
- checker.add_button (_("Overwrite Existing File"), RESPONSE_ACCEPT);
- checker.set_default_response (RESPONSE_CANCEL);
-
- checker.set_wmclass (X_("midi_export_file_exists"), PROGRAM_NAME);
- checker.set_position (Gtk::WIN_POS_MOUSE);
-
- ret = checker.run ();
-
- switch (ret) {
- case Gtk::RESPONSE_ACCEPT:
- /* force ::g_unlink because the backend code will
- go wrong if it tries to open an existing
- file for writing.
- */
- ::g_unlink (path.c_str());
- break;
- default:
+ if (!overwrite) {
return;
}
+ /* force ::g_unlink because the backend code will
+ go wrong if it tries to open an existing
+ file for writing.
+ */
+ ::g_unlink (path.c_str());
}
(void) midi_region->clone (path);