summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2015-10-12 12:29:16 +0200
committerPaul Davis <paul@linuxaudiosystems.com>2015-10-21 23:28:44 -0400
commit5d50abed75de5428c025e61224068387ab15e26d (patch)
treec1894e776615765c95ef2790f3a8f740a8e4fbda /gtk2_ardour/utils.cc
parent67f557b1f4fd1f1ecd9d38f14d83a12a294cb455 (diff)
Confirmation on overwrite for track and session templates. -fixes #6587
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index a047708360..cf3ca7d7dd 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -53,6 +53,7 @@
#include "rgb_macros.h"
#include "gui_thread.h"
#include "ui_config.h"
+#include "ardour_dialog.h"
using namespace std;
using namespace Gtk;
@@ -926,3 +927,24 @@ ARDOUR_UI_UTILS::windows_overlap (Gtk::Window *a, Gtk::Window *b)
}
return false;
}
+
+bool
+ARDOUR_UI_UTILS::overwrite_file_dialog (string title, string text)
+{
+ ArdourDialog dialog (title, true);
+ Label label (text);
+
+ dialog.get_vbox()->pack_start (label, true, true);
+ dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ dialog.add_button (_("Overwrite"), Gtk::RESPONSE_ACCEPT);
+ dialog.set_position (Gtk::WIN_POS_MOUSE);
+ dialog.show_all ();
+
+ switch (dialog.run()) {
+ case RESPONSE_ACCEPT:
+ return true;
+ case RESPONSE_CANCEL:
+ default:
+ return false;
+ }
+}