-----------------------------------------------------------------------------
| 179 | |
| 180 | //----------------------------------------------------------------------------- |
| 181 | bool pqPythonFileIO::saveOnClose() |
| 182 | { |
| 183 | if (this->isDirty()) |
| 184 | { |
| 185 | switch (pqCoreUtilities::promptUserGeneric(tr("Script Editor"), |
| 186 | tr("The document has been modified.\n Do you want to save your changes?"), |
| 187 | QMessageBox::Warning, QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, |
| 188 | nullptr)) |
| 189 | { |
| 190 | case QMessageBox::Save: |
| 191 | if (this->save()) |
| 192 | { |
| 193 | return true; |
| 194 | } |
| 195 | |
| 196 | return false; |
| 197 | case QMessageBox::Discard: |
| 198 | return true; |
| 199 | break; |
| 200 | case QMessageBox::Cancel: |
| 201 | default: |
| 202 | return false; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return true; |
| 207 | } |
| 208 | |
| 209 | //----------------------------------------------------------------------------- |
| 210 | bool pqPythonFileIO::openFile(const QString& filename, vtkTypeUInt32 location) |
no test coverage detected