CMakePM: Add issue icon and tooltip description on project failure

If a project fails to load it will be displayed with a warning icon.

If the CMake configuration fails and the backup configuration is
restored, the project is also marked with a warning icon.

Change-Id: I95ccc5d171f5b789fe317fbb1da9e13dcd81a5dd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-09-21 22:22:37 +02:00
parent 519c2f3109
commit 3922b1a917
6 changed files with 66 additions and 15 deletions

View File

@@ -26,8 +26,8 @@
#include "cmakeproject.h"
#include "cmakebuildconfiguration.h"
#include "cmakebuildsystem.h"
#include "cmakebuildstep.h"
#include "cmakebuildsystem.h"
#include "cmakekitinformation.h"
#include "cmakeprojectconstants.h"
#include "cmakeprojectimporter.h"
@@ -75,6 +75,8 @@ Tasks CMakeProject::projectIssues(const Kit *k) const
if (ToolChainKitAspect::toolChains(k).isEmpty())
result.append(createProjectTask(Task::TaskType::Warning, tr("No compilers set in kit.")));
result.append(m_issues);
return result;
}
@@ -86,6 +88,16 @@ ProjectImporter *CMakeProject::projectImporter() const
return m_projectImporter;
}
void CMakeProject::addIssue(IssueType type, const QString &text)
{
m_issues.append(createProjectTask(type, text));
}
void CMakeProject::clearIssues()
{
m_issues.clear();
}
bool CMakeProject::setupTarget(Target *t)
{
t->updateDefaultBuildConfigurations();