From 2f991988c6b3d91652461fe70447e343fb3aa916 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 4 Oct 2007 01:28:27 +0000 Subject: Fixed port menu (load fancy dynamic menu from Glade). Renaming of JACK ports. git-svn-id: http://svn.drobilla.net/lad/ingen@820 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/NodeMenu.hpp | 3 ++- src/libs/gui/NodeModule.cpp | 2 +- src/libs/gui/PatchPortModule.cpp | 14 +++++++++++++- src/libs/gui/PatchPortModule.hpp | 7 +++++-- src/libs/gui/Port.cpp | 5 +++++ src/libs/gui/PortMenu.hpp | 9 +++++---- 6 files changed, 31 insertions(+), 9 deletions(-) (limited to 'src/libs/gui') diff --git a/src/libs/gui/NodeMenu.hpp b/src/libs/gui/NodeMenu.hpp index f0d30f4c..715cf6b9 100644 --- a/src/libs/gui/NodeMenu.hpp +++ b/src/libs/gui/NodeMenu.hpp @@ -35,7 +35,8 @@ class NodeControlWindow; class NodePropertiesWindow; class PatchCanvas; -/** Controller for a Node. + +/** Menu for a Node. * * \ingroup GUI */ diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index d3bb9de3..ed05c859 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -208,7 +208,7 @@ void NodeModule::gui_size_request(Gtk::Requisition* r) { if (r->width + 4 > _width) - set_width(r->width + 4); + set_minimum_width(r->width + 4); _gui_item->property_width() = _width - 4; _gui_item->property_height() = r->height; diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index 863fc55e..f686079d 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "PatchPortModule.hpp" #include +#include "PatchPortModule.hpp" #include "interface/EngineInterface.hpp" #include "client/PatchModel.hpp" #include "client/NodeModel.hpp" @@ -27,6 +27,7 @@ #include "RenameWindow.hpp" #include "PatchWindow.hpp" #include "WindowFactory.hpp" +#include "PortMenu.hpp" namespace Ingen { namespace GUI { @@ -84,6 +85,17 @@ PatchPortModule::create(boost::shared_ptr canvas, SharedPtr xml = GladeFactory::new_glade_reference(); + xml->get_widget_derived("object_menu", _menu); + _menu->init(_port); + + set_menu(_menu); +} + + void PatchPortModule::store_location() { diff --git a/src/libs/gui/PatchPortModule.hpp b/src/libs/gui/PatchPortModule.hpp index 7a420a44..8f3a3fc6 100644 --- a/src/libs/gui/PatchPortModule.hpp +++ b/src/libs/gui/PatchPortModule.hpp @@ -38,6 +38,7 @@ namespace GUI { class PatchCanvas; class Port; +class PortMenu; /** A "module" to represent a patch's port on it's own canvas. @@ -62,9 +63,11 @@ protected: PatchPortModule(boost::shared_ptr canvas, SharedPtr port); void metadata_update(const string& key, const Raul::Atom& value); + void create_menu(); - SharedPtr _port; - boost::shared_ptr _patch_port; ///< Port on this 'anonymous' module + SharedPtr _port; + PortMenu* _menu; + SharedPtr _patch_port; ///< Port on this 'anonymous' module }; diff --git a/src/libs/gui/Port.cpp b/src/libs/gui/Port.cpp index 228e4598..ccd9652c 100644 --- a/src/libs/gui/Port.cpp +++ b/src/libs/gui/Port.cpp @@ -18,6 +18,7 @@ #include #include #include "interface/EngineInterface.hpp" +#include "flowcanvas/Module.hpp" #include "client/PatchModel.hpp" #include "client/PortModel.hpp" #include "client/ControlModel.hpp" @@ -44,6 +45,9 @@ Port::Port(boost::shared_ptr module, SharedPtr pm { assert(module); assert(_port_model); + + delete _menu; + _menu = NULL; _port_model->signal_renamed.connect(sigc::mem_fun(this, &Port::renamed)); @@ -83,6 +87,7 @@ void Port::renamed() { set_name(_port_model->path().name()); + module().lock()->resize(); } diff --git a/src/libs/gui/PortMenu.hpp b/src/libs/gui/PortMenu.hpp index aa520ebc..e1079f0d 100644 --- a/src/libs/gui/PortMenu.hpp +++ b/src/libs/gui/PortMenu.hpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef NODEMENU_H -#define NODEMENU_H +#ifndef PORTMENU_H +#define PORTMENU_H #include #include @@ -35,7 +35,8 @@ class PortControlWindow; class PortPropertiesWindow; class PatchCanvas; -/** Controller for a Port. + +/** Menu for a Port. * * \ingroup GUI */ @@ -51,4 +52,4 @@ public: } // namespace GUI } // namespace Ingen -#endif // NODEMENU_H +#endif // PORTMENU_H -- cgit v1.2.1