summaryrefslogtreecommitdiffstats
path: root/src/gui/PatchBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/PatchBox.cpp')
-rw-r--r--src/gui/PatchBox.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp
index 61f2fb9f..11921fa6 100644
--- a/src/gui/PatchBox.cpp
+++ b/src/gui/PatchBox.cpp
@@ -198,7 +198,16 @@ PatchBox::init_box(App& app)
void
PatchBox::set_patch_from_path(const Raul::Path& path, SharedPtr<PatchView> view)
{
- std::cerr << "FIXME: Set patch from path" << std::endl;
+ if (view) {
+ assert(view->patch()->path() == path);
+ _app->window_factory()->present_patch(view->patch(), _window, view);
+ } else {
+ SharedPtr<const PatchModel> model = PtrCast<const PatchModel>(
+ _app->store()->object(path));
+ if (model) {
+ _app->window_factory()->present_patch(model, _window);
+ }
+ }
}
/** Sets the patch for this box and initializes everything.