ui: display fatal errors
* added ErrorCountInfo to incorporate reporting of fatal errors during code analysis.
This commit is contained in:
@@ -65,12 +65,12 @@ void CodeController::handleMessage(MessageActivateAll* message)
|
||||
ss << "\t" + std::to_string(stats.nodeCount) + " symbols\n";
|
||||
ss << "\t" + std::to_string(stats.edgeCount) + " relations\n";
|
||||
ss << "\n";
|
||||
ss << "\t" + std::to_string(stats.errorCount) + " errors\n";
|
||||
ss << "\t" + std::to_string(stats.errorCount.total) + " errors (" + std::to_string(stats.errorCount.fatal) + " fatal)\n";
|
||||
ss << "\n";
|
||||
|
||||
if (stats.errorCount > 0)
|
||||
if (stats.errorCount.total > 0)
|
||||
{
|
||||
ss << "\tWarning: The analysis may be incomplete as long as it yields errors.\n";
|
||||
ss << "\tWarning: The analysis may be incomplete as long as it yields fatal errors.\n";
|
||||
ss << "\tTry resolving them and refresh the project.\n";
|
||||
ss << "\n";
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ StatusBarView* StatusBarController::getView()
|
||||
|
||||
void StatusBarController::handleMessage(MessageClearErrorCount* message)
|
||||
{
|
||||
getView()->setErrorCount(0);
|
||||
getView()->setErrorCount(ErrorCountInfo());
|
||||
}
|
||||
|
||||
void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||
@@ -29,7 +29,7 @@ void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||
|
||||
void StatusBarController::handleMessage(MessageShowErrors* message)
|
||||
{
|
||||
if (message->errorCount >= 0)
|
||||
if (message->errorCount.total >= 0)
|
||||
{
|
||||
getView()->setErrorCount(message->errorCount);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ std::shared_ptr<MessageActivateTokens> ActivationTranslator::translateMessage(co
|
||||
else if (match.searchType == SearchMatch::SEARCH_COMMAND &&
|
||||
match.getFullName() == SearchMatch::getCommandName(SearchMatch::COMMAND_ERROR))
|
||||
{
|
||||
MessageShowErrors msg(-1);
|
||||
MessageShowErrors msg(ErrorCountInfo(-1, 0));
|
||||
msg.undoRedoType = message->undoRedoType;
|
||||
msg.dispatchImmediately();
|
||||
return nullptr;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define STATUS_BAR_VIEW_H
|
||||
|
||||
#include "component/view/View.h"
|
||||
#include "data/ErrorCountInfo.h"
|
||||
|
||||
class StatusBarController;
|
||||
|
||||
@@ -13,7 +14,7 @@ public:
|
||||
|
||||
virtual std::string getName() const;
|
||||
virtual void showMessage(const std::string& message, bool isError, bool showLoader) = 0;
|
||||
virtual void setErrorCount(size_t count) = 0;
|
||||
virtual void setErrorCount(ErrorCountInfo errorCount) = 0;
|
||||
|
||||
protected:
|
||||
StatusBarController* getController();
|
||||
|
||||
Reference in New Issue
Block a user