Commit 9398822e authored by T.J. Corona's avatar T.J. Corona

NewResourceBehavior: update File->New() when operations are changed

parent d80f5749
......@@ -168,6 +168,21 @@ pqSMTKNewResourceBehavior::pqSMTKNewResourceBehavior(QObject* parent)
pqActiveObjects* activeObjects = &pqActiveObjects::instance();
QObject::connect(
activeObjects, SIGNAL(serverChanged(pqServer*)), this, SLOT(updateNewMenu()));
pqServer* server = pqActiveObjects::instance().activeServer();
pqSMTKWrapper* wrapper = pqSMTKBehavior::instance()->resourceManagerForServer(server);
if (wrapper != nullptr)
{
wrapper->smtkOperationManager()->groupObservers().insert(
[this](const smtk::operation::Operation::Index&, const std::string& groupName, bool) {
if (groupName == smtk::operation::CreatorGroup::type_name)
{
this->updateNewMenu();
}
});
// Access the creator group.
auto creatorGroup = smtk::operation::CreatorGroup(wrapper->smtkOperationManager());
}
}
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment