GUI: Add menuitem to close open project file.
This commit is contained in:
parent
c98d398398
commit
ab1aaf9a45
|
@ -76,6 +76,7 @@
|
|||
<addaction name="mActionOpenXML"/>
|
||||
<addaction name="mActionNewProjectFile"/>
|
||||
<addaction name="mActionOpenProjectFile"/>
|
||||
<addaction name="mActionCloseProjectFile"/>
|
||||
<addaction name="mActionSave"/>
|
||||
<addaction name="mActionQuit"/>
|
||||
</widget>
|
||||
|
@ -374,6 +375,14 @@
|
|||
<string>Log View</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="mActionCloseProjectFile">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>C&lose Project File</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -146,6 +146,12 @@ public slots:
|
|||
*/
|
||||
void OpenProjectFile();
|
||||
|
||||
/**
|
||||
* @brief Slot to close open project file.
|
||||
*
|
||||
*/
|
||||
void CloseProjectFile();
|
||||
|
||||
/**
|
||||
* @brief Slot for showing the log view.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue