Fixed triggering confirmation messages boxes when more than one view is

open.
This commit is contained in:
graffy76 2013-03-02 21:34:55 -06:00
parent bf6c855e6d
commit eb90bd71ba

View file

@ -62,9 +62,7 @@ CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document)
this, SLOT (progress (int, int, int, int, CSMDoc::Document *))); this, SLOT (progress (int, int, int, int, CSMDoc::Document *)));
} }
// QMainWindow *mainWindow = new QMainWindow; View *view = new View (*this, document, countViews (document)+1);
View *view = new View (*this, document, countViews (document)+1); //, mainWindow);
mViews.push_back (view); mViews.push_back (view);
@ -104,18 +102,21 @@ bool CSVDoc::ViewManager::closeRequest (View *view)
CSMDoc::Document *document = view->getDocument(); CSMDoc::Document *document = view->getDocument();
//notify user of saving in progress if (last)
if ( document->getState() & CSMDoc::State_Saving ) {
continueWithClose = showSaveInProgressMessageBox (view); //notify user of saving in progress
else if ( (document->getState() & CSMDoc::State_Saving) )
//notify user of unsaved changes and process response continueWithClose = showSaveInProgressMessageBox (view);
if ( document->getState() & CSMDoc::State_Modified) else
continueWithClose = showModifiedDocumentMessageBox (view); //notify user of unsaved changes and process response
if ( document->getState() & CSMDoc::State_Modified)
continueWithClose = showModifiedDocumentMessageBox (view);
}
mViews.erase (iter);
if (continueWithClose) if (continueWithClose)
{ {
mViews.erase (iter);
if (last) if (last)
mDocumentManager.removeDocument (document); mDocumentManager.removeDocument (document);
else else