1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-02 00:45:32 +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); file->addAction(close);
QAction *exit = new QAction (tr ("&Exit"), this); QAction *exit = new QAction (tr ("&Exit"), this);
connect (exit, SIGNAL (triggered()), this, SLOT (exitApplication())); connect (exit, SIGNAL (triggered()), QApplication::instance(), SLOT (closeAllWindows()));
connect (this, SIGNAL (closeAllViews(View *)), &mViewManager, SLOT (closeAllViews(View *)));
file->addAction(exit); file->addAction(exit);
} }
@ -254,8 +253,3 @@ CSVDoc::Operations *CSVDoc::View::getOperations() const
{ {
return mOperations; return mOperations;
} }
void CSVDoc::View::exitApplication()
{
emit closeAllViews (this);
}

View file

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

View file

@ -108,16 +108,13 @@ bool CSVDoc::ViewManager::closeRequest (View *view)
CSMDoc::Document *document = view->getDocument(); CSMDoc::Document *document = view->getDocument();
if (last) //notify user of saving in progress
{ if ( (document->getState() & CSMDoc::State_Saving) )
//notify user of saving in progress continueWithClose = showSaveInProgressMessageBox (iter);
if ( (document->getState() & CSMDoc::State_Saving) )
continueWithClose = showSaveInProgressMessageBox (iter);
//notify user of unsaved changes and process response //notify user of unsaved changes and process response
else if ( document->getState() & CSMDoc::State_Modified) else if ( document->getState() & CSMDoc::State_Modified)
continueWithClose = showModifiedDocumentMessageBox (iter); continueWithClose = showModifiedDocumentMessageBox (iter);
}
if (continueWithClose) 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(); void closeMessageBox();
public slots:
void closeAllViews (View *lastView);
private slots: private slots:
void documentStateChanged (int state, CSMDoc::Document *document); void documentStateChanged (int state, CSMDoc::Document *document);