diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-22 10:38:43 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-22 10:51:13 +0100 |
commit | 8e1c68eb63f1a1fd757e4d284e65efbc30e25986 (patch) | |
tree | ea7b5060bd53eb81645ebf75fbff5fb7883b3525 | |
parent | cdc8807728ff57ba3df56aa5a9e00255f9e81b0b (diff) |
GUI support to re-locate missing external (abs-path) files
-rw-r--r-- | gtk2_ardour/missing_file_dialog.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/missing_file_dialog.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gtk2_ardour/missing_file_dialog.cc b/gtk2_ardour/missing_file_dialog.cc index bc14b410c8..89ef01c372 100644 --- a/gtk2_ardour/missing_file_dialog.cc +++ b/gtk2_ardour/missing_file_dialog.cc @@ -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()) @@ -122,6 +123,12 @@ MissingFileDialog::MissingFileDialog (Session* s, const std::string& path, DataT } void +MissingFileDialog::set_absolute () +{ + _session->set_missing_file_replacement (chooser.get_filename ()); +} + +void MissingFileDialog::add_chosen () { string str; @@ -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; } diff --git a/gtk2_ardour/missing_file_dialog.h b/gtk2_ardour/missing_file_dialog.h index b4b44e746b..85ea1310cc 100644 --- a/gtk2_ardour/missing_file_dialog.h +++ b/gtk2_ardour/missing_file_dialog.h @@ -42,6 +42,7 @@ public: private: ARDOUR::DataType filetype; + bool is_absolute_path; Gtk::FileChooserButton chooser; Gtk::RadioButton use_chosen; @@ -53,6 +54,7 @@ private: Gtk::Label msg; void add_chosen (); + void set_absolute (); }; #endif /* __gtk_ardour_missing_file_dialog_h__ */ |