diff options
Diffstat (limited to 'src/libs/gui')
-rw-r--r-- | src/libs/gui/PatchPortModule.cpp | 21 | ||||
-rw-r--r-- | src/libs/gui/PatchPortModule.hpp | 1 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index ec083c1b..b23ac5c7 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -129,10 +129,29 @@ PatchPortModule::set_variable(const string& key, const Atom& value) void PatchPortModule::set_property(const string& key, const Atom& value) { - if (key == "ingen:polyphonic" && value.type() == Atom::BOOL) + if (key == "ingen:polyphonic" && value.type() == Atom::BOOL) { set_stacked_border(value.get_bool()); + } else if (key == "ingen:selected" && value.type() == Atom::BOOL) { + if (value.get_bool() != selected()) { + if (value.get_bool()) + _canvas.lock()->select_item(shared_from_this()); + else + _canvas.lock()->unselect_item(shared_from_this()); + } + } +} + + +void +PatchPortModule::set_selected(bool b) +{ + if (b != selected()) { + Module::set_selected(b); + App::instance().engine()->set_property(_port->path(), "ingen:selected", b); + } } + } // namespace GUI } // namespace Ingen diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp index bdf9c6d5..d6715834 100644 --- a/src/libs/gui/PatchPortModule.hpp +++ b/src/libs/gui/PatchPortModule.hpp @@ -62,6 +62,7 @@ protected: PatchPortModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortModel> port); void create_menu(); + void set_selected(bool b); void set_variable(const std::string& predicate, const Raul::Atom& value); void set_property(const std::string& predicate, const Raul::Atom& value); |