diff options
Diffstat (limited to 'src/libs/gui')
-rw-r--r-- | src/libs/gui/NodeModule.cpp | 8 | ||||
-rw-r--r-- | src/libs/gui/NodeModule.hpp | 2 | ||||
-rw-r--r-- | src/libs/gui/PatchPortModule.cpp | 1 | ||||
-rw-r--r-- | src/libs/gui/RenameWindow.cpp | 4 |
4 files changed, 14 insertions, 1 deletions
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp index 3c319344..cf4f1409 100644 --- a/src/libs/gui/NodeModule.cpp +++ b/src/libs/gui/NodeModule.cpp @@ -51,6 +51,7 @@ NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeMode node->metadata_update_sig.connect(sigc::mem_fun(this, &NodeModule::metadata_update)); signal_clicked.connect(sigc::mem_fun(this, &NodeModule::on_click)); + node->renamed_sig.connect(sigc::mem_fun(this, &NodeModule::renamed)); } @@ -89,6 +90,13 @@ NodeModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeModel> n void +NodeModule::renamed() +{ + set_name(_node->path().name()); +} + + +void NodeModule::add_port(SharedPtr<PortModel> port, bool resize_to_fit) { Module::add_port(boost::shared_ptr<Port>(new Port( diff --git a/src/libs/gui/NodeModule.hpp b/src/libs/gui/NodeModule.hpp index b68d1143..b554a64c 100644 --- a/src/libs/gui/NodeModule.hpp +++ b/src/libs/gui/NodeModule.hpp @@ -79,6 +79,8 @@ protected: void add_port(SharedPtr<PortModel> port, bool resize=true); void remove_port(SharedPtr<PortModel> port); + void renamed(); + SharedPtr<NodeModel> _node; NodeMenu _menu; }; diff --git a/src/libs/gui/PatchPortModule.cpp b/src/libs/gui/PatchPortModule.cpp index bf63e9b6..15ce9ac4 100644 --- a/src/libs/gui/PatchPortModule.cpp +++ b/src/libs/gui/PatchPortModule.cpp @@ -76,6 +76,7 @@ PatchPortModule::create(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<PortMod sigc::bind( sigc::mem_fun(App::instance().window_factory(), &WindowFactory::present_rename), port))); + ret->add_port(ret->_patch_port); for (MetadataMap::const_iterator m = port->metadata().begin(); m != port->metadata().end(); ++m) diff --git a/src/libs/gui/RenameWindow.cpp b/src/libs/gui/RenameWindow.cpp index 04ffdd9f..6567799e 100644 --- a/src/libs/gui/RenameWindow.cpp +++ b/src/libs/gui/RenameWindow.cpp @@ -71,7 +71,9 @@ RenameWindow::name_changed() if (name.find("/") != string::npos) { _message_label->set_text("Name may not contain '/'"); _ok_button->property_sensitive() = false; - //} else if (_object->parent()->patch_model()->get_node(name) != NULL) { + } else if (!Path::is_valid_name(name)) { + _message_label->set_text("Name contains invalid characters"); + _ok_button->property_sensitive() = false; } else if (App::instance().store()->object(_object->parent()->path().base() + name)) { _message_label->set_text("An object already exists with that name."); _ok_button->property_sensitive() = false; |