-----------------------------------------------------------------------------
| 281 | |
| 282 | //----------------------------------------------------------------------------- |
| 283 | bool pqPythonFileIO::saveAsMacro() |
| 284 | { |
| 285 | const QString userMacroDir = pqPythonScriptEditor::getMacrosDir(); |
| 286 | const QDir existCheck(userMacroDir); |
| 287 | if (!existCheck.exists() && !existCheck.mkpath(userMacroDir)) |
| 288 | { |
| 289 | QMessageBox::warning(nullptr, tr("Sorry!"), |
| 290 | qPrintable(tr("Could not create user Macro directory: %1.").arg(userMacroDir))); |
| 291 | return false; |
| 292 | } |
| 293 | |
| 294 | const QString filename = |
| 295 | pqFileDialog::getSaveFileName(nullptr, pqPythonScriptEditor::getUniqueInstance(), |
| 296 | tr("Save As Macro"), userMacroDir, tr("Python Files") + QString(" (*.py);;")); |
| 297 | |
| 298 | pqPythonScriptEditor::bringFront(); |
| 299 | |
| 300 | if (this->saveBuffer(filename, vtkPVSession::CLIENT)) |
| 301 | { |
| 302 | pqPythonScriptEditor::updateMacroList(); |
| 303 | return true; |
| 304 | } |
| 305 | |
| 306 | return false; |
| 307 | } |
| 308 | |
| 309 | //----------------------------------------------------------------------------- |
| 310 | bool pqPythonFileIO::saveAsScript() |
nothing calls this directly
no test coverage detected