summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-21 04:32:06 +0000
committerDavid Robillard <d@drobilla.net>2007-09-21 04:32:06 +0000
commitc4eeee858baf6675e9d0c5ef175dbe89f951745e (patch)
treeabeb1e5df7c167ecc68e3c743d0b826431013326 /src/libs
parenta1e97211b02cc1cd9509617cd3452d731ad7b512 (diff)
downloadingen-c4eeee858baf6675e9d0c5ef175dbe89f951745e.tar.gz
ingen-c4eeee858baf6675e9d0c5ef175dbe89f951745e.tar.bz2
ingen-c4eeee858baf6675e9d0c5ef175dbe89f951745e.zip
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
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/client/PortModel.hpp2
-rw-r--r--src/libs/gui/NodeModule.cpp9
-rw-r--r--src/libs/gui/NodeModule.hpp2
-rw-r--r--src/libs/gui/PatchPortModule.cpp2
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<PatchCanvas> canvas, SharedPtr<NodeMode
Glib::RefPtr<Gnome::Glade::Xml> 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));
@@ -152,14 +153,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)
{
if (key == "ingenuity:canvas-x" && value.type() == Atom::FLOAT)
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<NodeModel> 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<PatchCanvas> canvas, SharedPtr<PortMod
ret->_patch_port = boost::shared_ptr<Port>(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);