1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-01 21:45:38 +00:00

Fix for warnings on close, leaves all views open until a decision is

made
This commit is contained in:
graffy76 2013-03-10 07:49:43 -05:00
parent c17821e6c8
commit ce91ef36ea
4 changed files with 7 additions and 38 deletions

View file

@ -46,8 +46,7 @@ void CSVDoc::View::setupFileMenu()
file->addAction(close);
QAction *exit = new QAction (tr ("&Exit"), this);
connect (exit, SIGNAL (triggered()), this, SLOT (exitApplication()));
connect (this, SIGNAL (closeAllViews(View *)), &mViewManager, SLOT (closeAllViews(View *)));
connect (exit, SIGNAL (triggered()), QApplication::instance(), SLOT (closeAllWindows()));
file->addAction(exit);
}
@ -254,8 +253,3 @@ CSVDoc::Operations *CSVDoc::View::getOperations() const
{
return mOperations;
}
void CSVDoc::View::exitApplication()
{
emit closeAllViews (this);
}

View file

@ -112,8 +112,6 @@ namespace CSVDoc
void addGmstsSubView();
void exitApplication();
};
}

View file

@ -108,16 +108,13 @@ bool CSVDoc::ViewManager::closeRequest (View *view)
CSMDoc::Document *document = view->getDocument();
if (last)
{
//notify user of saving in progress
if ( (document->getState() & CSMDoc::State_Saving) )
continueWithClose = showSaveInProgressMessageBox (iter);
//notify user of saving in progress
if ( (document->getState() & CSMDoc::State_Saving) )
continueWithClose = showSaveInProgressMessageBox (iter);
//notify user of unsaved changes and process response
else if ( document->getState() & CSMDoc::State_Modified)
continueWithClose = showModifiedDocumentMessageBox (iter);
}
//notify user of unsaved changes and process response
else if ( document->getState() & CSMDoc::State_Modified)
continueWithClose = showModifiedDocumentMessageBox (iter);
if (continueWithClose)
{
@ -268,19 +265,3 @@ void CSVDoc::ViewManager::onCloseWarningHandler (int state, CSMDoc::Document *do
}
}
}
void CSVDoc::ViewManager::closeAllViews (View *lastView)
{
//forces document views to close in an orderly manner
// the last view closed is the view from which the "Exit" action was triggered
while (mViews.size() > 1)
{
std::vector<View *>::iterator iter = mViews.begin();
if ((*iter) != lastView)
(*iter)->close();
else (*(++iter))->close();
}
lastView->close();
}

View file

@ -60,10 +60,6 @@ namespace CSVDoc
void closeMessageBox();
public slots:
void closeAllViews (View *lastView);
private slots:
void documentStateChanged (int state, CSMDoc::Document *document);