| 602 | } |
| 603 | |
| 604 | void |
| 605 | NodeGraph::onGroupScriptNameChanged(const QString& /*name*/) |
| 606 | { |
| 607 | assert( qApp && qApp->thread() == QThread::currentThread() ); |
| 608 | |
| 609 | boost::shared_ptr<NodeCollection> group = getGroup(); |
| 610 | if (!group) { |
| 611 | return; |
| 612 | } |
| 613 | NodeGroup* isGrp = dynamic_cast<NodeGroup*>( group.get() ); |
| 614 | if (!isGrp) { |
| 615 | return; |
| 616 | } |
| 617 | std::string newName = isGrp->getNode()->getFullyQualifiedName(); |
| 618 | for (std::size_t i = 0; i < newName.size(); ++i) { |
| 619 | if (newName[i] == '.') { |
| 620 | newName[i] = '_'; |
| 621 | } |
| 622 | } |
| 623 | std::string oldName = getScriptName(); |
| 624 | for (std::size_t i = 0; i < oldName.size(); ++i) { |
| 625 | if (oldName[i] == '.') { |
| 626 | oldName[i] = '_'; |
| 627 | } |
| 628 | } |
| 629 | getGui()->unregisterTab(this); |
| 630 | setScriptName(newName); |
| 631 | getGui()->registerTab(this, this); |
| 632 | TabWidget* parent = dynamic_cast<TabWidget*>( parentWidget() ); |
| 633 | if (parent) { |
| 634 | parent->onTabScriptNameChanged(this, oldName, newName); |
| 635 | } |
| 636 | } |
| 637 | |
| 638 | void |
| 639 | NodeGraph::copyNodesAndCreateInGroup(const NodesGuiList& nodes, |
nothing calls this directly
no test coverage detected