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
@@ -12,10 +12,11 @@ class MessageFinishedParsing
: public Message<MessageFinishedParsing>
{
public:
MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime)
MessageFinishedParsing(size_t fileCount, size_t totalFileCount, float parseTime, bool loadedOnly = false)
: fileCount(fileCount)
, totalFileCount(totalFileCount)
, parseTime(parseTime)
, loadedOnly(loadedOnly)
{
}
@@ -31,6 +32,11 @@ public:
std::string getStatusStr() const
{
if (loadedOnly)
{
return "Finished loading";
}
std::stringstream ss;
ss << "Finished analysis: ";
ss << fileCount << "/" << totalFileCount << " files; ";
@@ -41,6 +47,8 @@ public:
int minutes = int(secondsLeft / 60);
secondsLeft -= minutes * 60;
int seconds = int(secondsLeft);
secondsLeft -= seconds;
int milliSeconds = secondsLeft * 1000;
if (hours > 9)
{
@@ -51,7 +59,12 @@ public:
ss << std::setw(2) << std::setfill('0') << hours;
}
ss << ":" << std::setw(2) << std::setfill('0') << minutes;
ss << ":" << std::setw(2) << std::setfill('0') << seconds << ". ";
ss << ":" << std::setw(2) << std::setfill('0') << seconds;
if (!hours && !minutes)
{
ss << ":" << std::setw(3) << std::setfill('0') << milliSeconds;
}
return ss.str();
}
@@ -64,6 +77,7 @@ public:
size_t fileCount;
size_t totalFileCount;
float parseTime;
bool loadedOnly;
};
#endif // MESSAGE_FINISHED_PARSING_H