Commit 8cbf0510 authored by Simon Depiets's avatar Simon Depiets
Browse files

Add a Close project menu item

BUG:406259
parent d970cdd2
......@@ -548,6 +548,10 @@ void LokalizeMainWindow::setupActions()
action->setText(i18nc("@action:inmenu", "Open project..."));
action->setIcon(QIcon::fromTheme("project-open"));
action = proj->addAction(QStringLiteral("project_close"), this, SLOT(closeProject()));
action->setText(i18nc("@action:inmenu", "Close project"));
action->setIcon(QIcon::fromTheme("project-close"));
m_openRecentProjectAction = new KRecentFilesAction(i18nc("@action:inmenu", "Open recent project"), this);
action = proj->addAction(QStringLiteral("project_open_recent"), m_openRecentProjectAction);
connect(m_openRecentProjectAction, QOverload<const QUrl &>::of(&KRecentFilesAction::urlSelected), this, QOverload<const QUrl &>::of(&LokalizeMainWindow::openProject));
......@@ -586,6 +590,8 @@ bool LokalizeMainWindow::closeProject()
m_mdiArea->removeSubWindow(subwindow);
subwindow->deleteLater();
}
else if (subwindow == m_projectSubWindow && m_projectSubWindow)
static_cast<ProjectTab*>(m_projectSubWindow->widget())->showWelcomeScreen();
}
Project::instance()->load(QString());
//TODO scripts
......
......@@ -21,6 +21,8 @@
<Action name="project_open"/>
<!--<ActionList name="project_actions" />-->
<Action name="project_open_recent"/>
<Action name="project_close"/>
<Separator/>
<Action name="project_create"/>
<Action name="project_create_odf"/>
<Merge/>
......
......@@ -213,6 +213,10 @@ void ProjectTab::showRealProjectOverview()
{
m_stackedLayout->setCurrentIndex(1);
}
void ProjectTab::showWelcomeScreen()
{
m_stackedLayout->setCurrentIndex(0);
}
void ProjectTab::toggleTranslatedFiles()
{
......
......@@ -84,6 +84,7 @@ public slots:
Q_SCRIPTABLE QStringList selectedItems() const;
Q_SCRIPTABLE bool currentItemIsTranslationFile() const;
void showRealProjectOverview();
void showWelcomeScreen();
//Q_SCRIPTABLE bool isShown() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment