unsaved dialog has a better behaviour

This commit is contained in:
Paolo Cignoni cignoni 2008-01-10 17:16:44 +00:00
parent 40a4e92407
commit c058c63bdd
2 changed files with 16 additions and 16 deletions

View File

@ -24,6 +24,9 @@
History
$Log$
Revision 1.139 2008/01/10 17:15:16 cignoni
unsaved dialog has a better behaviour
Revision 1.138 2008/01/04 18:23:24 cignoni
Corrected a wrong type (glwidget instead of glarea) in the decoration callback.
@ -552,25 +555,19 @@ void GLArea::closeEvent(QCloseEvent *event)
bool close = true;
if(isWindowModified())
{
if(QMessageBox::question(
this,
tr("MeshLab"),
tr("File %1 modified.\n\n"
"Continue without saving?")
.arg(getFileName()),
QMessageBox::Yes|QMessageBox::Default,
QMessageBox::No|QMessageBox::Escape,
QMessageBox::NoButton) == QMessageBox::No)
QMessageBox::StandardButton ret=QMessageBox::question(
this, tr("MeshLab"), tr("File '%1' modified.\n\nClose without saving?").arg(getFileName()),
QMessageBox::Yes|QMessageBox::No,
QMessageBox::No);
if(ret==QMessageBox::No)
{
close = false; // don't close please!
event->ignore();
return;
}
}
if(getEditAction()) endEdit();
event->ignore();
if(close)
{
event->accept();
}
if(getEditAction()) endEdit();
event->accept();
}
void GLArea::keyReleaseEvent ( QKeyEvent * e )

View File

@ -24,6 +24,9 @@
History
$Log$
Revision 1.23 2008/01/10 17:16:44 cignoni
unsaved dialog has a better behaviour
Revision 1.22 2007/12/11 23:56:40 cignoni
better resizing of dialogs
@ -195,7 +198,7 @@ void MeshlabStdDialog::loadFrameContent()
QLabel *ql;
QGridLayout *gridLayout = new QGridLayout(qf);
setLayout(gridLayout);
qf->setLayout(gridLayout);
setWindowTitle(curmfi->filterName(curAction));
ql = new QLabel("<i>"+curmfi->filterInfo(curAction)+"</i>",qf);