logic: initially parse source on message thread and add more StatusBar messages

This change puts the initial project loading into a MessageLoadProject so that the UI thread is still responding.
Also the StatusBar is now responding to more Messages and it's MessageListeners get added to the MessageQueue in
front of other listeners so that the StatusBar UI can announce actions.
This commit is contained in:
Eberhard Graether
2014-12-02 01:20:08 +01:00
parent c54c405dd1
commit 3f4ae8343c
15 changed files with 118 additions and 34 deletions
@@ -3,8 +3,13 @@
#include "component/view/StatusBarView.h"
StatusBarController::StatusBarController()
: MessageListener<MessageError>(true)
, MessageListener<MessageFinishedParsing>(true)
, MessageListener<MessageLoadProject>(true)
, MessageListener<MessageLoadSource>(true)
, MessageListener<MessageRefresh>(true)
, MessageListener<MessageStatus>(true)
{
}
StatusBarController::~StatusBarController()
@@ -28,12 +33,28 @@ void StatusBarController::handleMessage(MessageStatus* message)
void StatusBarController::handleMessage(MessageError* message)
{
setStatus(message->error, true);
setStatus(message->error, true);
}
void StatusBarController::handleMessage(MessageLoadProject* message)
{
setStatus("Loading Project: " + message->projectSettingsFilePath);
}
void StatusBarController::handleMessage(MessageLoadSource* message)
{
setStatus("Loading Source: " + message->sourceDirectoryPath);
}
void StatusBarController::handleMessage(MessageRefresh* message)
{
setStatus("Refreshing Project");
}
void StatusBarController::setStatus(const std::string& status, bool isError)
{
if(!status.empty())
getView()->showMessage(status, isError);
if (!status.empty())
{
getView()->showMessage(status, isError);
}
}