forked from qt-creator/qt-creator
Kit: Display warning and error icons
Display warning and error icons in the kit options page. This is more consistent with what we do elsewhere. Change-Id: I31786054da3ad8c55931156f0124740eea2d68d3 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -87,6 +87,7 @@ public:
|
||||
m_id(id),
|
||||
m_autodetected(false),
|
||||
m_isValid(true),
|
||||
m_hasWarning(false),
|
||||
m_nestedBlockingLevel(0),
|
||||
m_mustNotify(false)
|
||||
{
|
||||
@@ -98,6 +99,7 @@ public:
|
||||
Id m_id;
|
||||
bool m_autodetected;
|
||||
bool m_isValid;
|
||||
bool m_hasWarning;
|
||||
QIcon m_icon;
|
||||
QString m_iconPath;
|
||||
int m_nestedBlockingLevel;
|
||||
@@ -176,16 +178,24 @@ bool Kit::isValid() const
|
||||
return d->m_id.isValid() && d->m_isValid;
|
||||
}
|
||||
|
||||
bool Kit::hasWarning() const
|
||||
{
|
||||
return d->m_hasWarning;
|
||||
}
|
||||
|
||||
QList<Task> Kit::validate() const
|
||||
{
|
||||
QList<Task> result;
|
||||
QList<KitInformation *> infoList = KitManager::instance()->kitInformation();
|
||||
d->m_isValid = true;
|
||||
d->m_hasWarning = false;
|
||||
foreach (KitInformation *i, infoList) {
|
||||
QList<Task> tmp = i->validate(this);
|
||||
foreach (const Task &t, tmp) {
|
||||
if (t.type == Task::Error)
|
||||
d->m_isValid = false;
|
||||
if (t.type == Task::Warning)
|
||||
d->m_hasWarning = true;
|
||||
}
|
||||
result.append(tmp);
|
||||
}
|
||||
@@ -411,7 +421,7 @@ QString Kit::toHtml()
|
||||
str << "<h3>" << displayName() << "</h3>";
|
||||
str << "<table>";
|
||||
|
||||
if (!isValid()) {
|
||||
if (!isValid() || hasWarning()) {
|
||||
QList<Task> issues = validate();
|
||||
str << "<p>";
|
||||
foreach (const Task &t, issues) {
|
||||
|
||||
Reference in New Issue
Block a user