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:
@@ -8,6 +8,8 @@
|
||||
|
||||
QtCodeView::QtCodeView(ViewLayout* viewLayout)
|
||||
: CodeView(viewLayout)
|
||||
, m_clearCodeSnippetsFunctor(std::bind(&QtCodeView::doClearCodeSnippets, this))
|
||||
, m_addCodeSnippetFunctor(std::bind(&QtCodeView::doAddCodeSnippet, this, std::placeholders::_1))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -36,6 +38,16 @@ void QtCodeView::initGui()
|
||||
}
|
||||
|
||||
void QtCodeView::addCodeSnippet(std::string str)
|
||||
{
|
||||
m_addCodeSnippetFunctor(str);
|
||||
}
|
||||
|
||||
void QtCodeView::clearCodeSnippets()
|
||||
{
|
||||
m_clearCodeSnippetsFunctor();
|
||||
}
|
||||
|
||||
void QtCodeView::doAddCodeSnippet(std::string str)
|
||||
{
|
||||
std::shared_ptr<Snippet> snippet = std::make_shared<Snippet>();
|
||||
|
||||
@@ -53,7 +65,7 @@ void QtCodeView::addCodeSnippet(std::string str)
|
||||
m_snippets.push_back(snippet);
|
||||
}
|
||||
|
||||
void QtCodeView::clearCodeSnippets()
|
||||
void QtCodeView::doClearCodeSnippets()
|
||||
{
|
||||
m_snippets.clear();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QFont>
|
||||
|
||||
#include "component/view/CodeView.h"
|
||||
#include "qt/utility/QtThreadedFunctor.h"
|
||||
|
||||
class QtHighlighter;
|
||||
class QTextEdit;
|
||||
@@ -33,7 +34,13 @@ private:
|
||||
};
|
||||
std::vector<std::shared_ptr<Snippet>> m_snippets;
|
||||
|
||||
void doAddCodeSnippet(std::string str);
|
||||
void doClearCodeSnippets();
|
||||
|
||||
QFont m_font;
|
||||
|
||||
QtThreadedFunctor<void> m_clearCodeSnippetsFunctor;
|
||||
QtThreadedFunctor<std::string> m_addCodeSnippetFunctor;
|
||||
};
|
||||
|
||||
# endif // QT_CODE_VIEW_H
|
||||
|
||||
Reference in New Issue
Block a user