logic: code controller

- Renamed MessageActivateTokenLocation to MessageActivateToken, since it uses the Token id (not the TokenLocation id).
- Implemented CodeController to add one snippet for each location where the activated token occurred.
- Added Semaphore to QtThreadedFunctor to prevent an evil race-condition.
- CodeView dispatches message when a token is clicked.
This commit is contained in:
malte_langkabel
2014-07-03 16:03:06 +02:00
parent 4c7bbbe28e
commit 4ae6f4a04a
17 changed files with 183 additions and 44 deletions
+3 -1
View File
@@ -8,6 +8,7 @@
#include "qt/QtWidgetWrapper.h"
#include "qt/utility/QtHighLighter.h"
#include "qt/utility/utilityQt.h"
#include "utility/messaging/type/MessageActivateToken.h"
QtCodeView::QtCodeView(ViewLayout* viewLayout)
: CodeView(viewLayout)
@@ -52,7 +53,8 @@ void QtCodeView::clearCodeSnippets()
void QtCodeView::activateToken(Id tokenId) const
{
std::cout << "TODO: activate Token: " << tokenId << std::endl;
MessageActivateToken message(tokenId);
message.dispatch();
}
void QtCodeView::doAddCodeSnippet(const std::string& str, const TokenLocationFile& locationFile, int startLineNumber)