MCPcopy Create free account
hub / github.com/Kitware/ParaView / updateEnableState

Method updateEnableState

Qt/ApplicationComponents/pqReloadFilesReaction.cxx:76–105  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

74
75//-----------------------------------------------------------------------------
76void pqReloadFilesReaction::updateEnableState()
77{
78 std::vector<vtkSMSourceProxy*> sources;
79 if (this->ReloadMode == ReloadModes::ActiveSource)
80 {
81 pqPipelineSource* source = pqActiveObjects::instance().activeSource();
82 sources.push_back(source ? vtkSMSourceProxy::SafeDownCast(source->getProxy()) : nullptr);
83 }
84 else // ReloadMode == ReloadModes::AllSources
85 {
86 pqServerManagerModel* smmodel = pqApplicationCore::instance()->getServerManagerModel();
87 QList<pqPipelineSource*> allSources = smmodel->findItems<pqPipelineSource*>();
88 for (int cc = 0; cc < allSources.size(); cc++)
89 {
90 sources.push_back(vtkSMSourceProxy::SafeDownCast(allSources[cc]->getProxy()));
91 }
92 }
93
94 bool enabled = false;
95 vtkNew<vtkSMReaderReloadHelper> helper;
96 for (const auto& source : sources)
97 {
98 if (helper->SupportsReload(source))
99 {
100 enabled = true;
101 break;
102 }
103 }
104 this->parentAction()->setEnabled(enabled);
105}
106
107//-----------------------------------------------------------------------------
108bool pqReloadFilesReaction::reload()

Callers 1

pqReloadFilesReactionMethod · 0.95

Calls 7

instanceFunction · 0.85
activeSourceMethod · 0.80
push_backMethod · 0.80
SupportsReloadMethod · 0.80
getProxyMethod · 0.45
sizeMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected