ui: bookmarks

can now bookmark tokens
This commit is contained in:
wrongway88
2017-02-12 15:06:07 +01:00
parent e1d2c3a4e0
commit 97fd40fe9b
84 changed files with 5024 additions and 65 deletions
+80
View File
@@ -0,0 +1,80 @@
#include "qt/view/QtBookmarkView.h"
#include "qt/window/QtBookmarkBrowser.h"
#include "qt/utility/utilityQt.h"
#include "utility/ResourcePaths.h"
#include "component/controller/RefreshController.h"
#include "qt/view/QtViewWidgetWrapper.h"
#include "settings/ColorScheme.h"
QtBookmarkView::QtBookmarkView(ViewLayout* viewLayout)
: BookmarkView(viewLayout)
, m_refreshViewFunctor(std::bind(&QtBookmarkView::doRefreshView, this))
{
m_widget = new QtBookmarkBar();
setStyleSheet();
}
QtBookmarkView::~QtBookmarkView()
{
}
void QtBookmarkView::createWidgetWrapper()
{
setWidgetWrapper(std::make_shared<QtViewWidgetWrapper>(m_widget));
}
void QtBookmarkView::initView()
{
}
void QtBookmarkView::refreshView()
{
m_refreshViewFunctor();
}
void QtBookmarkView::setCreateButtonState(const CreateButtonState& state)
{
m_widget->setCreateButtonState(state);
}
void QtBookmarkView::enableDisplayBookmarks(bool enable)
{
m_widget->enableDisplayButton(enable);
}
bool QtBookmarkView::bookmarkBrowserIsVisible() const
{
return m_widget->bookmarkBrowserIsVisible();
}
void QtBookmarkView::doRefreshView()
{
setStyleSheet();
m_widget->refreshStyle();
}
void QtBookmarkView::setStyleSheet()
{
m_widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "bookmark_view/bookmark_view.css").c_str());
}
void QtBookmarkView::displayBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks)
{
m_widget->displayBookmarks(bookmarks);
}
void QtBookmarkView::displayBookmarkCreator(const std::vector<std::string>& names, const std::vector<BookmarkCategory>& categories)
{
m_widget->displayBookmarkCreator(names, categories);
}
void QtBookmarkView::displayBookmarkEditor(std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories)
{
m_widget->displayBookmarkEditor(bookmark, categories);
}
+40
View File
@@ -0,0 +1,40 @@
#ifndef QT_BOOKMARK_VIEW_H
#define QT_BOOKMARK_VIEW_H
#include "component/view/BookmarkView.h"
#include "qt/element/QtBookmarkBar.h"
#include "qt/utility/QtThreadedFunctor.h"
class QtBookmarkView
: public BookmarkView
{
public:
QtBookmarkView(ViewLayout* viewLayout);
virtual ~QtBookmarkView();
// View implementation
virtual void createWidgetWrapper();
virtual void initView();
virtual void refreshView();
virtual void setCreateButtonState(const CreateButtonState& state);
virtual void enableDisplayBookmarks(bool enable);
virtual bool bookmarkBrowserIsVisible() const;
private:
void doRefreshView();
void setStyleSheet();
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);
virtual void displayBookmarkEditor(std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories);
QtThreadedFunctor<> m_refreshViewFunctor;
QtBookmarkBar* m_widget;
};
#endif // QT_BOOKMARK_VIEW_H
+5
View File
@@ -45,6 +45,11 @@ void QtStatusBarView::setErrorCount(ErrorCountInfo errorCount)
m_setErrorCountFunctor(errorCount);
}
void QtStatusBarView::showIdeStatus(const std::string& message)
{
m_widget->setIdeStatus(message);
}
void QtStatusBarView::doShowMessage(const std::string& message, bool isError, bool showLoader)
{
m_widget->setText(message, isError, showLoader);
+2
View File
@@ -25,6 +25,8 @@ public:
virtual void showMessage(const std::string& message, bool isError, bool showLoader);
virtual void setErrorCount(ErrorCountInfo errorCount);
virtual void showIdeStatus(const std::string& message);
private:
void doShowMessage(const std::string& message, bool isError, bool showLoader);
void doSetErrorCount(ErrorCountInfo errorCount);
+6
View File
@@ -1,6 +1,7 @@
#include "qt/view/QtViewFactory.h"
#include "component/view/GraphViewStyle.h"
#include "qt/view/QtBookmarkView.h"
#include "qt/view/QtCodeView.h"
#include "qt/view/QtCompositeView.h"
#include "qt/view/QtDialogView.h"
@@ -46,6 +47,11 @@ std::shared_ptr<TabbedView> QtViewFactory::createTabbedView(ViewLayout* viewLayo
return ptr;
}
std::shared_ptr<BookmarkView> QtViewFactory::createBookmarkView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtBookmarkView>(viewLayout);
}
std::shared_ptr<CodeView> QtViewFactory::createCodeView(ViewLayout* viewLayout) const
{
return View::createInitAndAddToLayout<QtCodeView>(viewLayout);
+1
View File
@@ -14,6 +14,7 @@ public:
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name) const;
virtual std::shared_ptr<TabbedView> createTabbedView(ViewLayout* viewLayout, const std::string& name) const;
virtual std::shared_ptr<BookmarkView> createBookmarkView(ViewLayout* viewLayout) const;
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
virtual std::shared_ptr<ErrorView> createErrorView(ViewLayout* viewLayout) const;
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;