summaryrefslogtreecommitdiffstats
path: root/src/libs/gui/WindowFactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/gui/WindowFactory.cpp')
-rw-r--r--src/libs/gui/WindowFactory.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/libs/gui/WindowFactory.cpp b/src/libs/gui/WindowFactory.cpp
index 096bb9df..caa02390 100644
--- a/src/libs/gui/WindowFactory.cpp
+++ b/src/libs/gui/WindowFactory.cpp
@@ -20,8 +20,9 @@
#include "App.hpp"
#include "PatchWindow.hpp"
#include "GladeFactory.hpp"
-#include "NodePropertiesWindow.hpp"
#include "PatchPropertiesWindow.hpp"
+#include "NodePropertiesWindow.hpp"
+#include "PortPropertiesWindow.hpp"
#include "NodeControlWindow.hpp"
#include "LoadPluginWindow.hpp"
#include "LoadPatchWindow.hpp"
@@ -44,8 +45,9 @@ WindowFactory::WindowFactory()
, _upload_patch_win(NULL)
, _new_subpatch_win(NULL)
, _load_subpatch_win(NULL)
- , _node_properties_win(NULL)
, _patch_properties_win(NULL)
+ , _node_properties_win(NULL)
+ , _port_properties_win(NULL)
{
Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference();
@@ -54,8 +56,9 @@ WindowFactory::WindowFactory()
xml->get_widget_derived("load_remote_patch_win", _load_remote_patch_win);
xml->get_widget_derived("new_subpatch_win", _new_subpatch_win);
xml->get_widget_derived("load_subpatch_win", _load_subpatch_win);
- xml->get_widget_derived("node_properties_win", _node_properties_win);
xml->get_widget_derived("patch_properties_win", _patch_properties_win);
+ xml->get_widget_derived("node_properties_win", _node_properties_win);
+ xml->get_widget_derived("port_properties_win", _port_properties_win);
xml->get_widget_derived("rename_win", _rename_win);
#ifdef HAVE_CURL
@@ -340,24 +343,36 @@ WindowFactory::present_rename(SharedPtr<ObjectModel> object)
void
-WindowFactory::present_properties(SharedPtr<NodeModel> node)
+WindowFactory::present_properties(SharedPtr<ObjectModel> object)
{
- SharedPtr<PatchModel> patch = PtrCast<PatchModel>(node);
+ SharedPtr<PatchModel> patch = PtrCast<PatchModel>(object);
if (patch) {
-
PatchWindowMap::iterator w = _patch_windows.find(patch->path());
if (w != _patch_windows.end())
_patch_properties_win->set_transient_for(*w->second);
_patch_properties_win->present(patch);
+ return;
+ }
- } else {
-
- PatchWindowMap::iterator w = _patch_windows.find(node->parent()->path());
+ SharedPtr<NodeModel> node = PtrCast<NodeModel>(object);
+ if (node) {
+ PatchWindowMap::iterator w = _patch_windows.find(node->path().parent());
if (w != _patch_windows.end())
_node_properties_win->set_transient_for(*w->second);
-
+
_node_properties_win->present(node);
+ return;
+ }
+
+ SharedPtr<PortModel> port = PtrCast<PortModel>(object);
+ if (port) {
+ PatchWindowMap::iterator w = _patch_windows.find(port->path().parent().parent());
+ if (w != _patch_windows.end())
+ _patch_properties_win->set_transient_for(*w->second);
+
+ _port_properties_win->present(port);
+ return;
}
}