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:
graffy76 2013-03-03 15:58:26 -06:00
parent eb90bd71ba
commit 6911868f2a
2 changed files with 10 additions and 2 deletions

View file

@ -58,5 +58,7 @@ int CS::Editor::run()
{
mStartup.show();
QApplication::setQuitOnLastWindowClosed (true);
return QApplication::exec();
}
}

View file

@ -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()