MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / CleanPreviousModels

Function CleanPreviousModels

bt_editor/utils.cpp:499–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

497}
498
499void CleanPreviousModels(QWidget *parent,
500 NodeModels &prev_models,
501 const NodeModels &new_models)
502{
503 std::set<const QString *> prev_custom_models;
504
505 if( prev_models.size() > BuiltinNodeModels().size() )
506 {
507 for(const auto& it: prev_models)
508 {
509 if( BuiltinNodeModels().count(it.first) == 0)
510 {
511 prev_custom_models.insert( &it.first );
512 }
513 }
514 }
515
516 for( const auto& name: prev_custom_models)
517 {
518 if( new_models.count( *name ) == 0)
519 {
520 int ret = QMessageBox::question(parent, "Clear Palette?",
521 "Do you want to remove the previously loaded custom nodes?",
522 QMessageBox::No | QMessageBox::Yes );
523 if( ret == QMessageBox::Yes)
524 {
525 prev_models = BuiltinNodeModels();
526 }
527 break;
528 }
529 }
530}
531
532BT::NodeType convert(Serialization::NodeType type)
533{

Callers 2

loadFromXMLMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected