-----------------------------------------------------------------------------
| 256 | |
| 257 | //----------------------------------------------------------------------------- |
| 258 | bool 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 | //----------------------------------------------------------------------------- |
| 283 | bool pqPythonFileIO::saveAsMacro() |
no test coverage detected