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

Method setPersistentMessage

Engine/Node.cpp:7404–7450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7402}
7403
7404void
7405Node::setPersistentMessage(MessageTypeEnum type,
7406 const std::string & content)
7407{
7408 if (!_imp->nodeCreated && _imp->wasCreatedSilently) {
7409 std::cerr << getScriptName_mt_safe() << " message: " << content << std::endl;
7410 return;
7411 }
7412
7413 if ( !appPTR->isBackground() ) {
7414 //if the message is just an information, display a popup instead.
7415#ifdef NATRON_ENABLE_IO_META_NODES
7416 NodePtr ioContainer = getIOContainer();
7417 if (ioContainer) {
7418 ioContainer->setPersistentMessage(type, content);
7419
7420 return;
7421 }
7422#endif
7423 // Some nodes may be hidden from the user but may still report errors (such that the group is in fact hidden to the user)
7424 if ( !isPartOfProject() && getGroup() ) {
7425 NodeGroup* isGroup = dynamic_cast<NodeGroup*>( getGroup().get() );
7426 if (isGroup) {
7427 isGroup->setPersistentMessage(type, content);
7428 }
7429 }
7430
7431 if (type == eMessageTypeInfo) {
7432 message(type, content);
7433
7434 return;
7435 }
7436
7437 {
7438 QMutexLocker k(&_imp->persistentMessageMutex);
7439 QString mess = QString::fromUtf8( content.c_str() );
7440 if (mess == _imp->persistentMessage) {
7441 return;
7442 }
7443 _imp->persistentMessageType = (int)type;
7444 _imp->persistentMessage = mess;
7445 }
7446 Q_EMIT persistentMessageChanged();
7447 } else {
7448 std::cout << "Persistent message: " << content << std::endl;
7449 }
7450}
7451
7452bool
7453Node::hasPersistentMessage() const

Callers 4

checkDecoderCreatedMethod · 0.45
treeRecurseFunctorMethod · 0.45
checkEncoderCreatedMethod · 0.45

Calls 3

messageClass · 0.85
isBackgroundMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected