summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 3c0e5b91fa..a14018e014 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -102,6 +102,7 @@ typedef uint64_t microseconds_t;
#include "window_proxy.h"
#include "global_port_matrix.h"
#include "location_ui.h"
+#include "missing_file_dialog.h"
#include "i18n.h"
@@ -264,6 +265,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
ARDOUR::Session::Quit.connect (forever_connections, MISSING_INVALIDATOR, ui_bind (&ARDOUR_UI::finish, this), gui_context ());
+ /* handle requests to deal with missing files */
+
+ ARDOUR::Session::MissingFile.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::missing_file, this, _1, _2, _3));
+
/* lets get this party started */
try {
@@ -3689,3 +3694,26 @@ ARDOUR_UI::remove_window_proxy (WindowProxyBase* p)
{
_window_proxies.remove (p);
}
+
+int
+ARDOUR_UI::missing_file (Session*s, std::string str, DataType type)
+{
+ MissingFileDialog dialog (s, str, type);
+
+ dialog.show ();
+ dialog.present ();
+
+ int result = dialog.run ();
+ dialog.hide ();
+
+ switch (result) {
+ case RESPONSE_OK:
+ break;
+ default:
+ return 1; // quit entire session load
+ }
+
+ result = dialog.get_action ();
+
+ return result;
+}