logic: code controller communication

- Replaced CodeAccess with LocationAccess.
- Implemented basic functionality for CodeController.
- Added messaging to the project.
- Added QtThreadedFunctor to enable our Messaging thread to invoke calls on the QtThread.
- Added GraphController.

fortune cookie message = Good news from someone dear is coming soon.
This commit is contained in:
malte_langkabel
2014-07-02 16:42:33 +02:00
parent a8e32af5dd
commit 400e2629d2
37 changed files with 441 additions and 78 deletions
@@ -1 +1,39 @@
#include "component/controller/CodeController.h"
#include "component/view/CodeView.h"
#include "data/access/LocationAccess.h"
#include "data/location/TokenLocation.h"
#include "utility/text/TextAccess.h"
#include "utility/logging/logging.h"
CodeController::CodeController(std::shared_ptr<LocationAccess> locationAccess)
: m_locationAccess(locationAccess)
{
}
CodeController::~CodeController()
{
}
void CodeController::setActiveTokenLocationId(Id id)
{
TokenLocation* tokenLocation = m_locationAccess->getTokenLocation(id);
if (tokenLocation)
{
getView()->clearCodeSnippets();
std::shared_ptr<TextAccess> textAccess = TextAccess::createFromFile(tokenLocation->getFilePath());
getView()->addCodeSnippet(textAccess->getText());
}
}
void CodeController::handleMessage(MessageActivateTokenLocation* message)
{
setActiveTokenLocationId(1);
}
CodeView* CodeController::getView()
{
return Controller::getView<CodeView>();
}