Commit 9e7adadc authored by Tobias Hunger's avatar Tobias Hunger

Qbs: Fix updateContextActions

Take parsing state into account.

Change-Id: I8b6d7b1d1fc7b9fb61a22cf251ff171a0c3dde1f
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 8f471eda
......@@ -236,17 +236,19 @@ void QbsProjectManagerPlugin::nodeSelectionChanged(Node *node, Project *project)
void QbsProjectManagerPlugin::updateContextActions()
{
bool isBuilding = BuildManager::isBuilding(m_selectedProject);
bool isEnabled = !BuildManager::isBuilding(m_selectedProject)
&& m_selectedProject && !m_selectedProject->isParsing()
&& m_selectedNode && m_selectedNode->isEnabled();
bool isFile = m_selectedProject && m_selectedNode && (m_selectedNode->nodeType() == ProjectExplorer::FileNodeType);
bool isProduct = m_selectedProject && m_selectedNode && qobject_cast<QbsProductNode *>(m_selectedNode->projectNode());
QbsProjectNode *subproject = qobject_cast<QbsProjectNode *>(m_selectedNode);
bool isSubproject = m_selectedProject && subproject && subproject != m_selectedProject->rootProjectNode();
bool isFileEnabled = isFile && m_selectedNode->isEnabled();
m_reparseQbsCtx->setEnabled(!isBuilding && m_selectedProject && !m_selectedProject->isParsing());
m_buildFileCtx->setEnabled(isFileEnabled);
m_buildProductCtx->setVisible(isProduct);
m_buildSubprojectCtx->setVisible(isSubproject);
m_reparseQbsCtx->setEnabled(isEnabled);
m_buildFileCtx->setEnabled(isEnabled && isFile);
m_buildProductCtx->setVisible(isEnabled && isProduct);
m_buildSubprojectCtx->setVisible(isEnabled && isSubproject);
}
void QbsProjectManagerPlugin::updateReparseQbsAction()
......
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