From c4eeee858baf6675e9d0c5ef175dbe89f951745e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Sep 2007 04:32:06 +0000 Subject: Show context menu for patch ports when clicking on anonymous module, as well as actual port. git-svn-id: http://svn.drobilla.net/lad/ingen@746 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PortModel.hpp | 2 +- src/libs/gui/NodeModule.cpp | 9 +-------- src/libs/gui/NodeModule.hpp | 2 -- src/libs/gui/PatchPortModule.cpp | 2 ++ 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libs/client/PortModel.hpp b/src/libs/client/PortModel.hpp index a75c5bcf..6b49310b 100644 --- a/src/libs/client/PortModel.hpp +++ b/src/libs/client/PortModel.hpp @@ -74,7 +74,7 @@ private: friend class Store; PortModel(const Path& path, const string& type, Direction dir) - : ObjectModel(path, false), + : ObjectModel(path, true), _type(type), _direction(dir), _current_val(0.0f), diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index fb2fbdab..e1839f37 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -44,6 +44,7 @@ NodeModule::NodeModule(boost::shared_ptr canvas, SharedPtr xml = GladeFactory::new_glade_reference(); xml->get_widget_derived("object_menu", _menu); _menu->init(node); + set_menu(_menu); node->signal_new_port.connect(sigc::bind(sigc::mem_fun(this, &NodeModule::add_port), true)); node->signal_removed_port.connect(sigc::mem_fun(this, &NodeModule::remove_port)); @@ -151,14 +152,6 @@ NodeModule::store_location() } -void -NodeModule::on_click(GdkEventButton* event) -{ - if (event->button == 3) - _menu->popup(event->button, event->time); -} - - void NodeModule::set_metadata(const string& key, const Atom& value) { diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index 58040989..e34b289f 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -61,8 +61,6 @@ public: virtual void store_location(); - void on_click(GdkEventButton* event); - void show_control_window(); SharedPtr node() const { return _node; } diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index f52785a4..863fc55e 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -72,6 +72,8 @@ PatchPortModule::create(boost::shared_ptr canvas, SharedPtr_patch_port = boost::shared_ptr(new Port(ret, port, true)); ret->add_port(ret->_patch_port); + + ret->set_menu(ret->_patch_port->menu()); for (MetadataMap::const_iterator m = port->metadata().begin(); m != port->metadata().end(); ++m) ret->metadata_update(m->first, m->second); -- cgit v1.2.1