MCPcopy Create free account
hub / github.com/MrKepzie/Natron / onGroupScriptNameChanged

Method onGroupScriptNameChanged

Gui/NodeGraph45.cpp:604–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604void
605NodeGraph::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
638void
639NodeGraph::copyNodesAndCreateInGroup(const NodesGuiList& nodes,

Callers

nothing calls this directly

Calls 8

getGuiFunction · 0.85
unregisterTabMethod · 0.80
registerTabMethod · 0.80
getMethod · 0.45
getFullyQualifiedNameMethod · 0.45
getNodeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected