mirror of
https://github.com/lucaspalomodevelop/meshlab.git
synced 2026-03-20 11:26:11 +00:00
Closing confirmation for modified files
This commit is contained in:
parent
8355ad28e6
commit
96aaf00fd3
@ -24,6 +24,9 @@
|
||||
History
|
||||
|
||||
$Log$
|
||||
Revision 1.89 2006/02/01 11:49:12 glvertex
|
||||
Closing confirmation for modified files
|
||||
|
||||
Revision 1.88 2006/01/31 17:04:44 alemochi
|
||||
Changed fancy lighting (use two lights instead of double lighting)
|
||||
|
||||
@ -532,12 +535,28 @@ Trackball::Button QT2VCG(Qt::MouseButton qtbt, Qt::KeyboardModifiers modifiers)
|
||||
|
||||
void GLArea::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
// TODO: if modified ask if want to save
|
||||
if(mm)
|
||||
if(isWindowModified())
|
||||
{
|
||||
delete mm;
|
||||
mm = NULL;
|
||||
if(QMessageBox::question(
|
||||
this,
|
||||
tr("Exiting..."),
|
||||
tr("File %1 modified.\n\n"
|
||||
"Are you sure you want to close it without saving?")
|
||||
.arg(fileName),
|
||||
QMessageBox::Yes|QMessageBox::Default,
|
||||
QMessageBox::No|QMessageBox::Escape,
|
||||
QMessageBox::NoButton) == QMessageBox::Yes)
|
||||
{
|
||||
if(mm){ delete mm;mm = NULL;} // quit without saving
|
||||
event->accept();
|
||||
}
|
||||
else
|
||||
event->ignore(); // don't quit please!
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(mm){ delete mm;mm = NULL;} // delete mesh anyway
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user