diff --git a/gui/main.ui b/gui/main.ui
index 72f62b145..728a42c61 100644
--- a/gui/main.ui
+++ b/gui/main.ui
@@ -76,6 +76,7 @@
+
@@ -374,6 +375,14 @@
Log View
+
+
+ false
+
+
+ C&lose Project File
+
+
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index c85aa7da2..d33c1bfc5 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -89,6 +89,7 @@ MainWindow::MainWindow() :
connect(mUI.mActionNewProjectFile, SIGNAL(triggered()), this, SLOT(NewProjectFile()));
connect(mUI.mActionOpenProjectFile, SIGNAL(triggered()), this, SLOT(OpenProjectFile()));
+ connect(mUI.mActionCloseProjectFile, SIGNAL(triggered()), this, SLOT(CloseProjectFile()));
#ifdef WIN32
connect(mUI.mActionHelpContents, SIGNAL(triggered()), this, SLOT(OpenHelpContents()));
@@ -690,6 +691,7 @@ void MainWindow::OpenProjectFile()
if (!filepath.isEmpty())
{
+ mUI.mActionCloseProjectFile->setEnabled(true);
mProject = new Project(filepath, this);
mProject->Open();
QStringList paths = mProject->GetProjectFile()->GetCheckPaths();
@@ -708,12 +710,20 @@ void MainWindow::NewProjectFile()
if (!filepath.isEmpty())
{
+ mUI.mActionCloseProjectFile->setEnabled(true);
Project prj(filepath, this);
prj.Create();
prj.Edit();
}
}
+void MainWindow::CloseProjectFile()
+{
+ delete mProject;
+ mProject = NULL;
+ mUI.mActionCloseProjectFile->setEnabled(false);
+}
+
void MainWindow::ShowLogView()
{
if (mLogView == NULL)
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 26f5c0d64..66f80e087 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -146,6 +146,12 @@ public slots:
*/
void OpenProjectFile();
+ /**
+ * @brief Slot to close open project file.
+ *
+ */
+ void CloseProjectFile();
+
/**
* @brief Slot for showing the log view.
*