ui: add menu entry to close the current project (issue #722)
This commit is contained in:
committed by
Eberhard Graether
parent
dc24bae943
commit
6b692ff0e9
@@ -39,6 +39,7 @@
|
||||
#include "MessageBookmarkActivate.h"
|
||||
#include "MessageBookmarkBrowse.h"
|
||||
#include "MessageBookmarkCreate.h"
|
||||
#include "MessageCloseProject.h"
|
||||
#include "MessageCodeReference.h"
|
||||
#include "MessageCustomTrailShow.h"
|
||||
#include "MessageFind.h"
|
||||
@@ -712,7 +713,7 @@ void QtMainWindow::openProject()
|
||||
|
||||
void QtMainWindow::editProject()
|
||||
{
|
||||
Project* currentProject = Application::getInstance()->getCurrentProject().get();
|
||||
std::shared_ptr<const Project> currentProject = Application::getInstance()->getCurrentProject();
|
||||
if (currentProject)
|
||||
{
|
||||
QtProjectWizard* wizard = createWindow<QtProjectWizard>();
|
||||
@@ -721,6 +722,15 @@ void QtMainWindow::editProject()
|
||||
}
|
||||
}
|
||||
|
||||
void QtMainWindow::closeProject()
|
||||
{
|
||||
if (Application::getInstance()->getCurrentProject())
|
||||
{
|
||||
MessageCloseProject().dispatch();
|
||||
showStartScreen();
|
||||
}
|
||||
}
|
||||
|
||||
void QtMainWindow::find()
|
||||
{
|
||||
MessageFind().dispatch();
|
||||
@@ -932,6 +942,7 @@ void QtMainWindow::setupProjectMenu()
|
||||
menu->addAction(tr("&Edit Project..."), this, &QtMainWindow::editProject);
|
||||
menu->addSeparator();
|
||||
|
||||
menu->addAction(tr("Close Project"), this, &QtMainWindow::closeProject);
|
||||
menu->addAction(tr("E&xit"), QCoreApplication::instance(), &QCoreApplication::quit, QKeySequence::Quit);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user