ui: Improved user experience of error display

* label errors as errors instead of references in file snippet headers
* show number of fatal errors in file snippet headers as well
* only show the first 10 error snippets open, remaining collapsed
* don't show status message after parsing in red on errors
* don't show stats of parsing when project was only loaded
This commit is contained in:
Eberhard Graether
2016-04-13 12:14:55 +02:00
parent 4eef42d15c
commit fcc39f4a77
21 changed files with 159 additions and 53 deletions
+15 -3
View File
@@ -139,14 +139,14 @@ const std::vector<Id>& QtCodeFile::getFocusedTokenIds() const
return m_parent->getFocusedTokenIds();
}
const std::vector<std::string>& QtCodeFile::getErrorMessages() const
std::vector<std::string> QtCodeFile::getErrorMessages() const
{
return m_parent->getErrorMessages();
}
bool QtCodeFile::hasErrors() const
{
return getErrorMessages().size() > 0;
return m_parent->hasErrors();;
}
void QtCodeFile::addCodeSnippet(const CodeSnippetParams& params)
@@ -472,7 +472,19 @@ void QtCodeFile::updateRefCount(int refCount)
{
if (refCount > 0)
{
m_referenceCount->setText(QString::fromStdString(std::to_string(refCount) + (refCount == 1 ? " reference" : " references")));
QString label = hasErrors() ? "error" : "reference";
if (refCount > 1)
{
label += "s";
}
size_t fatalErrorCount = m_parent->getFatalErrorCountForFile(m_filePath);
if (fatalErrorCount > 0)
{
label += " (" + QString::number(fatalErrorCount) + " fatal)";
}
m_referenceCount->setText(QString::number(refCount) + " " + label);
m_referenceCount->show();
}
else