logic: Use ControllerProxy in Bookmarking UI classes instead of messaging

* changed ControllerProxy to template class
* allow passing method pointers and arguments to ControllerProxy
* replaced some messages with ControllerProxy calls
* moved logic from BookmarkView into BookmarkController
This commit is contained in:
Eberhard Graether
2017-10-03 07:59:59 +02:00
parent e604d24c40
commit a72da67d32
33 changed files with 641 additions and 840 deletions
+10 -4
View File
@@ -1,6 +1,8 @@
#ifndef QT_BOOKMARK_VIEW_H
#define QT_BOOKMARK_VIEW_H
#include "component/controller/BookmarkController.h"
#include "component/controller/helper/ControllerProxy.h"
#include "component/view/BookmarkView.h"
#include "qt/utility/QtThreadedFunctor.h"
@@ -25,6 +27,13 @@ public:
virtual void refreshView();
virtual void setCreateButtonState(const CreateButtonState& state);
virtual void displayBookmarkCreator(
const std::vector<std::string>& names, const std::vector<BookmarkCategory>& categories, Id nodeId);
virtual void displayBookmarkEditor(
std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories);
virtual void displayBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
virtual void enableDisplayBookmarks(bool enable);
virtual bool bookmarkBrowserIsVisible() const;
@@ -34,13 +43,10 @@ private slots:
void showBookmarksClicked();
private:
virtual void displayBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
virtual void displayBookmarkCreator(const std::vector<std::string>& names, const std::vector<BookmarkCategory>& categories, Id nodeId);
virtual void displayBookmarkEditor(std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories);
void setStyleSheet();
void refreshStyle();
ControllerProxy<BookmarkController> m_controllerProxy;
QtThreadedLambdaFunctor m_onQtThread;
QFrame* m_widget;