diff options
author | David Robillard <d@drobilla.net> | 2007-07-26 16:19:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-07-26 16:19:58 +0000 |
commit | 6af49fb89facc67f369ede8cce6c315fd705d3cc (patch) | |
tree | 2ac10884581eccf828e8ad96f33d619bbff2b0ba /src/libs/gui | |
parent | f7368e7850307de97b024238a4f520afe1150c8b (diff) | |
download | ingen-6af49fb89facc67f369ede8cce6c315fd705d3cc.tar.gz ingen-6af49fb89facc67f369ede8cce6c315fd705d3cc.tar.bz2 ingen-6af49fb89facc67f369ede8cce6c315fd705d3cc.zip |
Fix various Table bugs (and put some way too slow code in there, but hey, it works).
Use PathTable for models on the client side.
Implement renaming on client side.
git-svn-id: http://svn.drobilla.net/lad/ingen@636 a436a847-0d15-0410-975c-d299462d15a1
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; |