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

Method saveAs

Qt/Python/pqPythonFileIO.cxx:258–280  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

256
257//-----------------------------------------------------------------------------
258bool pqPythonFileIO::saveAs()
259{
260 pqServer* server = pqApplicationCore::instance()->getActiveServer();
261 auto filenameAndLocation = pqFileDialog::getSaveFileNameAndLocation(server,
262 pqPythonScriptEditor::getUniqueInstance(), tr("Save File As"), this->DefaultSaveDirectory,
263 tr("Python Files") + QString(" (*.py);;"), false, false);
264
265 auto& fileName = filenameAndLocation.first;
266 auto& location = filenameAndLocation.second;
267 if (fileName.isEmpty())
268 {
269 return false;
270 }
271
272 if (!fileName.endsWith(".py"))
273 {
274 fileName.append(".py");
275 }
276
277 pqPythonScriptEditor::bringFront();
278
279 return this->saveBuffer(fileName, location);
280}
281
282//-----------------------------------------------------------------------------
283bool pqPythonFileIO::saveAsMacro()

Callers 1

saveMethod · 0.95

Calls 7

saveBufferMethod · 0.95
instanceFunction · 0.85
trFunction · 0.85
QStringClass · 0.50
getActiveServerMethod · 0.45
isEmptyMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected