forked from teamnwah/openmw-tes3coop
File->close and File->exit menu items added. Exit uses
closeAllWindows() to ensure ViewManager::closeRequest is called on the last open window. Exit will close all open windows but the last one in cases of active save operation or modified file.
This commit is contained in:
parent
eb90bd71ba
commit
6911868f2a
2 changed files with 10 additions and 2 deletions
|
@ -58,5 +58,7 @@ int CS::Editor::run()
|
|||
{
|
||||
mStartup.show();
|
||||
|
||||
QApplication::setQuitOnLastWindowClosed (true);
|
||||
|
||||
return QApplication::exec();
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
#include <QMenuBar>
|
||||
#include <QMdiArea>
|
||||
#include <QDockWidget>
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#include "../../model/doc/document.hpp"
|
||||
|
||||
|
@ -40,10 +41,15 @@ void CSVDoc::View::setupFileMenu()
|
|||
connect (mSave, SIGNAL (triggered()), this, SLOT (save()));
|
||||
file->addAction (mSave);
|
||||
|
||||
QAction *close = new QAction (tr ("&Close"), this);
|
||||
connect (close, SIGNAL (triggered()), this, SLOT (close()));
|
||||
file->addAction(close);
|
||||
|
||||
QAction *exit = new QAction (tr ("&Exit"), this);
|
||||
connect (exit, SIGNAL (triggered()), this, SLOT (close()));
|
||||
connect (exit, SIGNAL (triggered()), QApplication::instance(), SLOT (closeAllWindows()));
|
||||
file->addAction(exit);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CSVDoc::View::setupEditMenu()
|
||||
|
|
Loading…
Reference in a new issue