summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/PortMenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/gui/PortMenu.cpp')
-rw-r--r--src/libs/gui/PortMenu.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libs/gui/PortMenu.cpp b/src/libs/gui/PortMenu.cpp
index 8bb002c9..45b216b6 100644
--- a/src/libs/gui/PortMenu.cpp
+++ b/src/libs/gui/PortMenu.cpp
@@ -30,14 +30,16 @@ namespace GUI {
PortMenu::PortMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
: ObjectMenu(cobject, xml)
+ , _patch_port(NULL)
{
}
void
-PortMenu::init(SharedPtr<PortModel> port)
+PortMenu::init(SharedPtr<PortModel> port, bool patch_port)
{
ObjectMenu::init(port);
+ _patch_port = patch_port;
if ( ! PtrCast<PatchModel>(port->parent()) ) {
_polyphonic_menuitem->set_sensitive(false);
@@ -48,6 +50,19 @@ PortMenu::init(SharedPtr<PortModel> port)
_enable_signal = true;
}
+
+void
+PortMenu::on_menu_disconnect()
+{
+ if (_patch_port) {
+ App::instance().engine()->disconnect_all(
+ _object->parent()->path(), _object->path());
+ } else {
+ App::instance().engine()->disconnect_all(
+ _object->parent()->path().parent(), _object->path());
+ }
+}
+
} // namespace GUI
} // namespace Ingen