diff options
Diffstat (limited to 'src/progs/ingenuity/PatchTreeWindow.cpp')
-rw-r--r-- | src/progs/ingenuity/PatchTreeWindow.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/progs/ingenuity/PatchTreeWindow.cpp b/src/progs/ingenuity/PatchTreeWindow.cpp index 47bfc485..0f8c947a 100644 --- a/src/progs/ingenuity/PatchTreeWindow.cpp +++ b/src/progs/ingenuity/PatchTreeWindow.cpp @@ -20,6 +20,7 @@ #include "PatchTreeWindow.h" #include "PatchController.h" #include "PatchWindow.h" +#include "Store.h" #include "SubpatchModule.h" #include "PatchModel.h" #include "util/Path.h" @@ -64,6 +65,22 @@ PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, void +PatchTreeWindow::init(Store& store) +{ + store.new_object_sig.connect(sigc::mem_fun(this, &PatchTreeWindow::new_object)); +} + + +void +PatchTreeWindow::new_object(CountedPtr<ObjectModel> object) +{ + CountedPtr<PatchModel> patch = object; + if (patch && dynamic_cast<PatchController*>(patch->controller())) + add_patch(dynamic_cast<PatchController*>(patch->controller())); +} + + +void PatchTreeWindow::add_patch(PatchController* pc) { const CountedPtr<PatchModel> pm = pc->patch_model(); |