ui: statusbar
statusbar added, listen to status- , error- and parsingfinishedmessages
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
#include "header.h"
|
||||||
|
|
||||||
|
void test(int i, int b)
|
||||||
|
{
|
||||||
|
|
||||||
|
int x;
|
||||||
|
|
||||||
|
A instanceOfA('v');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<config>
|
||||||
|
<source>
|
||||||
|
<SourcePath>data/src</SourcePath>
|
||||||
|
</source>
|
||||||
|
</config>
|
||||||
@@ -19,6 +19,8 @@ add_files(
|
|||||||
qt/element/QtSearchBar.h
|
qt/element/QtSearchBar.h
|
||||||
qt/element/QtSmartSearchBox.cpp
|
qt/element/QtSmartSearchBox.cpp
|
||||||
qt/element/QtSmartSearchBox.h
|
qt/element/QtSmartSearchBox.h
|
||||||
|
qt/element/QtStatusBar.cpp
|
||||||
|
qt/element/QtStatusBar.h
|
||||||
|
|
||||||
qt/graphics/QtGraphicsRoundedRectItem.cpp
|
qt/graphics/QtGraphicsRoundedRectItem.cpp
|
||||||
qt/graphics/QtGraphicsRoundedRectItem.h
|
qt/graphics/QtGraphicsRoundedRectItem.h
|
||||||
@@ -52,6 +54,8 @@ add_files(
|
|||||||
qt/view/QtMainView.h
|
qt/view/QtMainView.h
|
||||||
qt/view/QtSearchView.cpp
|
qt/view/QtSearchView.cpp
|
||||||
qt/view/QtSearchView.h
|
qt/view/QtSearchView.h
|
||||||
|
qt/view/QtStatusBarView.cpp
|
||||||
|
qt/view/QtStatusBarView.h
|
||||||
qt/view/QtViewFactory.cpp
|
qt/view/QtViewFactory.cpp
|
||||||
qt/view/QtViewFactory.h
|
qt/view/QtViewFactory.h
|
||||||
qt/view/QtViewWidgetWrapper.cpp
|
qt/view/QtViewWidgetWrapper.cpp
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ QtMainWindow::QtMainWindow()
|
|||||||
{
|
{
|
||||||
setObjectName("QtMainWindow");
|
setObjectName("QtMainWindow");
|
||||||
setCentralWidget(nullptr);
|
setCentralWidget(nullptr);
|
||||||
|
setDockNestingEnabled(true);
|
||||||
|
|
||||||
setupProjectMenu();
|
setupProjectMenu();
|
||||||
setupViewMenu();
|
setupViewMenu();
|
||||||
@@ -73,8 +74,8 @@ void QtMainWindow::openProject(const QString &path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QtMainWindow::saveProject()
|
void QtMainWindow::saveProject()
|
||||||
{
|
{
|
||||||
MessageSaveProject("").dispatch();
|
MessageSaveProject("").dispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtMainWindow::saveAsProject()
|
void QtMainWindow::saveAsProject()
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#include "qt/element/QtStatusBar.h"
|
||||||
|
|
||||||
|
QtStatusBar::QtStatusBar()
|
||||||
|
: m_text(this)
|
||||||
|
{
|
||||||
|
m_text.setText("hallo test test");
|
||||||
|
addWidget(&m_text);
|
||||||
|
}
|
||||||
|
|
||||||
|
QtStatusBar::~QtStatusBar()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBar::setText(const std::string& text, bool isError)
|
||||||
|
{
|
||||||
|
if (isError)
|
||||||
|
{
|
||||||
|
m_text.setStyleSheet("QLabel { color: red }");
|
||||||
|
}
|
||||||
|
m_text.setText(text.c_str());
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef QT_STATUS_BAR_H
|
||||||
|
#define QT_STATUS_BAR_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <QStatusBar>
|
||||||
|
#include <QProgressBar>
|
||||||
|
#include <QLabel>
|
||||||
|
|
||||||
|
class QtStatusBar : public QStatusBar
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QtStatusBar(void);
|
||||||
|
~QtStatusBar(void);
|
||||||
|
|
||||||
|
void setText(const std::string& text, bool isError = false);
|
||||||
|
private:
|
||||||
|
QLabel m_text;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !QT_STATUS_BAR_H
|
||||||
@@ -51,3 +51,13 @@ void QtMainView::saveLayout()
|
|||||||
{
|
{
|
||||||
m_window->saveLayout();
|
m_window->saveLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStatusBar* QtMainView::getStatusBar()
|
||||||
|
{
|
||||||
|
return m_window->statusBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtMainView::setStatusBar(QStatusBar* statusbar)
|
||||||
|
{
|
||||||
|
m_window->setStatusBar(statusbar);
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <QStatusBar>
|
||||||
#include "component/view/MainView.h"
|
#include "component/view/MainView.h"
|
||||||
|
|
||||||
class QtMainWindow;
|
class QtMainWindow;
|
||||||
@@ -25,6 +26,9 @@ public:
|
|||||||
virtual void loadLayout();
|
virtual void loadLayout();
|
||||||
virtual void saveLayout();
|
virtual void saveLayout();
|
||||||
|
|
||||||
|
virtual QStatusBar* getStatusBar();
|
||||||
|
virtual void setStatusBar(QStatusBar* statusBar);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<QtMainWindow> m_window;
|
std::shared_ptr<QtMainWindow> m_window;
|
||||||
std::vector<View*> m_views;
|
std::vector<View*> m_views;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#include "qt/view/QtStatusBarView.h"
|
||||||
|
|
||||||
|
#include <QStatusBar>
|
||||||
|
#include "qt/view/QtMainView.h"
|
||||||
|
#include "qt/view/QtViewWidgetWrapper.h"
|
||||||
|
|
||||||
|
QtStatusBarView::QtStatusBarView( ViewLayout* viewLayout )
|
||||||
|
: StatusBarView(viewLayout)
|
||||||
|
, m_showMessageFunctor(std::bind(&QtStatusBarView::doShowMessage, this, std::placeholders::_1, std::placeholders::_2))
|
||||||
|
{
|
||||||
|
QtMainView* mw = static_cast<QtMainView*>(viewLayout);
|
||||||
|
m_widget = std::make_shared<QtStatusBar>();
|
||||||
|
QStatusBar* sb = static_cast<QStatusBar*>(m_widget.get());
|
||||||
|
mw->setStatusBar(sb);
|
||||||
|
m_widget->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
QtStatusBarView::~QtStatusBarView()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBarView::createWidgetWrapper()
|
||||||
|
{
|
||||||
|
//setWidgetWrapper(std::make_shared<QtViewWidgetWrapper>(m_widget));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBarView::initView()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBarView::refreshView()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBarView::doShowMessage( const std::string& message, bool isError )
|
||||||
|
{
|
||||||
|
m_widget->setText(message, isError);
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtStatusBarView::showMessage( const std::string& message, bool isError )
|
||||||
|
{
|
||||||
|
m_showMessageFunctor(message, isError);
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef QT_STATUS_BAR_VIEW_H
|
||||||
|
#define QT_STATUS_BAR_VIEW_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "component/view/StatusBarView.h"
|
||||||
|
#include "qt/element/QtStatusBar.h"
|
||||||
|
#include "qt/utility/QtThreadedFunctor.h"
|
||||||
|
|
||||||
|
class QtStatusBarView : public StatusBarView
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QtStatusBarView(ViewLayout* viewLayout);
|
||||||
|
~QtStatusBarView();
|
||||||
|
|
||||||
|
// View implementation
|
||||||
|
virtual void createWidgetWrapper();
|
||||||
|
virtual void initView();
|
||||||
|
virtual void refreshView();
|
||||||
|
|
||||||
|
// StatusBar view implementation
|
||||||
|
virtual void showMessage(const std::string& message, bool isError);
|
||||||
|
private:
|
||||||
|
void doShowMessage(const std::string& message, bool isError);
|
||||||
|
std::shared_ptr<QtStatusBar> m_widget;
|
||||||
|
|
||||||
|
QtThreadedFunctor<const std::string&, bool> m_showMessageFunctor;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !QT_STATUS_BAR_VIEW_H
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "qt/view/QtGraphView.h"
|
#include "qt/view/QtGraphView.h"
|
||||||
#include "qt/view/QtMainView.h"
|
#include "qt/view/QtMainView.h"
|
||||||
#include "qt/view/QtSearchView.h"
|
#include "qt/view/QtSearchView.h"
|
||||||
|
#include "qt/view/QtStatusBarView.h"
|
||||||
|
|
||||||
QtViewFactory::QtViewFactory()
|
QtViewFactory::QtViewFactory()
|
||||||
{
|
{
|
||||||
@@ -32,3 +33,8 @@ std::shared_ptr<SearchView> QtViewFactory::createSearchView(ViewLayout* viewLayo
|
|||||||
{
|
{
|
||||||
return View::create<QtSearchView>(viewLayout);
|
return View::create<QtSearchView>(viewLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<StatusBarView> QtViewFactory::createStatusBarView(ViewLayout* viewLayout) const
|
||||||
|
{
|
||||||
|
return View::createAndDontAddToLayout<QtStatusBarView>(viewLayout);
|
||||||
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ public:
|
|||||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const;
|
||||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const;
|
||||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const;
|
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const;
|
||||||
|
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_VIEW_FACTORY_H
|
#endif // QT_VIEW_FACTORY_H
|
||||||
|
|||||||
@@ -121,13 +121,13 @@ void QtCorneredConnection::paint(QPainter *painter, const QStyleOptionGraphicsIt
|
|||||||
|
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
{
|
{
|
||||||
if (dir % 2 == 1 && abs(a.y() - b.y()) < 2 * br)
|
if (dir % 2 == 1 && std::abs(a.y() - b.y()) < 2 * br)
|
||||||
{
|
{
|
||||||
br = abs(a.y() - b.y()) / 2;
|
br = std::abs(a.y() - b.y()) / 2;
|
||||||
}
|
}
|
||||||
else if (dir % 2 == 0 && abs(a.x() - b.x()) < 2 * br)
|
else if (dir % 2 == 0 && std::abs(a.x() - b.x()) < 2 * br)
|
||||||
{
|
{
|
||||||
br = abs(a.x() - b.x()) / 2;
|
br = std::abs(a.x() - b.x()) / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ add_files(
|
|||||||
component/controller/GraphLayouter.h
|
component/controller/GraphLayouter.h
|
||||||
component/controller/SearchController.cpp
|
component/controller/SearchController.cpp
|
||||||
component/controller/SearchController.h
|
component/controller/SearchController.h
|
||||||
|
component/controller/StatusBarController.cpp
|
||||||
|
component/controller/StatusBarController.h
|
||||||
|
|
||||||
component/view/graphElements/GraphEdge.cpp
|
component/view/graphElements/GraphEdge.cpp
|
||||||
component/view/graphElements/GraphEdge.h
|
component/view/graphElements/GraphEdge.h
|
||||||
@@ -46,6 +48,8 @@ add_files(
|
|||||||
component/view/MainView.h
|
component/view/MainView.h
|
||||||
component/view/SearchView.cpp
|
component/view/SearchView.cpp
|
||||||
component/view/SearchView.h
|
component/view/SearchView.h
|
||||||
|
component/view/StatusBarView.cpp
|
||||||
|
component/view/StatusBarView.h
|
||||||
component/view/View.cpp
|
component/view/View.cpp
|
||||||
component/view/View.h
|
component/view/View.h
|
||||||
component/view/ViewFactory.cpp
|
component/view/ViewFactory.cpp
|
||||||
@@ -191,6 +195,8 @@ add_files(
|
|||||||
utility/math/VectorBase.h
|
utility/math/VectorBase.h
|
||||||
|
|
||||||
utility/messaging/type/MessageActivateToken.h
|
utility/messaging/type/MessageActivateToken.h
|
||||||
|
utility/messaging/type/MessageActivateTokens.h
|
||||||
|
utility/messaging/type/MessageError.h
|
||||||
utility/messaging/type/MessageFind.h
|
utility/messaging/type/MessageFind.h
|
||||||
utility/messaging/type/MessageFinishedParsing.h
|
utility/messaging/type/MessageFinishedParsing.h
|
||||||
utility/messaging/type/MessageGraphNodeExpand.h
|
utility/messaging/type/MessageGraphNodeExpand.h
|
||||||
@@ -198,8 +204,11 @@ add_files(
|
|||||||
utility/messaging/type/MessageLoadProject.h
|
utility/messaging/type/MessageLoadProject.h
|
||||||
utility/messaging/type/MessageLoadSource.h
|
utility/messaging/type/MessageLoadSource.h
|
||||||
utility/messaging/type/MessageRefresh.h
|
utility/messaging/type/MessageRefresh.h
|
||||||
|
utility/messaging/type/MessageSaveProject.h
|
||||||
utility/messaging/type/MessageSearch.h
|
utility/messaging/type/MessageSearch.h
|
||||||
|
utility/messaging/type/MessageSearchAutocomplete.h
|
||||||
utility/messaging/type/MessageShowFile.h
|
utility/messaging/type/MessageShowFile.h
|
||||||
|
utility/messaging/type/MessageStatus.h
|
||||||
|
|
||||||
utility/messaging/Message.h
|
utility/messaging/Message.h
|
||||||
utility/messaging/MessageBase.h
|
utility/messaging/MessageBase.h
|
||||||
|
|||||||
@@ -4,9 +4,11 @@
|
|||||||
#include "component/controller/CodeController.h"
|
#include "component/controller/CodeController.h"
|
||||||
#include "component/controller/GraphController.h"
|
#include "component/controller/GraphController.h"
|
||||||
#include "component/controller/SearchController.h"
|
#include "component/controller/SearchController.h"
|
||||||
|
#include "component/controller/StatusBarController.h"
|
||||||
#include "component/view/CodeView.h"
|
#include "component/view/CodeView.h"
|
||||||
#include "component/view/GraphView.h"
|
#include "component/view/GraphView.h"
|
||||||
#include "component/view/SearchView.h"
|
#include "component/view/SearchView.h"
|
||||||
|
#include "component/view/StatusBarView.h"
|
||||||
#include "component/view/ViewFactory.h"
|
#include "component/view/ViewFactory.h"
|
||||||
#include "component/view/ViewLayout.h"
|
#include "component/view/ViewLayout.h"
|
||||||
|
|
||||||
@@ -52,6 +54,18 @@ std::shared_ptr<Component> ComponentFactory::createSearchComponent()
|
|||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Component> ComponentFactory::createStatusBarComponent()
|
||||||
|
{
|
||||||
|
std::shared_ptr<StatusBarView> view = m_viewFactory->createStatusBarView(m_viewLayout);
|
||||||
|
std::shared_ptr<StatusBarController> controller = std::make_shared<StatusBarController>();
|
||||||
|
|
||||||
|
std::shared_ptr<Component> component = std::make_shared<Component>(view,controller);
|
||||||
|
return component;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ComponentFactory::ComponentFactory()
|
ComponentFactory::ComponentFactory()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
std::shared_ptr<Component> createCodeComponent();
|
std::shared_ptr<Component> createCodeComponent();
|
||||||
std::shared_ptr<Component> createGraphComponent();
|
std::shared_ptr<Component> createGraphComponent();
|
||||||
std::shared_ptr<Component> createSearchComponent();
|
std::shared_ptr<Component> createSearchComponent();
|
||||||
|
std::shared_ptr<Component> createStatusBarComponent();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ComponentFactory();
|
ComponentFactory();
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ void ComponentManager::setup()
|
|||||||
|
|
||||||
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent();
|
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent();
|
||||||
m_components.push_back(searchComponent);
|
m_components.push_back(searchComponent);
|
||||||
|
|
||||||
|
std::shared_ptr<Component> statusBarComponent = m_componentFactory->createStatusBarComponent();
|
||||||
|
m_components.push_back(statusBarComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentManager::ComponentManager()
|
ComponentManager::ComponentManager()
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#include "component/controller/StatusBarController.h"
|
||||||
|
|
||||||
|
#include "component/view/StatusBarView.h"
|
||||||
|
|
||||||
|
StatusBarController::StatusBarController()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBarController::~StatusBarController()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBarView* StatusBarController::getView()
|
||||||
|
{
|
||||||
|
return Controller::getView<StatusBarView>();
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatusBarController::handleMessage(MessageFinishedParsing* message)
|
||||||
|
{
|
||||||
|
setStatus("Parsing Finished");
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatusBarController::handleMessage(MessageStatus* message)
|
||||||
|
{
|
||||||
|
setStatus(message->status);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatusBarController::handleMessage(MessageError* message)
|
||||||
|
{
|
||||||
|
setStatus(message->error, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void StatusBarController::setStatus(const std::string& status, bool isError)
|
||||||
|
{
|
||||||
|
if(!status.empty())
|
||||||
|
getView()->showMessage(status, isError);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef STATUS_BAR_CONTROLLER_H
|
||||||
|
#define STATUS_BAR_CONTROLLER_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "component/controller/Controller.h"
|
||||||
|
|
||||||
|
#include "utility/messaging/MessageListener.h"
|
||||||
|
#include "utility/messaging/type/MessageError.h"
|
||||||
|
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||||
|
#include "utility/messaging/type/MessageStatus.h"
|
||||||
|
|
||||||
|
class StatusBarView;
|
||||||
|
|
||||||
|
class StatusBarController
|
||||||
|
: public Controller
|
||||||
|
, public MessageListener<MessageError>
|
||||||
|
, public MessageListener<MessageFinishedParsing>
|
||||||
|
, public MessageListener<MessageStatus>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
StatusBarController(void);
|
||||||
|
~StatusBarController(void);
|
||||||
|
|
||||||
|
StatusBarView* getView();
|
||||||
|
private:
|
||||||
|
void setStatus(const std::string& status, bool isError = false);
|
||||||
|
|
||||||
|
virtual void handleMessage(MessageError* message);
|
||||||
|
virtual void handleMessage(MessageFinishedParsing* message);
|
||||||
|
virtual void handleMessage(MessageStatus* message);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // STATUS_BAR_CONTROLLER_H
|
||||||
@@ -15,6 +15,10 @@ CodeView::CodeSnippetParams::CodeSnippetParams()
|
|||||||
|
|
||||||
bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b )
|
bool CodeView::CodeSnippetParams::sort( CodeSnippetParams a, CodeSnippetParams b )
|
||||||
{
|
{
|
||||||
|
if(a.isActive && b.isActive)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// sort active snippet first
|
// sort active snippet first
|
||||||
if(a.isActive)
|
if(a.isActive)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ class MainView: public ViewLayout
|
|||||||
public:
|
public:
|
||||||
MainView();
|
MainView();
|
||||||
virtual ~MainView();
|
virtual ~MainView();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAIN_VIEW_H
|
#endif // MAIN_VIEW_H
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#include "component/view/StatusBarView.h"
|
||||||
|
|
||||||
|
#include "component/controller/StatusBarController.h"
|
||||||
|
|
||||||
|
StatusBarView::StatusBarView(ViewLayout* viewLayout)
|
||||||
|
: View(viewLayout, Vec2i(100,100))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBarView::~StatusBarView()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string StatusBarView::getName() const
|
||||||
|
{
|
||||||
|
return "StatusBarView";
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusBarController* StatusBarView::getController()
|
||||||
|
{
|
||||||
|
return View::getController<StatusBarController>();
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef STATUS_BAR_VIEW_H
|
||||||
|
#define STATUS_BAR_VIEW_H
|
||||||
|
|
||||||
|
#include "component/view/View.h"
|
||||||
|
|
||||||
|
class StatusBarController;
|
||||||
|
|
||||||
|
class StatusBarView : public View
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
StatusBarView(ViewLayout* viewLayout);
|
||||||
|
~StatusBarView(void);
|
||||||
|
|
||||||
|
virtual std::string getName() const;
|
||||||
|
virtual void showMessage(const std::string& message, bool isError) = 0;
|
||||||
|
protected:
|
||||||
|
StatusBarController* getController();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //STATUS_BAR_VIEW_H
|
||||||
@@ -16,6 +16,9 @@ public:
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
static std::shared_ptr<T> create(ViewLayout* viewLayout);
|
static std::shared_ptr<T> create(ViewLayout* viewLayout);
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
static std::shared_ptr<T> createAndDontAddToLayout(ViewLayout* viewLayout);
|
||||||
|
|
||||||
View(ViewLayout* viewLayout, const Vec2i& minSize);
|
View(ViewLayout* viewLayout, const Vec2i& minSize);
|
||||||
virtual ~View();
|
virtual ~View();
|
||||||
|
|
||||||
@@ -60,6 +63,19 @@ std::shared_ptr<T> View::create(ViewLayout* viewLayout)
|
|||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
std::shared_ptr<T> View::createAndDontAddToLayout(ViewLayout* viewLayout)
|
||||||
|
{
|
||||||
|
std::shared_ptr<T> ptr = std::make_shared<T>(viewLayout);
|
||||||
|
|
||||||
|
ptr->createWidgetWrapper();
|
||||||
|
ptr->initView();
|
||||||
|
|
||||||
|
//viewLayout->addView(ptr.get());
|
||||||
|
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename ControllerType>
|
template <typename ControllerType>
|
||||||
ControllerType* View::getController()
|
ControllerType* View::getController()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ class CodeView;
|
|||||||
class GraphView;
|
class GraphView;
|
||||||
class MainView;
|
class MainView;
|
||||||
class SearchView;
|
class SearchView;
|
||||||
|
class StatusBarView;
|
||||||
class ViewLayout;
|
class ViewLayout;
|
||||||
|
|
||||||
class ViewFactory
|
class ViewFactory
|
||||||
@@ -19,6 +20,7 @@ public:
|
|||||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||||
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
virtual std::shared_ptr<GraphView> createGraphView(ViewLayout* viewLayout) const = 0;
|
||||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||||
|
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VIEW_FACTORY_H
|
#endif // VIEW_FACTORY_H
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#include "data/search/SearchNode.h"
|
#include "data/search/SearchNode.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "utility/text/Dictionary.h"
|
#include "utility/text/Dictionary.h"
|
||||||
|
|
||||||
#include "data/search/SearchIndex.h"
|
#include "data/search/SearchIndex.h"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define SEARCH_RESULT_H
|
#define SEARCH_RESULT_H
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
class SearchNode;
|
class SearchNode;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef MESSAGE_ERROR_H
|
||||||
|
#define MESSAGE_ERROR_H
|
||||||
|
|
||||||
|
#include "utility/messaging/Message.h"
|
||||||
|
#include "utility/types.h"
|
||||||
|
|
||||||
|
class MessageError: public Message<MessageError>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MessageError(
|
||||||
|
const std::string& error
|
||||||
|
)
|
||||||
|
: error(error)
|
||||||
|
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static const std::string getStaticType()
|
||||||
|
{
|
||||||
|
return "MessageError";
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string error;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MESSAGE_ERROR_H
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef MESSAGE_STATUS_H
|
||||||
|
#define MESSAGE_STATUS_H
|
||||||
|
|
||||||
|
#include "utility/messaging/Message.h"
|
||||||
|
#include "utility/types.h"
|
||||||
|
|
||||||
|
class MessageStatus: public Message<MessageStatus>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MessageStatus(
|
||||||
|
const std::string& status
|
||||||
|
)
|
||||||
|
: status(status)
|
||||||
|
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static const std::string getStaticType()
|
||||||
|
{
|
||||||
|
return "MessageStatus";
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string status;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MESSAGE_STATUS_H
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "utility/utilityString.h"
|
#include "utility/utilityString.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user