-----------------------------------------------------------------------------
| 74 | |
| 75 | //----------------------------------------------------------------------------- |
| 76 | void 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 | //----------------------------------------------------------------------------- |
| 108 | bool pqReloadFilesReaction::reload() |
no test coverage detected