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

Method saveOnClose

Qt/Python/pqPythonFileIO.cxx:181–207  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

179
180//-----------------------------------------------------------------------------
181bool 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//-----------------------------------------------------------------------------
210bool pqPythonFileIO::openFile(const QString& filename, vtkTypeUInt32 location)

Callers 2

openFileMethod · 0.95
eventFilterMethod · 0.45

Calls 3

isDirtyMethod · 0.95
saveMethod · 0.95
trFunction · 0.85

Tested by

no test coverage detected