a-fluidsynth: implement LV2_BANKPATCH__notify
[ardour.git] / gtk2_ardour / missing_file_dialog.cc
index bc14b410c8c62ee8f99d2b77fb646dc7df6d87e4..89ef01c372eb6e42d5b4de62219e5480d7452e4c 100644 (file)
@@ -35,6 +35,7 @@ using namespace PBD;
 MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataType type)
        : ArdourDialog (_("Missing File"), true, false)
        , filetype (type)
+       , is_absolute_path (Glib::path_is_absolute (path))
        , chooser (_("Select a folder to search"), FILE_CHOOSER_ACTION_SELECT_FOLDER)
        , use_chosen (_("Add chosen folder to search path, and try again"))
        , choice_group (use_chosen.get_group())
@@ -121,6 +122,12 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT
        chooser.set_create_folders (false);
 }
 
+void
+MissingFileDialog::set_absolute ()
+{
+       _session->set_missing_file_replacement (chooser.get_filename ());
+}
+
 void
 MissingFileDialog::add_chosen ()
 {
@@ -167,7 +174,11 @@ int
 MissingFileDialog::get_action ()
 {
        if (use_chosen.get_active ()) {
-               add_chosen ();
+               if (is_absolute_path) {
+                       set_absolute ();
+               } else {
+                       add_chosen ();
+               }
                return 0;
        }