ui: Added tabs UI to top of main window (issue #215)
* Added tab bar to top of main window with UI/shortcuts similar to web browsers * ComponentManager offers components for 2 use-cases: application and tab * Application components: log view (status/errors), bookmarks, screen search, status bar, tabs, tooltips, dialogs and all tab views disabled * Tab components: graph, code, history and search * When a project is loaded there is always at least one tab, otherwise there is none * Each tab replaces the application views of the same name in the main layout when activated * Each tab has it's own TaskScheduler, to process tasks independent from other tabs * The application has a global TaskScheduler for application wide tasks * The singloton class TaskManager is responsible for managing the TaskSchedulers * MessageListeners and Messages hold an optional schedulerId, both must be set to only send to a specific TaskScheduler * Bookmark buttons where split off into a separate view per tab, bookmark managemement is done in the application * History menu processing is done by the QtMainWindow now * Screen search is an application component, the responders are always changed to the active tab * Plugin messages are opened in a new tab * Symbols can be opened in a new tab via middle click/context menu in graph, code, history dropdown * Full text index creation is mutexed now in PersistenStorage to make it fully thread-safe * All tabs are closed when switching projects * Tab contents are only animated when visible fortune cookie message = Catch your lucky star!
This commit is contained in:
@@ -534,12 +534,21 @@
|
||||
<background>#808080</background>
|
||||
<border>#BEBEBE</border>
|
||||
<button>
|
||||
<text>white</text>
|
||||
<text>
|
||||
<normal>#CCC</normal>
|
||||
<hover>#CCC</hover>
|
||||
<press>white</press>
|
||||
</text>
|
||||
<border>
|
||||
<normal>#CCC</normal>
|
||||
<press>#EEE</press>
|
||||
</border>
|
||||
<background>
|
||||
<normal>#808080</normal>
|
||||
<hover>#505050</hover>
|
||||
<press>#494949</press>
|
||||
</background>
|
||||
<icon>#CCC</icon>
|
||||
</button>
|
||||
</bar>
|
||||
</tab>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<text>black</text>
|
||||
</normal>
|
||||
<hover>
|
||||
<fill>#5EA071</fill>
|
||||
<fill>#6DB080</fill>
|
||||
<text>black</text>
|
||||
</hover>
|
||||
</command>
|
||||
@@ -508,12 +508,21 @@
|
||||
<background>#E0E0E0</background>
|
||||
<border>#BEBEBE</border>
|
||||
<button>
|
||||
<text>black</text>
|
||||
<text>
|
||||
<normal>#555</normal>
|
||||
<hover>#555</hover>
|
||||
<press>black</press>
|
||||
</text>
|
||||
<border>
|
||||
<normal>#888</normal>
|
||||
<press>#777</press>
|
||||
</border>
|
||||
<background>
|
||||
<normal>#E0E0E0</normal>
|
||||
<hover>#F0F0F0</hover>
|
||||
<press>#FFFFFF</press>
|
||||
</background>
|
||||
<icon>#555</icon>
|
||||
</button>
|
||||
</bar>
|
||||
</tab>
|
||||
|
||||
@@ -511,12 +511,21 @@
|
||||
<background>#555555</background>
|
||||
<border>#BEBEBE</border>
|
||||
<button>
|
||||
<text>white</text>
|
||||
<text>
|
||||
<normal>#AAA</normal>
|
||||
<hover>#AAA</hover>
|
||||
<press>white</press>
|
||||
</text>
|
||||
<border>
|
||||
<normal>#777</normal>
|
||||
<press>#999</press>
|
||||
</border>
|
||||
<background>
|
||||
<normal>#555555</normal>
|
||||
<hover>#2F2F2F</hover>
|
||||
<press>#272728</press>
|
||||
</background>
|
||||
<icon>#AAA</icon>
|
||||
</button>
|
||||
</bar>
|
||||
</tab>
|
||||
|
||||
@@ -13,6 +13,10 @@ QMainWindow::separator {
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
QToolBar {
|
||||
border: none;
|
||||
}
|
||||
|
||||
QDockWidget {
|
||||
color: <color:window/dock/text>;
|
||||
font-size: 10pt;
|
||||
|
||||
@@ -15,7 +15,7 @@ QTabBar::tab {
|
||||
border: 1px solid <color:tab/bar/border>;
|
||||
border-top-left-radius: 7px;
|
||||
border-top-right-radius: 7px;
|
||||
color: <color:tab/bar/button/text>;
|
||||
color: <color:tab/bar/button/text/normal>;
|
||||
font-size: <setting:font_size>px;
|
||||
height: <setting:font_size+8>;
|
||||
margin-left: 3px;
|
||||
@@ -25,11 +25,13 @@ QTabBar::tab {
|
||||
|
||||
QTabBar::tab:hover {
|
||||
background-color: <color:tab/bar/button/background/hover>;
|
||||
color: <color:tab/bar/button/text/hover>;
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:pressed {
|
||||
background-color: <color:tab/bar/button/background/press>;
|
||||
border-bottom: 1px solid <color:tab/bar/button/background/press>;
|
||||
color: <color:tab/bar/button/text/press>;
|
||||
}
|
||||
|
||||
QTabWidget #tab_content {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 881 B |
Binary file not shown.
|
After Width: | Height: | Size: 639 B |
@@ -0,0 +1,81 @@
|
||||
QTabBar {
|
||||
background-color: <color:tab/bar/background>;
|
||||
border-bottom: 1px solid <color:tab/bar/border>;
|
||||
font-size: <setting:font_size>px;
|
||||
padding-left: 4px;
|
||||
min-height: 30px;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
background-color: <color:tab/bar/button/background/normal>;
|
||||
border: 1px solid <color:tab/bar/border>;
|
||||
border-top-left-radius: 11px;
|
||||
border-top-right-radius: 11px;
|
||||
color: <color:tab/bar/button/text/normal>;
|
||||
min-height: 25px;
|
||||
margin-left: 3px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
QTabBar::tab:hover {
|
||||
background-color: <color:tab/bar/button/background/hover>;
|
||||
color: <color:tab/bar/button/text/hover>;
|
||||
}
|
||||
|
||||
QTabBar::tab:selected, QTabBar::tab:pressed {
|
||||
background-color: <color:tab/bar/button/background/press>;
|
||||
border-bottom: 1px solid <color:tab/bar/button/background/press>;
|
||||
color: <color:tab/bar/button/text/press>;
|
||||
}
|
||||
|
||||
#side_area {
|
||||
background-color: <color:tab/bar/background>;
|
||||
border-bottom: 1px solid <color:tab/bar/border>;
|
||||
}
|
||||
|
||||
#type_circle {
|
||||
background-color: <color:tab/bar/button/background/hover>;
|
||||
border: 1px solid <color:tab/bar/button/border/normal>;
|
||||
border-radius: 6px;
|
||||
margin: 0;
|
||||
height: 10px;
|
||||
width: 10px;
|
||||
margin-top: 3px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
#type_circle[selected=true] {
|
||||
border: 1px solid <color:tab/bar/button/border/press>;
|
||||
}
|
||||
|
||||
#close_button {
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 8px;
|
||||
color: <color:tab/bar/button/text/normal>;
|
||||
font-size: 12px;
|
||||
margin: 0;
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
margin-top: 5px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
#close_button:hover {
|
||||
border: 1px solid <color:tab/bar/border>;
|
||||
}
|
||||
|
||||
#add_button {
|
||||
background-color: <color:tab/bar/button/background/hover>;
|
||||
border: 1px solid <color:tab/bar/border>;
|
||||
border-radius: 11px;
|
||||
color: <color:tab/bar/button/text/normal>;
|
||||
margin: 5px 0 3px 0;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
#add_button:hover {
|
||||
background-color: <color:tab/bar/button/background/press>;
|
||||
color: <color:tab/bar/button/text/press>;
|
||||
}
|
||||
+33
-23
@@ -22,6 +22,8 @@
|
||||
#include "MessageForceEnterLicense.h"
|
||||
#include "MessageQuitApplication.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "TabId.h"
|
||||
#include "TaskManager.h"
|
||||
#include "TaskScheduler.h"
|
||||
#include "tracing.h"
|
||||
#include "UserPaths.h"
|
||||
@@ -45,7 +47,8 @@ void Application::createInstance(
|
||||
collector->run(Application::getUUID());
|
||||
}
|
||||
|
||||
TaskScheduler::getInstance();
|
||||
TaskManager::createScheduler(TabId::app());
|
||||
TaskManager::createScheduler(TabId::background());
|
||||
MessageQueue::getInstance();
|
||||
|
||||
bool hasGui = (viewFactory != nullptr);
|
||||
@@ -55,15 +58,11 @@ void Application::createInstance(
|
||||
|
||||
if (hasGui)
|
||||
{
|
||||
s_instance->m_componentManager = ComponentManager::create(viewFactory, s_instance->m_storageCache.get());
|
||||
|
||||
s_instance->m_mainView = viewFactory->createMainView();
|
||||
s_instance->m_mainView = viewFactory->createMainView(s_instance->m_storageCache.get());
|
||||
s_instance->m_mainView->setup();
|
||||
s_instance->updateTitle();
|
||||
|
||||
s_instance->m_componentManager->setup(s_instance->m_mainView.get());
|
||||
s_instance->m_mainView->loadLayout();
|
||||
|
||||
s_instance->m_componentManager->refreshViews();
|
||||
GraphViewStyle::setImpl(viewFactory->createGraphStyleImpl());
|
||||
}
|
||||
|
||||
if (networkFactory != nullptr)
|
||||
@@ -86,7 +85,8 @@ std::shared_ptr<Application> Application::getInstance()
|
||||
void Application::destroyInstance()
|
||||
{
|
||||
MessageQueue::getInstance()->stopMessageLoop();
|
||||
TaskScheduler::getInstance()->stopSchedulerLoop();
|
||||
TaskManager::destroyScheduler(TabId::background());
|
||||
TaskManager::destroyScheduler(TabId::app());
|
||||
|
||||
s_instance.reset();
|
||||
}
|
||||
@@ -145,6 +145,15 @@ const std::shared_ptr<Project> Application::getCurrentProject()
|
||||
return m_project;
|
||||
}
|
||||
|
||||
bool Application::isProjectLoaded() const
|
||||
{
|
||||
if (m_project)
|
||||
{
|
||||
return m_project->isLoaded();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Application::hasGUI()
|
||||
{
|
||||
return m_hasGUI;
|
||||
@@ -172,17 +181,17 @@ int Application::handleDialog(const std::wstring& message, const std::vector<std
|
||||
|
||||
std::shared_ptr<DialogView> Application::getDialogView(DialogView::UseCase useCase)
|
||||
{
|
||||
if (m_componentManager)
|
||||
if (m_mainView)
|
||||
{
|
||||
return m_componentManager->getDialogView(useCase);
|
||||
return m_mainView->getDialogView(useCase);
|
||||
}
|
||||
|
||||
return std::make_shared<DialogView>(useCase, nullptr);
|
||||
}
|
||||
|
||||
void Application::updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems)
|
||||
void Application::updateHistoryMenu(std::shared_ptr<MessageBase> message)
|
||||
{
|
||||
m_mainView->updateHistoryMenu(historyMenuItems);
|
||||
m_mainView->updateHistoryMenu(message);
|
||||
}
|
||||
|
||||
void Application::updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks)
|
||||
@@ -209,8 +218,7 @@ void Application::handleMessage(MessageEnteredLicense* message)
|
||||
|
||||
if (m_hasGUI)
|
||||
{
|
||||
m_mainView->refreshView();
|
||||
m_componentManager->refreshViews();
|
||||
m_mainView->refreshViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +272,13 @@ void Application::handleMessage(MessageLoadProject* message)
|
||||
|
||||
projectSettingsFilePath = migrateProjectSettings(projectSettingsFilePath);
|
||||
|
||||
m_project.reset();
|
||||
|
||||
if (m_hasGUI)
|
||||
{
|
||||
m_mainView->clear();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
updateRecentProjects(projectSettingsFilePath);
|
||||
@@ -297,11 +312,6 @@ void Application::handleMessage(MessageLoadProject* message)
|
||||
MessageStatus(L"Failed to load project, unknown exception was thrown: " + projectSettingsFilePath.wstr(), true).dispatch();
|
||||
}
|
||||
|
||||
if (m_hasGUI)
|
||||
{
|
||||
m_componentManager->clearComponents();
|
||||
}
|
||||
|
||||
if (message->refreshMode != REFRESH_NONE)
|
||||
{
|
||||
refreshProject(message->refreshMode);
|
||||
@@ -327,8 +337,7 @@ void Application::handleMessage(MessageRefreshUI* message)
|
||||
loadStyle(ApplicationSettings::getInstance()->getColorSchemePath());
|
||||
}
|
||||
|
||||
m_mainView->refreshView();
|
||||
m_componentManager->refreshViews();
|
||||
m_mainView->refreshViews();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +405,8 @@ FilePath Application::migrateProjectSettings(const FilePath& projectSettingsFile
|
||||
|
||||
void Application::startMessagingAndScheduling()
|
||||
{
|
||||
TaskScheduler::getInstance()->startSchedulerLoopThreaded();
|
||||
TaskManager::getScheduler(TabId::app())->startSchedulerLoopThreaded();
|
||||
TaskManager::getScheduler(TabId::background())->startSchedulerLoopThreaded();
|
||||
|
||||
MessageQueue* queue = MessageQueue::getInstance().get();
|
||||
queue->addMessageFilter(std::make_shared<MessageFilterErrorCountUpdate>());
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "ComponentManager.h"
|
||||
#include "Project.h"
|
||||
#include "DialogView.h"
|
||||
#include "MessageListener.h"
|
||||
#include "MessageIndexingFinished.h"
|
||||
#include "MessageActivateWindow.h"
|
||||
@@ -14,9 +13,10 @@
|
||||
#include "MessageRefreshUI.h"
|
||||
#include "MessageSwitchColorScheme.h"
|
||||
#include "MessageWindowFocus.h"
|
||||
#include "Project.h"
|
||||
#include "TimeStamp.h"
|
||||
|
||||
class Bookmark;
|
||||
class DialogView;
|
||||
class IDECommunicationController;
|
||||
class MainView;
|
||||
class NetworkFactory;
|
||||
@@ -48,6 +48,7 @@ public:
|
||||
~Application();
|
||||
|
||||
const std::shared_ptr<Project> getCurrentProject();
|
||||
bool isProjectLoaded() const;
|
||||
|
||||
bool hasGUI();
|
||||
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
int handleDialog(const std::wstring& message, const std::vector<std::wstring>& options);
|
||||
std::shared_ptr<DialogView> getDialogView(DialogView::UseCase useCase);
|
||||
|
||||
void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems);
|
||||
void updateHistoryMenu(std::shared_ptr<MessageBase> message);
|
||||
void updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
|
||||
private:
|
||||
@@ -92,7 +93,6 @@ private:
|
||||
std::shared_ptr<StorageCache> m_storageCache;
|
||||
|
||||
std::shared_ptr<MainView> m_mainView;
|
||||
std::shared_ptr<ComponentManager> m_componentManager;
|
||||
|
||||
std::shared_ptr<IDECommunicationController> m_ideCommunicationController;
|
||||
std::shared_ptr<UpdateChecker> m_updateChecker;
|
||||
|
||||
+25
-4
@@ -40,6 +40,8 @@ add_files(
|
||||
component/controller/StatusBarController.h
|
||||
component/controller/StatusController.cpp
|
||||
component/controller/StatusController.h
|
||||
component/controller/TabsController.cpp
|
||||
component/controller/TabsController.h
|
||||
component/controller/TooltipController.cpp
|
||||
component/controller/TooltipController.h
|
||||
component/controller/UndoRedoController.cpp
|
||||
@@ -47,6 +49,8 @@ add_files(
|
||||
|
||||
component/view/helper/CodeSnippetParams.cpp
|
||||
component/view/helper/CodeSnippetParams.h
|
||||
component/view/BookmarkButtonsView.cpp
|
||||
component/view/BookmarkButtonsView.h
|
||||
component/view/BookmarkView.cpp
|
||||
component/view/BookmarkView.h
|
||||
component/view/CodeView.cpp
|
||||
@@ -76,13 +80,14 @@ add_files(
|
||||
component/view/StatusView.h
|
||||
component/view/TabbedView.cpp
|
||||
component/view/TabbedView.h
|
||||
component/view/TabsView.cpp
|
||||
component/view/TabsView.h
|
||||
component/view/TooltipView.cpp
|
||||
component/view/TooltipView.h
|
||||
component/view/UndoRedoView.cpp
|
||||
component/view/UndoRedoView.h
|
||||
component/view/View.cpp
|
||||
component/view/View.h
|
||||
component/view/ViewFactory.cpp
|
||||
component/view/ViewFactory.h
|
||||
component/view/ViewLayout.cpp
|
||||
component/view/ViewLayout.h
|
||||
@@ -97,6 +102,10 @@ add_files(
|
||||
component/ComponentManager.h
|
||||
component/NetworkFactory.cpp
|
||||
component/NetworkFactory.h
|
||||
component/Tab.cpp
|
||||
component/Tab.h
|
||||
component/TabId.cpp
|
||||
component/TabId.h
|
||||
|
||||
data/access/StorageAccess.h
|
||||
data/access/StorageAccessProxy.cpp
|
||||
@@ -424,6 +433,13 @@ add_files(
|
||||
|
||||
utility/messaging/type/activation/MessageActivateLegend.h
|
||||
|
||||
utility/messaging/type/bookmark/MessageBookmarkActivate.h
|
||||
utility/messaging/type/bookmark/MessageBookmarkBrowse.h
|
||||
utility/messaging/type/bookmark/MessageBookmarkButtonState.h
|
||||
utility/messaging/type/bookmark/MessageBookmarkCreate.h
|
||||
utility/messaging/type/bookmark/MessageBookmarkDelete.h
|
||||
utility/messaging/type/bookmark/MessageBookmarkEdit.h
|
||||
|
||||
utility/messaging/type/code/MessageCodeShowDefinition.h
|
||||
|
||||
utility/messaging/type/error/MessageActivateErrors.h
|
||||
@@ -443,9 +459,14 @@ add_files(
|
||||
utility/messaging/type/indexing/MessageIndexingStarted.h
|
||||
utility/messaging/type/indexing/MessageIndexingStatus.h
|
||||
|
||||
utility/messaging/type/tab/MessageTabClose.h
|
||||
utility/messaging/type/tab/MessageTabOpen.h
|
||||
utility/messaging/type/tab/MessageTabOpenWith.h
|
||||
utility/messaging/type/tab/MessageTabSelect.h
|
||||
utility/messaging/type/tab/MessageTabState.h
|
||||
|
||||
utility/messaging/type/MessageActivateAll.h
|
||||
utility/messaging/type/MessageActivateBase.h
|
||||
utility/messaging/type/MessageActivateBookmark.h
|
||||
utility/messaging/type/MessageActivateEdge.h
|
||||
utility/messaging/type/MessageActivateFile.h
|
||||
utility/messaging/type/MessageActivateFullTextSearch.h
|
||||
@@ -462,8 +483,6 @@ add_files(
|
||||
utility/messaging/type/MessageClearStatusView.h
|
||||
utility/messaging/type/MessageCodeReference.h
|
||||
utility/messaging/type/MessageDeactivateEdge.h
|
||||
utility/messaging/type/MessageDisplayBookmarkCreator.h
|
||||
utility/messaging/type/MessageDisplayBookmarks.h
|
||||
utility/messaging/type/MessageEnteredLicense.h
|
||||
utility/messaging/type/MessageFind.h
|
||||
utility/messaging/type/MessageFlushUpdates.h
|
||||
@@ -540,6 +559,8 @@ add_files(
|
||||
utility/scheduling/TaskGroupSequence.h
|
||||
utility/scheduling/TaskLambda.cpp
|
||||
utility/scheduling/TaskLambda.h
|
||||
utility/scheduling/TaskManager.cpp
|
||||
utility/scheduling/TaskManager.h
|
||||
utility/scheduling/TaskReturnSuccessIf.h
|
||||
utility/scheduling/TaskRunner.cpp
|
||||
utility/scheduling/TaskRunner.h
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
Component::Component(std::shared_ptr<View> view, std::shared_ptr<Controller> controller)
|
||||
: m_controller(controller)
|
||||
, m_view(view)
|
||||
, m_tabId(0)
|
||||
{
|
||||
if (m_controller)
|
||||
{
|
||||
@@ -40,3 +41,13 @@ View* Component::getViewPtr() const
|
||||
{
|
||||
return m_view.get();
|
||||
}
|
||||
|
||||
void Component::setTabId(Id tabId)
|
||||
{
|
||||
m_tabId = tabId;
|
||||
}
|
||||
|
||||
Id Component::getTabId() const
|
||||
{
|
||||
return m_tabId;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class View;
|
||||
class Controller;
|
||||
|
||||
@@ -22,9 +24,14 @@ public:
|
||||
|
||||
View* getViewPtr() const;
|
||||
|
||||
void setTabId(Id tabId);
|
||||
Id getTabId() const;
|
||||
|
||||
private:
|
||||
const std::shared_ptr<Controller> m_controller;
|
||||
const std::shared_ptr<View> m_view;
|
||||
|
||||
Id m_tabId;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "SearchController.h"
|
||||
#include "StatusBarController.h"
|
||||
#include "StatusController.h"
|
||||
#include "TabsController.h"
|
||||
#include "TooltipController.h"
|
||||
#include "UndoRedoController.h"
|
||||
#include "BookmarkView.h"
|
||||
@@ -21,25 +22,18 @@
|
||||
#include "SearchView.h"
|
||||
#include "StatusBarView.h"
|
||||
#include "StatusView.h"
|
||||
#include "TabsView.h"
|
||||
#include "TooltipView.h"
|
||||
#include "UndoRedoView.h"
|
||||
#include "ViewFactory.h"
|
||||
|
||||
std::shared_ptr<ComponentFactory> ComponentFactory::create(ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
{
|
||||
std::shared_ptr<ComponentFactory> ptr(new ComponentFactory());
|
||||
|
||||
ptr->m_viewFactory = viewFactory;
|
||||
ptr->m_storageAccess = storageAccess;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
ComponentFactory::~ComponentFactory()
|
||||
ComponentFactory::ComponentFactory(const ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
: m_viewFactory(viewFactory)
|
||||
, m_storageAccess(storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
ViewFactory* ComponentFactory::getViewFactory() const
|
||||
const ViewFactory* ComponentFactory::getViewFactory() const
|
||||
{
|
||||
return m_viewFactory;
|
||||
}
|
||||
@@ -128,6 +122,16 @@ std::shared_ptr<Component> ComponentFactory::createStatusComponent(ViewLayout* v
|
||||
return std::make_shared<Component>(view, controller);
|
||||
}
|
||||
|
||||
std::shared_ptr<Component> ComponentFactory::createTabsComponent(
|
||||
ViewLayout* viewLayout, ScreenSearchSender* screenSearchSender)
|
||||
{
|
||||
std::shared_ptr<TabsView> view = m_viewFactory->createTabsView(viewLayout);
|
||||
std::shared_ptr<Controller> controller = std::make_shared<TabsController>(
|
||||
viewLayout, m_viewFactory, m_storageAccess, screenSearchSender);
|
||||
|
||||
return std::make_shared<Component>(view, controller);
|
||||
}
|
||||
|
||||
std::shared_ptr<Component> ComponentFactory::createTooltipComponent(ViewLayout* viewLayout)
|
||||
{
|
||||
std::shared_ptr<TooltipView> view = m_viewFactory->createTooltipView(viewLayout);
|
||||
@@ -143,7 +147,3 @@ std::shared_ptr<Component> ComponentFactory::createUndoRedoComponent(ViewLayout*
|
||||
|
||||
return std::make_shared<Component>(view, controller);
|
||||
}
|
||||
|
||||
ComponentFactory::ComponentFactory()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -8,15 +8,14 @@
|
||||
class Component;
|
||||
class ViewFactory;
|
||||
class ViewLayout;
|
||||
class ScreenSearchSender;
|
||||
|
||||
class ComponentFactory
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<ComponentFactory> create(ViewFactory* viewFactory, StorageAccess* storageAccess);
|
||||
ComponentFactory(const ViewFactory* viewFactory, StorageAccess* storageAccess);
|
||||
|
||||
~ComponentFactory();
|
||||
|
||||
ViewFactory* getViewFactory() const;
|
||||
const ViewFactory* getViewFactory() const;
|
||||
StorageAccess* getStorageAccess() const;
|
||||
|
||||
std::shared_ptr<Component> createActivationComponent();
|
||||
@@ -29,14 +28,12 @@ public:
|
||||
std::shared_ptr<Component> createSearchComponent(ViewLayout* viewLayout);
|
||||
std::shared_ptr<Component> createStatusBarComponent(ViewLayout* viewLayout);
|
||||
std::shared_ptr<Component> createStatusComponent(ViewLayout* viewLayout);
|
||||
std::shared_ptr<Component> createTabsComponent(ViewLayout* viewLayout, ScreenSearchSender* screenSearchSender);
|
||||
std::shared_ptr<Component> createTooltipComponent(ViewLayout* viewLayout);
|
||||
std::shared_ptr<Component> createUndoRedoComponent(ViewLayout* viewLayout);
|
||||
|
||||
private:
|
||||
ComponentFactory();
|
||||
ComponentFactory(const ComponentFactory&);
|
||||
|
||||
ViewFactory* m_viewFactory;
|
||||
const ViewFactory* m_viewFactory;
|
||||
StorageAccess* m_storageAccess;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,87 +1,147 @@
|
||||
#include "ComponentManager.h"
|
||||
|
||||
#include "logging.h"
|
||||
|
||||
#include "Controller.h"
|
||||
#include "ScreenSearchController.h"
|
||||
#include "CompositeView.h"
|
||||
#include "Controller.h"
|
||||
#include "DialogView.h"
|
||||
#include "logging.h"
|
||||
#include "ScreenSearchController.h"
|
||||
#include "TabbedView.h"
|
||||
#include "ViewFactory.h"
|
||||
#include "BookmarkButtonsView.h"
|
||||
#include "BookmarkView.h"
|
||||
#include "CodeView.h"
|
||||
#include "GraphView.h"
|
||||
#include "RefreshView.h"
|
||||
#include "SearchView.h"
|
||||
#include "UndoRedoView.h"
|
||||
|
||||
std::shared_ptr<ComponentManager> ComponentManager::create(ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
{
|
||||
std::shared_ptr<ComponentManager> ptr(new ComponentManager());
|
||||
|
||||
ptr->m_componentFactory = ComponentFactory::create(viewFactory, storageAccess);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
ComponentManager::~ComponentManager()
|
||||
ComponentManager::ComponentManager(const ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
: m_componentFactory(viewFactory, storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
void ComponentManager::setup(ViewLayout* viewLayout)
|
||||
void ComponentManager::clear()
|
||||
{
|
||||
m_dialogViews.clear();
|
||||
m_components.clear();
|
||||
m_singleViews.clear();
|
||||
}
|
||||
|
||||
void ComponentManager::setupMain(ViewLayout* viewLayout, Id appId)
|
||||
{
|
||||
std::shared_ptr<CompositeView> compositeView =
|
||||
m_componentFactory->getViewFactory()->createCompositeView(viewLayout, CompositeView::DIRECTION_HORIZONTAL, "Search");
|
||||
m_compositeViews.push_back(compositeView);
|
||||
m_componentFactory.getViewFactory()->createCompositeView(viewLayout, CompositeView::DIRECTION_HORIZONTAL, "Search");
|
||||
m_singleViews.push_back(compositeView);
|
||||
|
||||
std::shared_ptr<Component> undoRedoComponent = m_componentFactory->createUndoRedoComponent(compositeView.get());
|
||||
m_components.push_back(undoRedoComponent);
|
||||
std::shared_ptr<UndoRedoView> undoRedoView = m_componentFactory.getViewFactory()->createUndoRedoView(compositeView.get());
|
||||
std::shared_ptr<RefreshView> refreshView = m_componentFactory.getViewFactory()->createRefreshView(compositeView.get());
|
||||
std::shared_ptr<SearchView> searchView = m_componentFactory.getViewFactory()->createSearchView(compositeView.get());
|
||||
|
||||
std::shared_ptr<Component> refreshComponent = m_componentFactory->createRefreshComponent(compositeView.get());
|
||||
m_components.push_back(refreshComponent);
|
||||
std::shared_ptr<BookmarkButtonsView> bookmarkView =
|
||||
m_componentFactory.getViewFactory()->createBookmarkButtonsView(compositeView.get());
|
||||
bookmarkView->setTabId(appId);
|
||||
|
||||
std::shared_ptr<Component> searchComponent = m_componentFactory->createSearchComponent(compositeView.get());
|
||||
m_components.push_back(searchComponent);
|
||||
std::shared_ptr<GraphView> graphView = m_componentFactory.getViewFactory()->createGraphView(viewLayout);
|
||||
std::shared_ptr<CodeView> codeView = m_componentFactory.getViewFactory()->createCodeView(viewLayout);
|
||||
|
||||
std::shared_ptr<Component> bookmarkComponent = m_componentFactory->createBookmarkComponent(compositeView.get());
|
||||
m_components.push_back(bookmarkComponent);
|
||||
for (std::shared_ptr<View> view :
|
||||
std::vector<std::shared_ptr<View>>({ undoRedoView, searchView, bookmarkView, graphView, codeView }))
|
||||
{
|
||||
view->setEnabled(false);
|
||||
}
|
||||
|
||||
std::shared_ptr<Component> graphComponent = m_componentFactory->createGraphComponent(viewLayout);
|
||||
m_components.push_back(graphComponent);
|
||||
m_singleViews.push_back(undoRedoView);
|
||||
m_singleViews.push_back(refreshView);
|
||||
m_singleViews.push_back(searchView);
|
||||
m_singleViews.push_back(bookmarkView);
|
||||
m_singleViews.push_back(graphView);
|
||||
m_singleViews.push_back(codeView);
|
||||
|
||||
std::shared_ptr<Component> codeComponent = m_componentFactory->createCodeComponent(viewLayout);
|
||||
m_components.push_back(codeComponent);
|
||||
std::shared_ptr<Component> screenSearchComponent = m_componentFactory.createScreenSearchComponent(viewLayout);
|
||||
ScreenSearchController* screenSearchController = screenSearchComponent->getController<ScreenSearchController>();
|
||||
screenSearchController->addResponder(graphView.get());
|
||||
screenSearchController->addResponder(codeView.get());
|
||||
m_components.push_back(screenSearchComponent);
|
||||
|
||||
std::shared_ptr<Component> statusBarComponent = m_componentFactory->createStatusBarComponent(viewLayout);
|
||||
std::shared_ptr<Component> tabsComponent = m_componentFactory.createTabsComponent(viewLayout, screenSearchController);
|
||||
m_components.push_back(tabsComponent);
|
||||
|
||||
std::shared_ptr<Component> statusBarComponent = m_componentFactory.createStatusBarComponent(viewLayout);
|
||||
m_components.push_back(statusBarComponent);
|
||||
|
||||
std::shared_ptr<Component> activationComponent = m_componentFactory->createActivationComponent();
|
||||
m_components.push_back(activationComponent);
|
||||
|
||||
std::shared_ptr<Component> tooltipComponent = m_componentFactory->createTooltipComponent(viewLayout);
|
||||
std::shared_ptr<Component> tooltipComponent = m_componentFactory.createTooltipComponent(viewLayout);
|
||||
m_components.push_back(tooltipComponent);
|
||||
|
||||
std::shared_ptr<Component> screenSearchComponent = m_componentFactory->createScreenSearchComponent(viewLayout);
|
||||
ScreenSearchController* screenSearchController = screenSearchComponent->getController<ScreenSearchController>();
|
||||
screenSearchController->addResponder(dynamic_cast<ScreenSearchResponder*>(graphComponent->getViewPtr()));
|
||||
screenSearchController->addResponder(dynamic_cast<ScreenSearchResponder*>(codeComponent->getViewPtr()));
|
||||
m_components.push_back(screenSearchComponent);
|
||||
|
||||
for (DialogView::UseCase useCase :
|
||||
{ DialogView::UseCase::GENERAL, DialogView::UseCase::INDEXING, DialogView::UseCase::PROJECT_SETUP })
|
||||
{
|
||||
m_dialogViews.emplace(
|
||||
useCase,
|
||||
m_componentFactory->getViewFactory()->createDialogView(viewLayout, useCase, m_componentFactory->getStorageAccess())
|
||||
m_componentFactory.getViewFactory()->createDialogView(viewLayout, useCase, m_componentFactory.getStorageAccess())
|
||||
);
|
||||
}
|
||||
|
||||
m_dialogViews[DialogView::UseCase::INDEXING]->setDialogsHideable(true);
|
||||
|
||||
std::shared_ptr<TabbedView> tabbedView =
|
||||
m_componentFactory->getViewFactory()->createTabbedView(viewLayout, "Status");
|
||||
m_tabbedViews.push_back(tabbedView);
|
||||
m_componentFactory.getViewFactory()->createTabbedView(viewLayout, "Status");
|
||||
m_singleViews.push_back(tabbedView);
|
||||
|
||||
std::shared_ptr<Component> statusComponent = m_componentFactory->createStatusComponent(tabbedView.get());
|
||||
std::shared_ptr<Component> statusComponent = m_componentFactory.createStatusComponent(tabbedView.get());
|
||||
m_components.push_back(statusComponent);
|
||||
|
||||
std::shared_ptr<Component> errorComponent = m_componentFactory->createErrorComponent(tabbedView.get());
|
||||
std::shared_ptr<Component> errorComponent = m_componentFactory.createErrorComponent(tabbedView.get());
|
||||
m_components.push_back(errorComponent);
|
||||
|
||||
std::shared_ptr<Component> bookmarkComponent = m_componentFactory.createBookmarkComponent(compositeView.get());
|
||||
m_components.push_back(bookmarkComponent);
|
||||
|
||||
std::shared_ptr<Component> activationComponent = m_componentFactory.createActivationComponent();
|
||||
m_components.push_back(activationComponent);
|
||||
}
|
||||
|
||||
void ComponentManager::setupTab(ViewLayout* viewLayout, Id tabId, ScreenSearchSender* screenSearchSender)
|
||||
{
|
||||
std::shared_ptr<CompositeView> compositeView =
|
||||
m_componentFactory.getViewFactory()->createCompositeView(viewLayout, CompositeView::DIRECTION_HORIZONTAL, "Search");
|
||||
m_singleViews.push_back(compositeView);
|
||||
|
||||
std::shared_ptr<Component> undoRedoComponent = m_componentFactory.createUndoRedoComponent(compositeView.get());
|
||||
undoRedoComponent->setTabId(tabId);
|
||||
m_components.push_back(undoRedoComponent);
|
||||
|
||||
std::shared_ptr<Component> refreshComponent = m_componentFactory.createRefreshComponent(compositeView.get());
|
||||
refreshComponent->setTabId(tabId);
|
||||
m_components.push_back(refreshComponent);
|
||||
|
||||
std::shared_ptr<Component> searchComponent = m_componentFactory.createSearchComponent(compositeView.get());
|
||||
searchComponent->setTabId(tabId);
|
||||
m_components.push_back(searchComponent);
|
||||
|
||||
std::shared_ptr<BookmarkButtonsView> bookmarkView =
|
||||
m_componentFactory.getViewFactory()->createBookmarkButtonsView(compositeView.get());
|
||||
bookmarkView->setTabId(tabId);
|
||||
m_singleViews.push_back(bookmarkView);
|
||||
|
||||
std::shared_ptr<Component> graphComponent = m_componentFactory.createGraphComponent(viewLayout);
|
||||
graphComponent->setTabId(tabId);
|
||||
m_components.push_back(graphComponent);
|
||||
|
||||
std::shared_ptr<Component> codeComponent = m_componentFactory.createCodeComponent(viewLayout);
|
||||
codeComponent->setTabId(tabId);
|
||||
m_components.push_back(codeComponent);
|
||||
|
||||
screenSearchSender->addResponder(graphComponent->getView<GraphView>());
|
||||
screenSearchSender->addResponder(codeComponent->getView<CodeView>());
|
||||
}
|
||||
|
||||
void ComponentManager::teardownTab(ScreenSearchSender* screenSearchSender)
|
||||
{
|
||||
for (const std::shared_ptr<Component>& component : m_components)
|
||||
{
|
||||
screenSearchSender->removeResponder(component->getView<GraphView>());
|
||||
screenSearchSender->removeResponder(component->getView<CodeView>());
|
||||
}
|
||||
}
|
||||
|
||||
void ComponentManager::clearComponents()
|
||||
@@ -109,12 +169,7 @@ void ComponentManager::refreshViews()
|
||||
}
|
||||
}
|
||||
|
||||
for (const std::shared_ptr<CompositeView>& view : m_compositeViews)
|
||||
{
|
||||
view->refreshView();
|
||||
}
|
||||
|
||||
for (const std::shared_ptr<TabbedView>& view : m_tabbedViews)
|
||||
for (const std::shared_ptr<View>& view : m_singleViews)
|
||||
{
|
||||
view->refreshView();
|
||||
}
|
||||
@@ -131,7 +186,3 @@ std::shared_ptr<DialogView> ComponentManager::getDialogView(DialogView::UseCase
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
||||
ComponentManager::ComponentManager()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
class CompositeView;
|
||||
class DialogView;
|
||||
class ScreenSearchSender;
|
||||
class StorageAccess;
|
||||
class TabbedView;
|
||||
class View;
|
||||
@@ -19,11 +20,13 @@ class ViewLayout;
|
||||
class ComponentManager
|
||||
{
|
||||
public:
|
||||
static std::shared_ptr<ComponentManager> create(ViewFactory* viewFactory, StorageAccess* graphAccess);
|
||||
ComponentManager(const ViewFactory* viewFactory, StorageAccess* storageAccess);
|
||||
|
||||
~ComponentManager();
|
||||
void clear();
|
||||
|
||||
void setup(ViewLayout* viewLayout);
|
||||
void setupMain(ViewLayout* viewLayout, Id appId);
|
||||
void setupTab(ViewLayout* viewLayout, Id tabId, ScreenSearchSender* screenSearchSender);
|
||||
void teardownTab(ScreenSearchSender* screenSearchSender);
|
||||
|
||||
void clearComponents();
|
||||
void refreshViews();
|
||||
@@ -31,13 +34,9 @@ public:
|
||||
std::shared_ptr<DialogView> getDialogView(DialogView::UseCase useCase) const;
|
||||
|
||||
private:
|
||||
ComponentManager();
|
||||
ComponentManager(const ComponentManager&);
|
||||
ComponentFactory m_componentFactory;
|
||||
|
||||
std::shared_ptr<ComponentFactory> m_componentFactory;
|
||||
|
||||
std::vector<std::shared_ptr<CompositeView>> m_compositeViews;
|
||||
std::vector<std::shared_ptr<TabbedView>> m_tabbedViews;
|
||||
std::vector<std::shared_ptr<View>> m_singleViews;
|
||||
std::vector<std::shared_ptr<Component>> m_components;
|
||||
|
||||
std::map<DialogView::UseCase, std::shared_ptr<DialogView>> m_dialogViews;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#include "Tab.h"
|
||||
|
||||
Tab::Tab(Id tabId, const ViewFactory* viewFactory, StorageAccess* storageAccess, ScreenSearchSender* screenSearchSender)
|
||||
: m_tabId(tabId)
|
||||
, m_componentManager(viewFactory, storageAccess)
|
||||
, m_parentLayout(nullptr)
|
||||
, m_screenSearchSender(screenSearchSender)
|
||||
{
|
||||
m_componentManager.setupTab(this, m_tabId, m_screenSearchSender);
|
||||
m_componentManager.refreshViews();
|
||||
}
|
||||
|
||||
Tab::~Tab()
|
||||
{
|
||||
m_componentManager.teardownTab(m_screenSearchSender);
|
||||
}
|
||||
|
||||
void Tab::setParentLayout(ViewLayout* parentLayout)
|
||||
{
|
||||
m_parentLayout = parentLayout;
|
||||
|
||||
if (parentLayout)
|
||||
{
|
||||
for (View* view : m_views)
|
||||
{
|
||||
parentLayout->overrideView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::addView(View* view)
|
||||
{
|
||||
m_views.push_back(view);
|
||||
}
|
||||
|
||||
void Tab::removeView(View* view)
|
||||
{
|
||||
std::vector<View*>::iterator it = std::find(m_views.begin(), m_views.end(), view);
|
||||
if (it == m_views.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_views.erase(it);
|
||||
}
|
||||
|
||||
void Tab::showView(View* view)
|
||||
{
|
||||
if (m_parentLayout)
|
||||
{
|
||||
m_parentLayout->showView(view);
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::hideView(View* view)
|
||||
{
|
||||
if (m_parentLayout)
|
||||
{
|
||||
m_parentLayout->hideView(view);
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::setViewEnabled(View* view, bool enabled)
|
||||
{
|
||||
if (m_parentLayout)
|
||||
{
|
||||
m_parentLayout->setViewEnabled(view, enabled);
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::handleMessage(MessageRefreshUI* message)
|
||||
{
|
||||
m_componentManager.refreshViews();
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#ifndef TAB_H
|
||||
#define TAB_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "ComponentManager.h"
|
||||
#include "MessageListener.h"
|
||||
#include "MessageRefreshUI.h"
|
||||
#include "View.h"
|
||||
#include "ViewLayout.h"
|
||||
|
||||
class Tab
|
||||
: public ViewLayout
|
||||
, public MessageListener<MessageRefreshUI>
|
||||
{
|
||||
public:
|
||||
Tab(Id tabId, const ViewFactory* viewFactory, StorageAccess* storageAccess, ScreenSearchSender* screenSearchSender);
|
||||
virtual ~Tab();
|
||||
|
||||
void setParentLayout(ViewLayout* parentLayout);
|
||||
|
||||
// ViewLayout implementation
|
||||
void addView(View* view) override;
|
||||
void removeView(View* view) override;
|
||||
|
||||
void showView(View* view) override;
|
||||
void hideView(View* view) override;
|
||||
|
||||
void setViewEnabled(View* view, bool enabled) override;
|
||||
|
||||
private:
|
||||
void handleMessage(MessageRefreshUI* message) override;
|
||||
|
||||
const Id m_tabId;
|
||||
|
||||
ComponentManager m_componentManager;
|
||||
std::vector<View*> m_views;
|
||||
|
||||
ViewLayout* m_parentLayout;
|
||||
ScreenSearchSender* m_screenSearchSender;
|
||||
};
|
||||
|
||||
#endif // TAB_H
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "TabId.h"
|
||||
|
||||
Id TabId::s_nextTabId = 10;
|
||||
Id TabId::s_currentTabId = 0;
|
||||
|
||||
Id TabId::app()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
Id TabId::background()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
Id TabId::ignore()
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
Id TabId::nextTab()
|
||||
{
|
||||
return s_nextTabId++;
|
||||
}
|
||||
|
||||
Id TabId::currentTab()
|
||||
{
|
||||
return s_currentTabId;
|
||||
}
|
||||
|
||||
void TabId::setCurrentTabId(Id currentTabId)
|
||||
{
|
||||
s_currentTabId = currentTabId;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef TAB_ID_H
|
||||
#define TAB_ID_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class TabId
|
||||
{
|
||||
public:
|
||||
static Id app();
|
||||
static Id background();
|
||||
static Id ignore();
|
||||
|
||||
static Id nextTab();
|
||||
static Id currentTab();
|
||||
|
||||
static void setCurrentTabId(Id currentTabId);
|
||||
|
||||
private:
|
||||
static Id s_nextTabId;
|
||||
static Id s_currentTabId;
|
||||
};
|
||||
|
||||
#endif // TAB_ID_H
|
||||
@@ -19,10 +19,6 @@ ActivationController::ActivationController(StorageAccess* storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
ActivationController::~ActivationController()
|
||||
{
|
||||
}
|
||||
|
||||
void ActivationController::clear()
|
||||
{
|
||||
}
|
||||
@@ -66,12 +62,15 @@ void ActivationController::handleMessage(MessageActivateFile* message)
|
||||
true,
|
||||
true
|
||||
);
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatchImmediately();
|
||||
}
|
||||
|
||||
if (message->line > 0)
|
||||
{
|
||||
MessageScrollToLine(message->filePath, message->line).dispatch();
|
||||
MessageScrollToLine msg(message->filePath, message->line);
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,12 +104,13 @@ void ActivationController::handleMessage(MessageActivateTokenIds* message)
|
||||
|
||||
void ActivationController::handleMessage(MessageActivateSourceLocations* message)
|
||||
{
|
||||
MessageActivateNodes m;
|
||||
MessageActivateNodes msg;
|
||||
for (Id nodeId : m_storageAccess->getNodeIdsForLocationIds(message->locationIds))
|
||||
{
|
||||
m.addNode(nodeId);
|
||||
msg.addNode(nodeId);
|
||||
}
|
||||
m.dispatchImmediately();
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatchImmediately();
|
||||
}
|
||||
|
||||
void ActivationController::handleMessage(MessageResetZoom* message)
|
||||
@@ -140,19 +140,25 @@ void ActivationController::handleMessage(MessageSearch* message)
|
||||
case SearchMatch::COMMAND_ALL:
|
||||
case SearchMatch::COMMAND_NODE_FILTER:
|
||||
{
|
||||
MessageActivateAll(message->acceptedNodeTypes).dispatchImmediately();
|
||||
MessageActivateAll msg(message->acceptedNodeTypes);
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
case SearchMatch::COMMAND_ERROR:
|
||||
{
|
||||
MessageErrorsAll().dispatch();
|
||||
MessageErrorsAll msg;
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatch();
|
||||
return;
|
||||
}
|
||||
|
||||
case SearchMatch::COMMAND_LEGEND:
|
||||
{
|
||||
MessageActivateLegend().dispatch();
|
||||
MessageActivateLegend msg;
|
||||
msg.setSchedulerId(message->getSchedulerId());
|
||||
msg.dispatch();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,19 +30,18 @@ class ActivationController
|
||||
{
|
||||
public:
|
||||
ActivationController(StorageAccess* storageAccess);
|
||||
~ActivationController();
|
||||
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateEdge* message);
|
||||
virtual void handleMessage(MessageActivateFile* message);
|
||||
virtual void handleMessage(MessageActivateNodes* message);
|
||||
virtual void handleMessage(MessageActivateTokenIds* message);
|
||||
virtual void handleMessage(MessageActivateSourceLocations* message);
|
||||
virtual void handleMessage(MessageResetZoom* message);
|
||||
virtual void handleMessage(MessageSearch* message);
|
||||
virtual void handleMessage(MessageZoom* message);
|
||||
void handleMessage(MessageActivateEdge* message) override;
|
||||
void handleMessage(MessageActivateFile* message) override;
|
||||
void handleMessage(MessageActivateNodes* message) override;
|
||||
void handleMessage(MessageActivateTokenIds* message) override;
|
||||
void handleMessage(MessageActivateSourceLocations* message) override;
|
||||
void handleMessage(MessageResetZoom* message) override;
|
||||
void handleMessage(MessageSearch* message) override;
|
||||
void handleMessage(MessageZoom* message) override;
|
||||
|
||||
StorageAccess* m_storageAccess;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
#include "MessageActivateEdge.h"
|
||||
#include "MessageActivateNodes.h"
|
||||
#include "MessageBookmarkButtonState.h"
|
||||
#include "logging.h"
|
||||
#include "TabId.h"
|
||||
#include "utilityString.h"
|
||||
#include "utility.h"
|
||||
|
||||
@@ -33,8 +35,6 @@ void BookmarkController::clear()
|
||||
{
|
||||
m_activeNodeIds.clear();
|
||||
m_activeEdgeIds.clear();
|
||||
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CANNOT_CREATE);
|
||||
}
|
||||
|
||||
void BookmarkController::displayBookmarks()
|
||||
@@ -62,18 +62,20 @@ void BookmarkController::createBookmark(
|
||||
){
|
||||
LOG_INFO("Attempting to create new bookmark");
|
||||
|
||||
Id tabId = TabId::currentTab();
|
||||
|
||||
BookmarkCategory bookmarkCategory(0, category.empty() ? s_defaultCategoryName : category);
|
||||
|
||||
if (!m_activeEdgeIds.empty())
|
||||
if (!m_activeEdgeIds[tabId].empty())
|
||||
{
|
||||
LOG_INFO("Creating Edge Bookmark");
|
||||
|
||||
EdgeBookmark bookmark(0, name, comment, TimeStamp::now(), bookmarkCategory);
|
||||
bookmark.setEdgeIds(m_activeEdgeIds);
|
||||
bookmark.setEdgeIds(m_activeEdgeIds[tabId]);
|
||||
|
||||
if (!m_activeNodeIds.empty())
|
||||
if (!m_activeNodeIds[TabId::currentTab()].empty())
|
||||
{
|
||||
bookmark.setActiveNodeId(m_activeNodeIds.front());
|
||||
bookmark.setActiveNodeId(m_activeNodeIds[tabId].front());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -93,16 +95,17 @@ void BookmarkController::createBookmark(
|
||||
}
|
||||
else
|
||||
{
|
||||
bookmark.setNodeIds(m_activeNodeIds);
|
||||
bookmark.setNodeIds(m_activeNodeIds[TabId::currentTab()]);
|
||||
}
|
||||
|
||||
m_storageAccess->addNodeBookmark(bookmark);
|
||||
}
|
||||
|
||||
m_bookmarkCache.clear();
|
||||
|
||||
if (!nodeId || (m_activeNodeIds.size() == 1 && m_activeNodeIds[0] == nodeId))
|
||||
if (!nodeId || (m_activeNodeIds[TabId::currentTab()].size() == 1 && m_activeNodeIds[TabId::currentTab()][0] == nodeId))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::ALREADY_CREATED);
|
||||
MessageBookmarkButtonState(TabId::currentTab(), MessageBookmarkButtonState::ALREADY_CREATED).dispatch();
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -128,9 +131,9 @@ void BookmarkController::deleteBookmark(Id bookmarkId)
|
||||
|
||||
cleanBookmarkCategories();
|
||||
|
||||
if (!getBookmarkForActiveToken())
|
||||
if (!getBookmarkForActiveToken(TabId::currentTab()))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CAN_CREATE);
|
||||
MessageBookmarkButtonState(TabId::currentTab(), MessageBookmarkButtonState::CAN_CREATE).dispatch();
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -142,9 +145,9 @@ void BookmarkController::deleteBookmarkCategory(Id categoryId)
|
||||
|
||||
m_bookmarkCache.clear();
|
||||
|
||||
if (!getBookmarkForActiveToken())
|
||||
if (!getBookmarkForActiveToken(TabId::currentTab()))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CAN_CREATE);
|
||||
MessageBookmarkButtonState(TabId::currentTab(), MessageBookmarkButtonState::CAN_CREATE).dispatch();
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -152,7 +155,7 @@ void BookmarkController::deleteBookmarkCategory(Id categoryId)
|
||||
|
||||
void BookmarkController::deleteBookmarkForActiveTokens()
|
||||
{
|
||||
if (std::shared_ptr<Bookmark> bookmark = getBookmarkForActiveToken())
|
||||
if (std::shared_ptr<Bookmark> bookmark = getBookmarkForActiveToken(TabId::currentTab()))
|
||||
{
|
||||
LOG_INFO(L"Deleting bookmark " + bookmark->getName());
|
||||
|
||||
@@ -160,7 +163,7 @@ void BookmarkController::deleteBookmarkForActiveTokens()
|
||||
|
||||
cleanBookmarkCategories();
|
||||
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CAN_CREATE);
|
||||
MessageBookmarkButtonState(TabId::currentTab(), MessageBookmarkButtonState::CAN_CREATE).dispatch();
|
||||
update();
|
||||
}
|
||||
else
|
||||
@@ -223,7 +226,8 @@ void BookmarkController::activateBookmark(const std::shared_ptr<Bookmark> bookma
|
||||
|
||||
void BookmarkController::showBookmarkCreator(Id nodeId)
|
||||
{
|
||||
if (!canCreateBookmark() && !nodeId)
|
||||
Id tabId = TabId::currentTab();
|
||||
if (!m_activeNodeIds[tabId].size() && !m_activeEdgeIds[tabId].size() && !nodeId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +248,7 @@ void BookmarkController::showBookmarkCreator(Id nodeId)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<Bookmark> bookmark = getBookmarkForActiveToken();
|
||||
std::shared_ptr<Bookmark> bookmark = getBookmarkForActiveToken(tabId);
|
||||
if (bookmark != nullptr)
|
||||
{
|
||||
view->displayBookmarkEditor(bookmark, getAllBookmarkCategories());
|
||||
@@ -297,69 +301,89 @@ void BookmarkController::handleMessage(MessageActivateAll* message)
|
||||
clear();
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageActivateBookmark* message)
|
||||
void BookmarkController::handleMessage(MessageActivateErrors* message)
|
||||
{
|
||||
activateBookmark(message->bookmark);
|
||||
clear();
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageActivateErrors* message)
|
||||
void BookmarkController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageActivateLegend* message)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
m_activeEdgeIds.clear();
|
||||
Id tabId = message->getSchedulerId();
|
||||
m_activeEdgeIds[tabId].clear();
|
||||
|
||||
if (message->isEdge || message->isAggregation)
|
||||
{
|
||||
m_activeEdgeIds = message->tokenIds;
|
||||
m_activeEdgeIds[tabId] = message->tokenIds;
|
||||
|
||||
if (getBookmarkForActiveToken())
|
||||
if (getBookmarkForActiveToken(tabId))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::ALREADY_CREATED);
|
||||
MessageBookmarkButtonState(tabId, MessageBookmarkButtonState::ALREADY_CREATED).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CAN_CREATE);
|
||||
MessageBookmarkButtonState(tabId, MessageBookmarkButtonState::CAN_CREATE).dispatch();
|
||||
}
|
||||
}
|
||||
else if (!message->isEdge)
|
||||
{
|
||||
m_activeNodeIds = message->tokenIds;
|
||||
m_activeNodeIds[tabId] = message->tokenIds;
|
||||
|
||||
if (getBookmarkForActiveToken())
|
||||
if (getBookmarkForActiveToken(tabId))
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::ALREADY_CREATED);
|
||||
MessageBookmarkButtonState(tabId, MessageBookmarkButtonState::ALREADY_CREATED).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
getView<BookmarkView>()->setCreateButtonState(BookmarkView::CreateButtonState::CAN_CREATE);
|
||||
MessageBookmarkButtonState(tabId, MessageBookmarkButtonState::CAN_CREATE).dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageDisplayBookmarks* message)
|
||||
void BookmarkController::handleMessage(MessageBookmarkActivate* message)
|
||||
{
|
||||
activateBookmark(message->bookmark);
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageBookmarkBrowse* message)
|
||||
{
|
||||
displayBookmarksFor(message->filter, message->order);
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageDisplayBookmarkCreator* message)
|
||||
void BookmarkController::handleMessage(MessageBookmarkCreate* message)
|
||||
{
|
||||
showBookmarkCreator(message->nodeId);
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageBookmarkDelete* message)
|
||||
{
|
||||
deleteBookmarkForActiveTokens();
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageBookmarkEdit* message)
|
||||
{
|
||||
showBookmarkCreator(0);
|
||||
}
|
||||
|
||||
void BookmarkController::handleMessage(MessageIndexingFinished* message)
|
||||
{
|
||||
m_bookmarkCache.clear();
|
||||
getView<BookmarkView>()->enableDisplayBookmarks(true);
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
std::vector<std::wstring> BookmarkController::getActiveTokenDisplayNames() const
|
||||
{
|
||||
if (m_activeEdgeIds.size() > 0)
|
||||
if (m_activeEdgeIds[TabId::currentTab()].size() > 0)
|
||||
{
|
||||
return getActiveEdgeDisplayNames();
|
||||
}
|
||||
@@ -379,14 +403,14 @@ std::vector<BookmarkCategory> BookmarkController::getAllBookmarkCategories() con
|
||||
return m_storageAccess->getAllBookmarkCategories();
|
||||
}
|
||||
|
||||
std::shared_ptr<Bookmark> BookmarkController::getBookmarkForActiveToken() const
|
||||
std::shared_ptr<Bookmark> BookmarkController::getBookmarkForActiveToken(Id tabId) const
|
||||
{
|
||||
if (!m_activeEdgeIds.empty())
|
||||
if (!m_activeEdgeIds[tabId].empty())
|
||||
{
|
||||
for (const std::shared_ptr<EdgeBookmark>& edgeBookmark: getAllEdgeBookmarks())
|
||||
{
|
||||
if (!m_activeNodeIds.empty() && edgeBookmark->getActiveNodeId() == m_activeNodeIds.front() &&
|
||||
utility::isPermutation(edgeBookmark->getEdgeIds(), m_activeEdgeIds))
|
||||
if (!m_activeNodeIds[tabId].empty() && edgeBookmark->getActiveNodeId() == m_activeNodeIds[tabId].front() &&
|
||||
utility::isPermutation(edgeBookmark->getEdgeIds(), m_activeEdgeIds[tabId]))
|
||||
{
|
||||
return std::make_shared<EdgeBookmark>(*(edgeBookmark.get()));
|
||||
}
|
||||
@@ -396,7 +420,7 @@ std::shared_ptr<Bookmark> BookmarkController::getBookmarkForActiveToken() const
|
||||
{
|
||||
for (const std::shared_ptr<NodeBookmark>& nodeBookmark: getAllNodeBookmarks())
|
||||
{
|
||||
if (utility::isPermutation(nodeBookmark->getNodeIds(), m_activeNodeIds))
|
||||
if (utility::isPermutation(nodeBookmark->getNodeIds(), m_activeNodeIds[tabId]))
|
||||
{
|
||||
return std::make_shared<NodeBookmark>(*(nodeBookmark.get()));
|
||||
}
|
||||
@@ -419,11 +443,6 @@ std::shared_ptr<Bookmark> BookmarkController::getBookmarkForNodeId(Id nodeId) co
|
||||
return std::shared_ptr<Bookmark>();
|
||||
}
|
||||
|
||||
bool BookmarkController::canCreateBookmark() const
|
||||
{
|
||||
return m_activeNodeIds.size() || m_activeEdgeIds.size();
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<Bookmark>> BookmarkController::getAllBookmarks() const
|
||||
{
|
||||
LOG_INFO("Retrieving all bookmarks");
|
||||
@@ -476,7 +495,7 @@ std::vector<std::shared_ptr<Bookmark>> BookmarkController::getBookmarks(
|
||||
std::vector<std::wstring> BookmarkController::getActiveNodeDisplayNames() const
|
||||
{
|
||||
std::vector<std::wstring> names;
|
||||
for (Id nodeId : m_activeNodeIds)
|
||||
for (Id nodeId : m_activeNodeIds[TabId::currentTab()])
|
||||
{
|
||||
names.push_back(getNodeDisplayName(nodeId));
|
||||
}
|
||||
@@ -486,7 +505,7 @@ std::vector<std::wstring> BookmarkController::getActiveNodeDisplayNames() const
|
||||
std::vector<std::wstring> BookmarkController::getActiveEdgeDisplayNames() const
|
||||
{
|
||||
std::vector<std::wstring> activeEdgeDisplayNames;
|
||||
for (Id activeEdgeId: m_activeEdgeIds)
|
||||
for (Id activeEdgeId: m_activeEdgeIds[TabId::currentTab()])
|
||||
{
|
||||
const StorageEdge activeEdge = m_storageAccess->getEdgeById(activeEdgeId);
|
||||
const std::wstring sourceDisplayName = getNodeDisplayName(activeEdge.sourceNodeId);
|
||||
|
||||
@@ -6,13 +6,17 @@
|
||||
#include "EdgeBookmark.h"
|
||||
|
||||
#include "MessageListener.h"
|
||||
#include "MessageActivateErrors.h"
|
||||
#include "MessageIndexingFinished.h"
|
||||
#include "MessageActivateAll.h"
|
||||
#include "MessageActivateBookmark.h"
|
||||
#include "MessageActivateErrors.h"
|
||||
#include "MessageActivateFullTextSearch.h"
|
||||
#include "MessageActivateLegend.h"
|
||||
#include "MessageActivateTokens.h"
|
||||
#include "MessageDisplayBookmarkCreator.h"
|
||||
#include "MessageDisplayBookmarks.h"
|
||||
#include "MessageBookmarkActivate.h"
|
||||
#include "MessageBookmarkBrowse.h"
|
||||
#include "MessageBookmarkCreate.h"
|
||||
#include "MessageBookmarkDelete.h"
|
||||
#include "MessageBookmarkEdit.h"
|
||||
#include "MessageIndexingFinished.h"
|
||||
|
||||
#include "Controller.h"
|
||||
|
||||
@@ -21,18 +25,22 @@ class StorageAccess;
|
||||
class BookmarkController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateBookmark>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateLegend>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageDisplayBookmarkCreator>
|
||||
, public MessageListener<MessageDisplayBookmarks>
|
||||
, public MessageListener<MessageBookmarkActivate>
|
||||
, public MessageListener<MessageBookmarkBrowse>
|
||||
, public MessageListener<MessageBookmarkCreate>
|
||||
, public MessageListener<MessageBookmarkDelete>
|
||||
, public MessageListener<MessageBookmarkEdit>
|
||||
, public MessageListener<MessageIndexingFinished>
|
||||
{
|
||||
public:
|
||||
BookmarkController(StorageAccess* storageAccess);
|
||||
virtual ~BookmarkController();
|
||||
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
void displayBookmarks();
|
||||
void displayBookmarksFor(Bookmark::BookmarkFilter filter, Bookmark::BookmarkOrder order);
|
||||
@@ -68,20 +76,24 @@ private:
|
||||
bool m_edgeBookmarksValid;
|
||||
};
|
||||
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateBookmark* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageDisplayBookmarkCreator* message);
|
||||
virtual void handleMessage(MessageDisplayBookmarks* message);
|
||||
virtual void handleMessage(MessageIndexingFinished* message);
|
||||
void handleMessage(MessageActivateAll* message) override;
|
||||
void handleMessage(MessageActivateErrors* message) override;
|
||||
void handleMessage(MessageActivateFullTextSearch* message) override;
|
||||
void handleMessage(MessageActivateLegend* message) override;
|
||||
void handleMessage(MessageActivateTokens* message) override;
|
||||
void handleMessage(MessageBookmarkActivate* message) override;
|
||||
void handleMessage(MessageBookmarkBrowse* message) override;
|
||||
void handleMessage(MessageBookmarkCreate* message) override;
|
||||
void handleMessage(MessageBookmarkDelete* message) override;
|
||||
void handleMessage(MessageBookmarkEdit* message) override;
|
||||
void handleMessage(MessageIndexingFinished* message) override;
|
||||
|
||||
std::vector<std::wstring> getActiveTokenDisplayNames() const;
|
||||
std::vector<std::wstring> getDisplayNamesForNodeId(Id nodeId) const;
|
||||
|
||||
std::vector<BookmarkCategory> getAllBookmarkCategories() const;
|
||||
|
||||
std::shared_ptr<Bookmark> getBookmarkForActiveToken() const;
|
||||
std::shared_ptr<Bookmark> getBookmarkForActiveToken(Id tabId) const;
|
||||
std::shared_ptr<Bookmark> getBookmarkForNodeId(Id nodeId) const;
|
||||
|
||||
bool canCreateBookmark() const;
|
||||
@@ -118,8 +130,8 @@ private:
|
||||
StorageAccess* m_storageAccess;
|
||||
mutable BookmarkCache m_bookmarkCache;
|
||||
|
||||
std::vector<Id> m_activeNodeIds;
|
||||
std::vector<Id> m_activeEdgeIds;
|
||||
mutable std::map<Id, std::vector<Id>> m_activeNodeIds;
|
||||
mutable std::map<Id, std::vector<Id>> m_activeEdgeIds;
|
||||
|
||||
Bookmark::BookmarkFilter m_filter;
|
||||
Bookmark::BookmarkOrder m_order;
|
||||
|
||||
@@ -20,8 +20,9 @@ CodeController::CodeController(StorageAccess* storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
CodeController::~CodeController()
|
||||
Id CodeController::getSchedulerId() const
|
||||
{
|
||||
return Controller::getTabId();
|
||||
}
|
||||
|
||||
const uint CodeController::s_lineRadius = 2;
|
||||
|
||||
@@ -58,33 +58,35 @@ class CodeController
|
||||
{
|
||||
public:
|
||||
CodeController(StorageAccess* storageAccess);
|
||||
~CodeController();
|
||||
virtual ~CodeController() = default;
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
|
||||
private:
|
||||
static const uint s_lineRadius;
|
||||
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateLegend* message);
|
||||
virtual void handleMessage(MessageActivateLocalSymbols* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageActivateTrailEdge* message);
|
||||
virtual void handleMessage(MessageChangeFileView* message);
|
||||
virtual void handleMessage(MessageCodeShowDefinition* message);
|
||||
virtual void handleMessage(MessageDeactivateEdge* message);
|
||||
virtual void handleMessage(MessageErrorCountClear* message);
|
||||
virtual void handleMessage(MessageFlushUpdates* message);
|
||||
virtual void handleMessage(MessageFocusIn* message);
|
||||
virtual void handleMessage(MessageFocusOut* message);
|
||||
virtual void handleMessage(MessageScrollCode* message);
|
||||
virtual void handleMessage(MessageScrollToLine* message);
|
||||
virtual void handleMessage(MessageShowError* message);
|
||||
virtual void handleMessage(MessageShowScope* message);
|
||||
void handleMessage(MessageActivateAll* message) override;
|
||||
void handleMessage(MessageActivateErrors* message) override;
|
||||
void handleMessage(MessageActivateFullTextSearch* message) override;
|
||||
void handleMessage(MessageActivateLegend* message) override;
|
||||
void handleMessage(MessageActivateLocalSymbols* message) override;
|
||||
void handleMessage(MessageActivateTokens* message) override;
|
||||
void handleMessage(MessageActivateTrailEdge* message) override;
|
||||
void handleMessage(MessageChangeFileView* message) override;
|
||||
void handleMessage(MessageCodeShowDefinition* message) override;
|
||||
void handleMessage(MessageDeactivateEdge* message) override;
|
||||
void handleMessage(MessageErrorCountClear* message) override;
|
||||
void handleMessage(MessageFlushUpdates* message) override;
|
||||
void handleMessage(MessageFocusIn* message) override;
|
||||
void handleMessage(MessageFocusOut* message) override;
|
||||
void handleMessage(MessageScrollCode* message) override;
|
||||
void handleMessage(MessageScrollToLine* message) override;
|
||||
void handleMessage(MessageShowError* message) override;
|
||||
void handleMessage(MessageShowScope* message) override;
|
||||
|
||||
CodeView* getView() const;
|
||||
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
std::vector<CodeSnippetParams> getSnippetsForFileWithState(const FilePath& filePath, CodeView::FileState state) const;
|
||||
std::vector<CodeSnippetParams> getSnippetsForActiveSourceLocations(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "component/controller/Controller.h"
|
||||
|
||||
Controller::Controller()
|
||||
: m_component(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -12,3 +13,13 @@ void Controller::setComponent(Component* component)
|
||||
{
|
||||
m_component = component;
|
||||
}
|
||||
|
||||
Id Controller::getTabId() const
|
||||
{
|
||||
if (m_component)
|
||||
{
|
||||
return m_component->getTabId();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
|
||||
virtual void clear() = 0;
|
||||
|
||||
Id getTabId() const;
|
||||
|
||||
protected:
|
||||
template <typename ViewType>
|
||||
ViewType* getView() const;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#include "ErrorController.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "DialogView.h"
|
||||
#include "StorageAccess.h"
|
||||
#include "Project.h"
|
||||
#include "ApplicationSettings.h"
|
||||
#include "DialogView.h"
|
||||
#include "Project.h"
|
||||
#include "StorageAccess.h"
|
||||
#include "TabId.h"
|
||||
|
||||
ErrorController::ErrorController(StorageAccess* storageAccess)
|
||||
: m_storageAccess(storageAccess)
|
||||
@@ -17,19 +18,19 @@ ErrorController::~ErrorController()
|
||||
|
||||
void ErrorController::errorFilterChanged(const ErrorFilter& filter)
|
||||
{
|
||||
if (m_activeFilePath.empty())
|
||||
if (m_tabActiveFilePath[TabId::currentTab()].empty())
|
||||
{
|
||||
MessageActivateErrors(filter).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageActivateErrors(filter, m_activeFilePath).dispatch();
|
||||
MessageActivateErrors(filter, m_tabActiveFilePath[TabId::currentTab()]).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
void ErrorController::showError(Id errorId)
|
||||
{
|
||||
if (!m_showsErrors)
|
||||
if (!m_tabShowsErrors[TabId::currentTab()])
|
||||
{
|
||||
errorFilterChanged(getView()->getErrorFilter());
|
||||
}
|
||||
@@ -39,15 +40,15 @@ void ErrorController::showError(Id errorId)
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateAll* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
m_tabShowsErrors[message->getSchedulerId()] = false;
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateErrors* message)
|
||||
{
|
||||
clear();
|
||||
|
||||
m_showsErrors = true;
|
||||
m_activeFilePath = message->file;
|
||||
m_tabShowsErrors[message->getSchedulerId()] = true;
|
||||
m_tabActiveFilePath[message->getSchedulerId()] = message->file;
|
||||
|
||||
ErrorView* view = getView();
|
||||
view->setErrorFilter(message->filter);
|
||||
@@ -60,12 +61,12 @@ void ErrorController::handleMessage(MessageActivateErrors* message)
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
m_tabShowsErrors[message->getSchedulerId()] = false;
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
m_tabShowsErrors[message->getSchedulerId()] = false;
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageErrorCountClear* message)
|
||||
@@ -178,9 +179,9 @@ ErrorView* ErrorController::getView() const
|
||||
|
||||
void ErrorController::clear()
|
||||
{
|
||||
m_showsErrors = false;
|
||||
m_errorCount = 0;
|
||||
m_activeFilePath = FilePath();
|
||||
m_tabShowsErrors.clear();
|
||||
m_tabActiveFilePath.clear();
|
||||
|
||||
getView()->clear();
|
||||
}
|
||||
@@ -193,13 +194,13 @@ bool ErrorController::showErrors(const ErrorFilter& filter, bool scrollTo)
|
||||
filterUnlimited.limit = 0;
|
||||
|
||||
std::vector<ErrorInfo> errors;
|
||||
if (m_activeFilePath.empty())
|
||||
if (m_tabActiveFilePath[TabId::currentTab()].empty())
|
||||
{
|
||||
errors = m_storageAccess->getErrorsLimited(filterUnlimited);
|
||||
}
|
||||
else
|
||||
{
|
||||
errors = m_storageAccess->getErrorsForFileLimited(filter, m_activeFilePath);
|
||||
errors = m_storageAccess->getErrorsForFileLimited(filter, m_tabActiveFilePath[TabId::currentTab()]);
|
||||
}
|
||||
|
||||
ErrorCountInfo errorCount(errors);
|
||||
|
||||
@@ -65,9 +65,10 @@ private:
|
||||
|
||||
StorageAccess* m_storageAccess;
|
||||
|
||||
bool m_showsErrors = false;
|
||||
size_t m_errorCount = 0;
|
||||
FilePath m_activeFilePath;
|
||||
|
||||
std::map<Id, bool> m_tabShowsErrors;
|
||||
std::map<Id, FilePath> m_tabActiveFilePath;
|
||||
};
|
||||
|
||||
#endif // ERROR_CONTROLLER_H
|
||||
|
||||
@@ -28,8 +28,9 @@ GraphController::GraphController(StorageAccess* storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
GraphController::~GraphController()
|
||||
Id GraphController::getSchedulerId() const
|
||||
{
|
||||
return Controller::getTabId();
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageActivateAll* message)
|
||||
|
||||
@@ -52,29 +52,31 @@ class GraphController
|
||||
{
|
||||
public:
|
||||
GraphController(StorageAccess* storageAccess);
|
||||
~GraphController();
|
||||
~GraphController() = default;
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateLegend* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageActivateTrail* message);
|
||||
virtual void handleMessage(MessageActivateTrailEdge* message);
|
||||
virtual void handleMessage(MessageFlushUpdates* message);
|
||||
virtual void handleMessage(MessageFocusIn* message);
|
||||
virtual void handleMessage(MessageFocusOut* message);
|
||||
virtual void handleMessage(MessageGraphNodeBundleSplit* message);
|
||||
virtual void handleMessage(MessageGraphNodeExpand* message);
|
||||
virtual void handleMessage(MessageGraphNodeHide* message);
|
||||
virtual void handleMessage(MessageGraphNodeMove* message);
|
||||
virtual void handleMessage(MessageScrollGraph* message);
|
||||
virtual void handleMessage(MessageShowReference* message);
|
||||
void handleMessage(MessageActivateAll* message) override;
|
||||
void handleMessage(MessageActivateErrors* message) override;
|
||||
void handleMessage(MessageActivateFullTextSearch* message) override;
|
||||
void handleMessage(MessageActivateLegend* message) override;
|
||||
void handleMessage(MessageActivateTokens* message) override;
|
||||
void handleMessage(MessageActivateTrail* message) override;
|
||||
void handleMessage(MessageActivateTrailEdge* message) override;
|
||||
void handleMessage(MessageFlushUpdates* message) override;
|
||||
void handleMessage(MessageFocusIn* message) override;
|
||||
void handleMessage(MessageFocusOut* message) override;
|
||||
void handleMessage(MessageGraphNodeBundleSplit* message) override;
|
||||
void handleMessage(MessageGraphNodeExpand* message) override;
|
||||
void handleMessage(MessageGraphNodeHide* message) override;
|
||||
void handleMessage(MessageGraphNodeMove* message) override;
|
||||
void handleMessage(MessageScrollGraph* message) override;
|
||||
void handleMessage(MessageShowReference* message) override;
|
||||
|
||||
GraphView* getView() const;
|
||||
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
void createDummyGraph(const std::shared_ptr<Graph> graph);
|
||||
void createDummyGraphAndSetActiveAndVisibility(
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "logging.h"
|
||||
#include "MessageActivateSourceLocations.h"
|
||||
#include "MessageActivateWindow.h"
|
||||
#include "MessagePingReceived.h"
|
||||
#include "MessageProjectNew.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "MessageActivateFile.h"
|
||||
#include "MessagePingReceived.h"
|
||||
#include "MessageTabOpenWith.h"
|
||||
|
||||
#include "StorageAccess.h"
|
||||
#include "SourceLocationFile.h"
|
||||
@@ -118,7 +117,7 @@ void IDECommunicationController::handleSetActiveTokenMessage(
|
||||
std::to_wstring(message.row) + L", col: " + std::to_wstring(message.column)
|
||||
).dispatch();
|
||||
|
||||
MessageActivateSourceLocations(selectedLocationIds).dispatch();
|
||||
MessageTabOpenWith(0, selectedLocationIds[0]).showNewTab(true).dispatch();
|
||||
MessageActivateWindow().dispatch();
|
||||
return;
|
||||
}
|
||||
@@ -126,7 +125,7 @@ void IDECommunicationController::handleSetActiveTokenMessage(
|
||||
|
||||
if (fileId > 0)
|
||||
{
|
||||
MessageActivateFile(filePath, message.row).dispatchImmediately();
|
||||
MessageTabOpenWith(filePath, message.row).showNewTab(true).dispatch();
|
||||
MessageActivateWindow().dispatch();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
|
||||
#include "ScreenSearchView.h"
|
||||
|
||||
ScreenSearchController::ScreenSearchController()
|
||||
{
|
||||
}
|
||||
|
||||
ScreenSearchController::~ScreenSearchController()
|
||||
{
|
||||
}
|
||||
|
||||
void ScreenSearchController::clear()
|
||||
{
|
||||
}
|
||||
@@ -54,15 +46,21 @@ void ScreenSearchController::addResponder(ScreenSearchResponder* responder)
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSearchController::removeResponder(ScreenSearchResponder* responder)
|
||||
{
|
||||
if (responder)
|
||||
{
|
||||
auto it = std::find(m_responders.begin(), m_responders.end(), responder);
|
||||
if (it != m_responders.end())
|
||||
{
|
||||
m_responders.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScreenSearchController::search(const std::wstring& query, const std::set<std::string>& responderNames)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_matchMutex);
|
||||
m_matches.clear();
|
||||
m_matchIndex = 0;
|
||||
}
|
||||
|
||||
getView<ScreenSearchView>()->setMatchCount(0);
|
||||
clearMatches();
|
||||
|
||||
for (ScreenSearchResponder* responder : m_responders)
|
||||
{
|
||||
@@ -75,10 +73,6 @@ void ScreenSearchController::search(const std::wstring& query, const std::set<st
|
||||
{
|
||||
responder->findMatches(this, query);
|
||||
}
|
||||
else
|
||||
{
|
||||
responder->clearMatches();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +127,8 @@ void ScreenSearchController::clearMatches()
|
||||
m_matchIndex = 0;
|
||||
}
|
||||
|
||||
getView<ScreenSearchView>()->setMatchCount(0);
|
||||
|
||||
for (ScreenSearchResponder* responder : m_responders)
|
||||
{
|
||||
responder->clearMatches();
|
||||
|
||||
@@ -13,19 +13,19 @@ class ScreenSearchController
|
||||
, public ScreenSearchSender
|
||||
{
|
||||
public:
|
||||
ScreenSearchController();
|
||||
virtual ~ScreenSearchController();
|
||||
virtual ~ScreenSearchController() = default;
|
||||
|
||||
// Controller implementation
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
// ScreenSearchSender implementation
|
||||
virtual void foundMatches(ScreenSearchResponder* responder, size_t matchCount);
|
||||
void foundMatches(ScreenSearchResponder* responder, size_t matchCount) override;
|
||||
void addResponder(ScreenSearchResponder* responder) override;
|
||||
void removeResponder(ScreenSearchResponder* responder) override;
|
||||
void clearMatches() override;
|
||||
|
||||
void addResponder(ScreenSearchResponder* responder);
|
||||
void search(const std::wstring& query, const std::set<std::string>& responderNames);
|
||||
void activateMatch(bool next);
|
||||
void clearMatches();
|
||||
|
||||
private:
|
||||
size_t getResponderId(ScreenSearchResponder* responder) const;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "SearchController.h"
|
||||
|
||||
#include "logging.h"
|
||||
#include "MessageTabState.h"
|
||||
#include "SearchView.h"
|
||||
#include "StorageAccess.h"
|
||||
#include "logging.h"
|
||||
#include "tracing.h"
|
||||
|
||||
SearchController::SearchController(StorageAccess* storageAccess)
|
||||
@@ -10,38 +11,37 @@ SearchController::SearchController(StorageAccess* storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
SearchController::~SearchController()
|
||||
Id SearchController::getSchedulerId() const
|
||||
{
|
||||
return Controller::getTabId();
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateAll* message)
|
||||
{
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
updateMatches(message);
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateErrors* message)
|
||||
{
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
updateMatches(message);
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
updateMatches(message);
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateLegend* message)
|
||||
{
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
updateMatches(message);
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
if (message->keepContent())
|
||||
if (!message->isEdge)
|
||||
{
|
||||
return;
|
||||
updateMatches(message, !message->keepContent());
|
||||
}
|
||||
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageFind* message)
|
||||
@@ -79,5 +79,22 @@ SearchView* SearchController::getView()
|
||||
|
||||
void SearchController::clear()
|
||||
{
|
||||
getView()->setMatches(std::vector<SearchMatch>());
|
||||
updateMatches(nullptr);
|
||||
}
|
||||
|
||||
void SearchController::updateMatches(MessageActivateBase* message, bool updateView)
|
||||
{
|
||||
std::vector<SearchMatch> matches;
|
||||
|
||||
if (message)
|
||||
{
|
||||
matches = message->getSearchMatches();
|
||||
}
|
||||
|
||||
if (updateView)
|
||||
{
|
||||
getView()->setMatches(matches);
|
||||
}
|
||||
|
||||
MessageTabState(Controller::getTabId(), matches).dispatch();
|
||||
}
|
||||
|
||||
@@ -26,20 +26,24 @@ class SearchController
|
||||
{
|
||||
public:
|
||||
SearchController(StorageAccess* storageAccess);
|
||||
~SearchController();
|
||||
~SearchController() = default;
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateLegend* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageFind* message);
|
||||
virtual void handleMessage(MessageSearchAutocomplete* message);
|
||||
void handleMessage(MessageActivateAll* message) override;
|
||||
void handleMessage(MessageActivateErrors* message) override;
|
||||
void handleMessage(MessageActivateFullTextSearch* message) override;
|
||||
void handleMessage(MessageActivateLegend* message) override;
|
||||
void handleMessage(MessageActivateTokens* message) override;
|
||||
void handleMessage(MessageFind* message) override;
|
||||
void handleMessage(MessageSearchAutocomplete* message) override;
|
||||
|
||||
SearchView* getView();
|
||||
|
||||
virtual void clear();
|
||||
void clear() override;
|
||||
|
||||
void updateMatches(MessageActivateBase* message, bool updateView = true);
|
||||
|
||||
StorageAccess* m_storageAccess;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
#include "TabsController.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "MessageFind.h"
|
||||
#include "MessageIndexingFinished.h"
|
||||
#include "MessageSearch.h"
|
||||
#include "MessageScrollToLine.h"
|
||||
#include "ScreenSearchInterfaces.h"
|
||||
#include "TabId.h"
|
||||
#include "TaskLambda.h"
|
||||
#include "TaskManager.h"
|
||||
#include "TaskScheduler.h"
|
||||
|
||||
TabsController::TabsController(
|
||||
ViewLayout* mainLayout,
|
||||
const ViewFactory* viewFactory,
|
||||
StorageAccess* storageAccess,
|
||||
ScreenSearchSender* screenSearchSender
|
||||
)
|
||||
: m_mainLayout(mainLayout)
|
||||
, m_viewFactory(viewFactory)
|
||||
, m_storageAccess(storageAccess)
|
||||
, m_screenSearchSender(screenSearchSender)
|
||||
{
|
||||
}
|
||||
|
||||
void TabsController::clear()
|
||||
{
|
||||
getView()->clear();
|
||||
|
||||
while (true)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_tabsMutex);
|
||||
if (m_tabs.empty())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
||||
}
|
||||
}
|
||||
|
||||
void TabsController::addTab(Id tabId, SearchMatch match)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_tabsMutex);
|
||||
|
||||
TaskManager::createScheduler(tabId)->startSchedulerLoopThreaded();
|
||||
|
||||
m_tabs.emplace(tabId, std::make_shared<Tab>(tabId, m_viewFactory, m_storageAccess, m_screenSearchSender));
|
||||
|
||||
if (match.isValid())
|
||||
{
|
||||
MessageSearch msg({ match }, NodeTypeSet::all());
|
||||
msg.setSchedulerId(tabId);
|
||||
msg.dispatch();
|
||||
|
||||
if (match.tokenIds.size() && std::get<0>(m_scrollToLine) == match.tokenIds[0])
|
||||
{
|
||||
MessageScrollToLine scrollMsg(std::get<1>(m_scrollToLine), std::get<2>(m_scrollToLine));
|
||||
scrollMsg.setSchedulerId(tabId);
|
||||
scrollMsg.dispatch();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageFind msg;
|
||||
msg.setSchedulerId(tabId);
|
||||
msg.dispatch();
|
||||
}
|
||||
|
||||
m_scrollToLine = std::make_tuple(0, FilePath(), 0);
|
||||
}
|
||||
|
||||
void TabsController::showTab(Id tabId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_tabsMutex);
|
||||
|
||||
auto it = m_tabs.find(tabId);
|
||||
if (it != m_tabs.end())
|
||||
{
|
||||
TabId::setCurrentTabId(tabId);
|
||||
it->second->setParentLayout(m_mainLayout);
|
||||
}
|
||||
else
|
||||
{
|
||||
TabId::setCurrentTabId(0);
|
||||
m_mainLayout->showOriginalViews();
|
||||
}
|
||||
|
||||
Task::dispatch(
|
||||
TabId::app(),
|
||||
std::make_shared<TaskLambda>(
|
||||
[this]()
|
||||
{
|
||||
m_screenSearchSender->clearMatches();
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void TabsController::removeTab(Id tabId)
|
||||
{
|
||||
// use app task scheduler thread to stop running tasks of tab
|
||||
Task::dispatch(
|
||||
TabId::background(),
|
||||
std::make_shared<TaskLambda>(
|
||||
[tabId, this]()
|
||||
{
|
||||
m_screenSearchSender->clearMatches();
|
||||
|
||||
TaskScheduler* scheduler = TaskManager::getScheduler(tabId).get();
|
||||
scheduler->terminateRunningTasks();
|
||||
scheduler->stopSchedulerLoop();
|
||||
|
||||
TaskManager::destroyScheduler(tabId);
|
||||
|
||||
getView()->destroyTab(tabId);
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
void TabsController::destroyTab(Id tabId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_tabsMutex);
|
||||
|
||||
// destroy the tab on the qt thread to allow view destruction
|
||||
m_tabs.erase(tabId);
|
||||
|
||||
if (m_tabs.empty() && Application::getInstance()->isProjectLoaded())
|
||||
{
|
||||
MessageTabOpen().dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
void TabsController::onClearTabs()
|
||||
{
|
||||
TabId::setCurrentTabId(0);
|
||||
m_mainLayout->showOriginalViews();
|
||||
}
|
||||
|
||||
TabsView* TabsController::getView() const
|
||||
{
|
||||
return Controller::getView<TabsView>();
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageIndexingFinished* message)
|
||||
{
|
||||
if (m_tabs.empty() && Application::getInstance()->isProjectLoaded())
|
||||
{
|
||||
MessageTabOpenWith(SearchMatch::createCommand(SearchMatch::COMMAND_ALL)).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageTabClose* message)
|
||||
{
|
||||
getView()->closeTab();
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageTabOpen* message)
|
||||
{
|
||||
if (Application::getInstance()->isProjectLoaded())
|
||||
{
|
||||
getView()->openTab(true, SearchMatch());
|
||||
}
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageTabOpenWith* message)
|
||||
{
|
||||
if (!Application::getInstance()->isProjectLoaded())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SearchMatch match = message->match;
|
||||
if (!match.isValid())
|
||||
{
|
||||
Id tokenId = message->tokenId;
|
||||
if (!tokenId && message->locationId)
|
||||
{
|
||||
std::vector<Id> tokenIds = m_storageAccess->getNodeIdsForLocationIds({ message->locationId });
|
||||
if (tokenIds.size())
|
||||
{
|
||||
tokenId = tokenIds[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (!tokenId && !message->filePath.empty())
|
||||
{
|
||||
tokenId = m_storageAccess->getNodeIdForFileNode(message->filePath);
|
||||
|
||||
if (message->line)
|
||||
{
|
||||
m_scrollToLine = std::make_tuple(tokenId, message->filePath, message->line);
|
||||
}
|
||||
}
|
||||
|
||||
if (tokenId)
|
||||
{
|
||||
std::vector<SearchMatch> matches = m_storageAccess->getSearchMatchesForTokenIds({ tokenId });
|
||||
if (matches.size())
|
||||
{
|
||||
match = matches[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (match.isValid())
|
||||
{
|
||||
getView()->openTab(message->showTab, match);
|
||||
}
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageTabSelect* message)
|
||||
{
|
||||
getView()->selectTab(message->next);
|
||||
}
|
||||
|
||||
void TabsController::handleMessage(MessageTabState* message)
|
||||
{
|
||||
getView()->updateTab(message->tabId, message->searchMatches);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#ifndef TABS_CONTROLLER_H
|
||||
#define TABS_CONTROLLER_H
|
||||
|
||||
#include "MessageListener.h"
|
||||
#include "MessageIndexingFinished.h"
|
||||
#include "MessageTabClose.h"
|
||||
#include "MessageTabOpen.h"
|
||||
#include "MessageTabOpenWith.h"
|
||||
#include "MessageTabSelect.h"
|
||||
#include "MessageTabState.h"
|
||||
|
||||
#include "Controller.h"
|
||||
#include "Tab.h"
|
||||
#include "TabsView.h"
|
||||
|
||||
struct SearchMatch;
|
||||
|
||||
class StorageAccess;
|
||||
class ViewFactory;
|
||||
class ViewLayout;
|
||||
|
||||
class TabsController
|
||||
: public Controller
|
||||
, public MessageListener<MessageIndexingFinished>
|
||||
, public MessageListener<MessageTabClose>
|
||||
, public MessageListener<MessageTabOpen>
|
||||
, public MessageListener<MessageTabOpenWith>
|
||||
, public MessageListener<MessageTabSelect>
|
||||
, public MessageListener<MessageTabState>
|
||||
{
|
||||
public:
|
||||
TabsController(
|
||||
ViewLayout* mainLayout,
|
||||
const ViewFactory* viewFactory,
|
||||
StorageAccess* storageAccess,
|
||||
ScreenSearchSender* screenSearchSender
|
||||
);
|
||||
|
||||
// Controller implementation
|
||||
virtual void clear();
|
||||
|
||||
void addTab(Id tabId, SearchMatch match);
|
||||
void showTab(Id tabId);
|
||||
void removeTab(Id tabId);
|
||||
void destroyTab(Id tabId);
|
||||
void onClearTabs();
|
||||
|
||||
private:
|
||||
virtual void handleMessage(MessageIndexingFinished* message);
|
||||
virtual void handleMessage(MessageTabClose* message);
|
||||
virtual void handleMessage(MessageTabOpen* message);
|
||||
virtual void handleMessage(MessageTabOpenWith* message);
|
||||
virtual void handleMessage(MessageTabSelect* message);
|
||||
virtual void handleMessage(MessageTabState* message);
|
||||
|
||||
TabsView* getView() const;
|
||||
|
||||
ViewLayout* m_mainLayout;
|
||||
const ViewFactory* m_viewFactory;
|
||||
StorageAccess* m_storageAccess;
|
||||
ScreenSearchSender* m_screenSearchSender;
|
||||
|
||||
std::map<Id, std::shared_ptr<Tab>> m_tabs;
|
||||
std::mutex m_tabsMutex;
|
||||
|
||||
std::tuple<Id, FilePath, size_t> m_scrollToLine;
|
||||
};
|
||||
|
||||
#endif // TABS_CONTROLLER_H
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "StorageAccess.h"
|
||||
|
||||
#include "MessageActivateSourceLocations.h"
|
||||
#include "TabId.h"
|
||||
#include "TaskDecoratorDelay.h"
|
||||
#include "TaskLambda.h"
|
||||
|
||||
@@ -143,7 +144,7 @@ void TooltipController::requestTooltipShow(const std::vector<Id> tokenIds, Toolt
|
||||
delayMS = 300;
|
||||
}
|
||||
|
||||
Task::dispatch(std::make_shared<TaskDecoratorDelay>(delayMS)->addChildTask(
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskDecoratorDelay>(delayMS)->addChildTask(
|
||||
std::make_shared<TaskLambda>(
|
||||
[requestId, this]()
|
||||
{
|
||||
@@ -180,7 +181,7 @@ void TooltipController::requestTooltipHide()
|
||||
}
|
||||
m_hideRequest = true;
|
||||
|
||||
Task::dispatch(std::make_shared<TaskDecoratorDelay>(500)->addChildTask(
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskDecoratorDelay>(500)->addChildTask(
|
||||
std::make_shared<TaskLambda>(
|
||||
[this]()
|
||||
{
|
||||
|
||||
@@ -15,8 +15,9 @@ UndoRedoController::UndoRedoController(StorageAccess* storageAccess)
|
||||
m_iterator = m_list.end();
|
||||
}
|
||||
|
||||
UndoRedoController::~UndoRedoController()
|
||||
Id UndoRedoController::getSchedulerId() const
|
||||
{
|
||||
return Controller::getTabId();
|
||||
}
|
||||
|
||||
UndoRedoView* UndoRedoController::getView()
|
||||
@@ -269,7 +270,10 @@ void UndoRedoController::handleMessage(MessageHistoryToPosition* message)
|
||||
else
|
||||
{
|
||||
replayCommand(m_iterator);
|
||||
MessageFlushUpdates(false).dispatch();
|
||||
|
||||
MessageFlushUpdates msg(false);
|
||||
msg.setSchedulerId(getSchedulerId());
|
||||
msg.dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +363,9 @@ void UndoRedoController::handleMessage(MessageRefreshUI* message)
|
||||
{
|
||||
if (m_iterator == m_list.begin())
|
||||
{
|
||||
MessageActivateAll().dispatch();
|
||||
MessageActivateAll msg;
|
||||
msg.setSchedulerId(getSchedulerId());
|
||||
msg.dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -466,7 +472,9 @@ void UndoRedoController::replayCommands(std::list<Command>::iterator it)
|
||||
std::advance(it, 1);
|
||||
}
|
||||
|
||||
MessageFlushUpdates(keepsContent).dispatch();
|
||||
MessageFlushUpdates msg(keepsContent);
|
||||
msg.setSchedulerId(getSchedulerId());
|
||||
msg.dispatch();
|
||||
}
|
||||
|
||||
void UndoRedoController::replayCommand(std::list<Command>::iterator it)
|
||||
@@ -512,6 +520,7 @@ void UndoRedoController::replayCommand(std::list<Command>::iterator it)
|
||||
filter.unindexedFatal = false;
|
||||
|
||||
MessageActivateErrors msg(filter);
|
||||
msg.setSchedulerId(getSchedulerId());
|
||||
msg.setIsReplayed(true);
|
||||
msg.setIsLast(it == std::prev(m_iterator));
|
||||
msg.dispatch();
|
||||
@@ -608,34 +617,7 @@ MessageBase* UndoRedoController::lastMessage() const
|
||||
|
||||
void UndoRedoController::updateHistoryMenu(std::shared_ptr<MessageBase> message)
|
||||
{
|
||||
const size_t historyMenuSize = 20;
|
||||
|
||||
if (message && dynamic_cast<MessageActivateBase*>(message.get()))
|
||||
{
|
||||
std::vector<SearchMatch> matches = dynamic_cast<MessageActivateBase*>(message.get())->getSearchMatches();
|
||||
if (matches.size() && !matches[0].text.empty())
|
||||
{
|
||||
std::vector<std::shared_ptr<MessageBase>> history = { message };
|
||||
std::set<SearchMatch> uniqueMatches = { matches[0] };
|
||||
|
||||
for (std::shared_ptr<MessageBase> m : m_history)
|
||||
{
|
||||
if (uniqueMatches.insert(dynamic_cast<MessageActivateBase*>(m.get())->getSearchMatches()[0]).second)
|
||||
{
|
||||
history.push_back(m);
|
||||
|
||||
if (history.size() >= historyMenuSize)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_history = history;
|
||||
}
|
||||
}
|
||||
|
||||
Application::getInstance()->updateHistoryMenu(m_history);
|
||||
Application::getInstance()->updateHistoryMenu(message);
|
||||
}
|
||||
|
||||
void UndoRedoController::updateHistory()
|
||||
|
||||
@@ -66,7 +66,9 @@ class UndoRedoController
|
||||
{
|
||||
public:
|
||||
UndoRedoController(StorageAccess* storageAccess);
|
||||
virtual ~UndoRedoController();
|
||||
virtual ~UndoRedoController() = default;
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
|
||||
UndoRedoView* getView();
|
||||
|
||||
|
||||
@@ -11,8 +11,9 @@ template <typename ControllerType>
|
||||
class ControllerProxy
|
||||
{
|
||||
public:
|
||||
ControllerProxy(View* view)
|
||||
ControllerProxy(View* view, Id schedulerId)
|
||||
: m_view(view)
|
||||
, m_schedulerId(schedulerId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -30,7 +31,7 @@ public:
|
||||
ControllerType* controller = m_view->getController<ControllerType>();
|
||||
if (controller)
|
||||
{
|
||||
Task::dispatch(std::make_shared<TaskLambda>(
|
||||
Task::dispatch(m_schedulerId, std::make_shared<TaskLambda>(
|
||||
std::bind(callback, controller)
|
||||
));
|
||||
}
|
||||
@@ -42,7 +43,7 @@ public:
|
||||
ControllerType* controller = m_view->getController<ControllerType>();
|
||||
if (controller)
|
||||
{
|
||||
Task::dispatch(std::make_shared<TaskLambda>(
|
||||
Task::dispatch(m_schedulerId, std::make_shared<TaskLambda>(
|
||||
[func = std::bind(callback, controller, args...)]()
|
||||
{
|
||||
func();
|
||||
@@ -53,6 +54,7 @@ public:
|
||||
|
||||
private:
|
||||
View* m_view;
|
||||
Id m_schedulerId;
|
||||
};
|
||||
|
||||
#endif // CONTROLLER_PROXY_H
|
||||
|
||||
@@ -6,15 +6,20 @@ class ScreenSearchResponder;
|
||||
class ScreenSearchSender
|
||||
{
|
||||
public:
|
||||
virtual ~ScreenSearchSender() {}
|
||||
virtual ~ScreenSearchSender() = default;
|
||||
|
||||
virtual void foundMatches(ScreenSearchResponder* responder, size_t matchCount) = 0;
|
||||
|
||||
virtual void addResponder(ScreenSearchResponder* responder) = 0;
|
||||
virtual void removeResponder(ScreenSearchResponder* responder) = 0;
|
||||
|
||||
virtual void clearMatches() = 0;
|
||||
};
|
||||
|
||||
class ScreenSearchResponder
|
||||
{
|
||||
public:
|
||||
virtual ~ScreenSearchResponder() {}
|
||||
virtual ~ScreenSearchResponder() = default;
|
||||
|
||||
virtual std::string getName() const = 0;
|
||||
virtual bool isVisible() const = 0;
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#include "BookmarkButtonsView.h"
|
||||
|
||||
BookmarkButtonsView::BookmarkButtonsView(ViewLayout* viewLayout)
|
||||
: View(viewLayout)
|
||||
, m_schedulerId(0)
|
||||
{
|
||||
}
|
||||
|
||||
std::string BookmarkButtonsView::getName() const
|
||||
{
|
||||
return "BookmarkButtons";
|
||||
}
|
||||
|
||||
Id BookmarkButtonsView::getSchedulerId() const
|
||||
{
|
||||
return m_schedulerId;
|
||||
}
|
||||
|
||||
void BookmarkButtonsView::setTabId(Id schedulerId)
|
||||
{
|
||||
m_schedulerId = schedulerId;
|
||||
}
|
||||
|
||||
void BookmarkButtonsView::handleMessage(MessageBookmarkButtonState* message)
|
||||
{
|
||||
setCreateButtonState(message->state);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef BOOKMARK_BUTTONS_VIEW_H
|
||||
#define BOOKMARK_BUTTONS_VIEW_H
|
||||
|
||||
#include "MessageBookmarkButtonState.h"
|
||||
#include "MessageListener.h"
|
||||
#include "View.h"
|
||||
|
||||
class BookmarkButtonsView
|
||||
: public View
|
||||
, public MessageListener<MessageBookmarkButtonState>
|
||||
{
|
||||
public:
|
||||
BookmarkButtonsView(ViewLayout* viewLayout);
|
||||
virtual ~BookmarkButtonsView() = default;
|
||||
|
||||
std::string getName() const override;
|
||||
|
||||
Id getSchedulerId() const override;
|
||||
void setTabId(Id schedulerId);
|
||||
|
||||
virtual void setCreateButtonState(const MessageBookmarkButtonState::ButtonState& state) = 0;
|
||||
|
||||
private:
|
||||
void handleMessage(MessageBookmarkButtonState* message) override;
|
||||
|
||||
Id m_schedulerId;
|
||||
};
|
||||
|
||||
#endif // BOOKMARK_BUTTONS_VIEW_H
|
||||
@@ -7,10 +7,6 @@ BookmarkView::BookmarkView(ViewLayout* viewLayout)
|
||||
{
|
||||
}
|
||||
|
||||
BookmarkView::~BookmarkView()
|
||||
{
|
||||
}
|
||||
|
||||
std::string BookmarkView::getName() const
|
||||
{
|
||||
return "BookmarkView";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef BOOKMARK_VIEW_H
|
||||
#define BOOKMARK_VIEW_H
|
||||
|
||||
#include "View.h"
|
||||
#include "Bookmark.h"
|
||||
#include "View.h"
|
||||
|
||||
class BookmarkController;
|
||||
|
||||
@@ -11,25 +11,15 @@ class BookmarkView
|
||||
{
|
||||
public:
|
||||
BookmarkView(ViewLayout* viewLayout);
|
||||
virtual ~BookmarkView();
|
||||
virtual ~BookmarkView() = default;
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
enum CreateButtonState
|
||||
{
|
||||
CAN_CREATE = 0,
|
||||
CANNOT_CREATE,
|
||||
ALREADY_CREATED
|
||||
};
|
||||
|
||||
virtual void setCreateButtonState(const CreateButtonState& state) = 0;
|
||||
|
||||
virtual void displayBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks) = 0;
|
||||
virtual void displayBookmarkEditor(
|
||||
std::shared_ptr<Bookmark> bookmark, const std::vector<BookmarkCategory>& categories) = 0;
|
||||
virtual void displayBookmarkCreator(
|
||||
const std::vector<std::wstring>& names, const std::vector<BookmarkCategory>& categories, Id nodeId) = 0;
|
||||
virtual void enableDisplayBookmarks(bool enable) = 0;
|
||||
|
||||
virtual bool bookmarkBrowserIsVisible() const = 0;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
virtual bool hasSingleFileCached(const FilePath& filePath) const = 0;
|
||||
|
||||
private:
|
||||
protected:
|
||||
CodeController* getController();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,9 +1,35 @@
|
||||
#include "MainView.h"
|
||||
|
||||
MainView::MainView()
|
||||
#include "TabId.h"
|
||||
|
||||
MainView::MainView(const ViewFactory* viewFactory, StorageAccess* storageAccess)
|
||||
: m_componentManager(viewFactory, storageAccess)
|
||||
{
|
||||
}
|
||||
|
||||
MainView::~MainView()
|
||||
void MainView::setup()
|
||||
{
|
||||
m_componentManager.setupMain(this, TabId::app());
|
||||
|
||||
loadLayout();
|
||||
|
||||
m_componentManager.refreshViews();
|
||||
}
|
||||
|
||||
void MainView::clear()
|
||||
{
|
||||
m_componentManager.clearComponents();
|
||||
clearHistoryMenu();
|
||||
clearBookmarksMenu();
|
||||
}
|
||||
|
||||
void MainView::refreshViews()
|
||||
{
|
||||
refreshView();
|
||||
m_componentManager.refreshViews();
|
||||
}
|
||||
|
||||
std::shared_ptr<DialogView> MainView::getDialogView(DialogView::UseCase useCase)
|
||||
{
|
||||
return m_componentManager.getDialogView(useCase);
|
||||
}
|
||||
|
||||
@@ -5,18 +5,27 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ComponentManager.h"
|
||||
#include "DialogView.h"
|
||||
#include "ViewLayout.h"
|
||||
|
||||
struct SearchMatch;
|
||||
class Bookmark;
|
||||
class MessageBase;
|
||||
class StorageAccess;
|
||||
class ViewFactory;
|
||||
|
||||
class MainView
|
||||
: public ViewLayout
|
||||
{
|
||||
public:
|
||||
MainView();
|
||||
virtual ~MainView();
|
||||
MainView(const ViewFactory* viewFactory, StorageAccess* storageAccess);
|
||||
virtual ~MainView() = default;
|
||||
|
||||
void setup();
|
||||
void clear();
|
||||
void refreshViews();
|
||||
|
||||
std::shared_ptr<DialogView> getDialogView(DialogView::UseCase useCase);
|
||||
|
||||
virtual void loadLayout() = 0;
|
||||
virtual void saveLayout() = 0;
|
||||
@@ -30,8 +39,15 @@ public:
|
||||
virtual void activateWindow() = 0;
|
||||
|
||||
virtual void updateRecentProjectMenu() = 0;
|
||||
virtual void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems) = 0;
|
||||
|
||||
virtual void updateHistoryMenu(std::shared_ptr<MessageBase> message) = 0;
|
||||
virtual void clearHistoryMenu() = 0;
|
||||
|
||||
virtual void updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>>& bookmarks) = 0;
|
||||
virtual void clearBookmarksMenu() = 0;
|
||||
|
||||
protected:
|
||||
ComponentManager m_componentManager;
|
||||
};
|
||||
|
||||
#endif // MAIN_VIEW_H
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "TabsView.h"
|
||||
|
||||
TabsView::TabsView(ViewLayout* viewLayout)
|
||||
: View(viewLayout)
|
||||
{
|
||||
}
|
||||
|
||||
std::string TabsView::getName() const
|
||||
{
|
||||
return "Tabs";
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
#ifndef TABS_VIEW_H
|
||||
#define TABS_VIEW_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "View.h"
|
||||
|
||||
struct SearchMatch;
|
||||
|
||||
class TabsView
|
||||
: public View
|
||||
{
|
||||
public:
|
||||
TabsView(ViewLayout* viewLayout);
|
||||
virtual ~TabsView() = default;
|
||||
|
||||
virtual std::string getName() const;
|
||||
|
||||
virtual void clear() = 0;
|
||||
|
||||
virtual void openTab(bool showTab, SearchMatch match) = 0;
|
||||
virtual void closeTab() = 0;
|
||||
virtual void destroyTab(Id tabId) = 0;
|
||||
virtual void selectTab(bool next) = 0;
|
||||
virtual void updateTab(Id tabId, std::vector<SearchMatch> matches) = 0;
|
||||
};
|
||||
|
||||
#endif // TABS_VIEW_H
|
||||
@@ -3,16 +3,12 @@
|
||||
#include "ViewWidgetWrapper.h"
|
||||
|
||||
View::View(ViewLayout* viewLayout)
|
||||
: m_viewLayout(viewLayout)
|
||||
: m_component(nullptr)
|
||||
, m_viewLayout(viewLayout)
|
||||
, m_widgetWrapper(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
View::~View()
|
||||
{
|
||||
m_viewLayout->removeView(this);
|
||||
}
|
||||
|
||||
void View::init()
|
||||
{
|
||||
createWidgetWrapper();
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
static std::shared_ptr<T> createAndInit(ViewLayout* viewLayout);
|
||||
|
||||
View(ViewLayout* viewLayout);
|
||||
virtual ~View();
|
||||
virtual ~View() = default;
|
||||
|
||||
virtual std::string getName() const = 0;
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#include "ViewFactory.h"
|
||||
|
||||
ViewFactory::ViewFactory()
|
||||
{
|
||||
}
|
||||
@@ -6,10 +6,12 @@
|
||||
#include "CompositeView.h"
|
||||
#include "DialogView.h"
|
||||
|
||||
class BookmarkButtonsView;
|
||||
class BookmarkView;
|
||||
class CodeView;
|
||||
class ErrorView;
|
||||
class GraphView;
|
||||
class GraphViewStyleImpl;
|
||||
class MainView;
|
||||
class RefreshView;
|
||||
class ScreenSearchView;
|
||||
@@ -18,6 +20,7 @@ class StatusBarView;
|
||||
class StatusView;
|
||||
class StorageAccess;
|
||||
class TabbedView;
|
||||
class TabsView;
|
||||
class TooltipView;
|
||||
class UndoRedoView;
|
||||
class ViewLayout;
|
||||
@@ -25,14 +28,14 @@ class ViewLayout;
|
||||
class ViewFactory
|
||||
{
|
||||
public:
|
||||
ViewFactory();
|
||||
virtual ~ViewFactory() = default;
|
||||
|
||||
virtual std::shared_ptr<MainView> createMainView() const = 0;
|
||||
virtual std::shared_ptr<MainView> createMainView(StorageAccess* storageAccess) const = 0;
|
||||
virtual std::shared_ptr<CompositeView> createCompositeView(
|
||||
ViewLayout* viewLayout, CompositeView::CompositeDirection direction, const std::string& name) const = 0;
|
||||
virtual std::shared_ptr<TabbedView> createTabbedView(ViewLayout* viewLayout, const std::string& name) const = 0;
|
||||
|
||||
virtual std::shared_ptr<BookmarkButtonsView> createBookmarkButtonsView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<BookmarkView> createBookmarkView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<CodeView> createCodeView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<ErrorView> createErrorView(ViewLayout* viewLayout) const = 0;
|
||||
@@ -42,11 +45,14 @@ public:
|
||||
virtual std::shared_ptr<SearchView> createSearchView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<StatusBarView> createStatusBarView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<StatusView> createStatusView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<TabsView> createTabsView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<TooltipView> createTooltipView(ViewLayout* viewLayout) const = 0;
|
||||
virtual std::shared_ptr<UndoRedoView> createUndoRedoView(ViewLayout* viewLayout) const = 0;
|
||||
|
||||
virtual std::shared_ptr<DialogView> createDialogView(
|
||||
ViewLayout* viewLayout, DialogView::UseCase useCase, StorageAccess* storageAccess) const = 0;
|
||||
|
||||
virtual std::shared_ptr<GraphViewStyleImpl> createGraphStyleImpl() const = 0;
|
||||
};
|
||||
|
||||
#endif // VIEW_FACTORY_H
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include "ViewLayout.h"
|
||||
|
||||
ViewLayout::ViewLayout()
|
||||
{
|
||||
}
|
||||
|
||||
ViewLayout::~ViewLayout()
|
||||
void ViewLayout::overrideView(View* view)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -12,3 +8,7 @@ View* ViewLayout::findFloatingView(const std::string& name) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ViewLayout::showOriginalViews()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ class View;
|
||||
class ViewLayout
|
||||
{
|
||||
public:
|
||||
ViewLayout();
|
||||
virtual ~ViewLayout();
|
||||
virtual ~ViewLayout() = default;
|
||||
|
||||
virtual void addView(View* view) = 0;
|
||||
virtual void overrideView(View* view);
|
||||
virtual void removeView(View* view) = 0;
|
||||
|
||||
virtual void showView(View* view) = 0;
|
||||
@@ -20,6 +20,8 @@ public:
|
||||
virtual void setViewEnabled(View* view, bool enabled) = 0;
|
||||
|
||||
virtual View* findFloatingView(const std::string& name) const;
|
||||
|
||||
virtual void showOriginalViews();
|
||||
};
|
||||
|
||||
#endif // VIEW_LAYOUT_H
|
||||
|
||||
@@ -513,18 +513,21 @@ std::shared_ptr<SourceLocationCollection> PersistentStorage::getFullTextSearchLo
|
||||
{
|
||||
TRACE();
|
||||
|
||||
const TextCodec codec(ApplicationSettings::getInstance()->getTextEncoding());
|
||||
|
||||
std::shared_ptr<SourceLocationCollection> collection = std::make_shared<SourceLocationCollection>();
|
||||
if (searchTerm.empty())
|
||||
{
|
||||
return collection;
|
||||
}
|
||||
|
||||
if (m_fullTextSearchCodec != codec.getName())
|
||||
const TextCodec codec(ApplicationSettings::getInstance()->getTextEncoding());
|
||||
{
|
||||
MessageStatus(L"Building fulltext search index", false, true).dispatch();
|
||||
buildFullTextSearchIndex();
|
||||
std::lock_guard<std::mutex> lock(m_fullTextSearchMutex);
|
||||
|
||||
if (m_fullTextSearchCodec != codec.getName())
|
||||
{
|
||||
MessageStatus(L"Building fulltext search index", false, true).dispatch();
|
||||
buildFullTextSearchIndex();
|
||||
}
|
||||
}
|
||||
|
||||
MessageStatus(
|
||||
|
||||
@@ -212,6 +212,7 @@ private:
|
||||
|
||||
mutable FullTextSearchIndex m_fullTextSearchIndex;
|
||||
mutable std::string m_fullTextSearchCodec;
|
||||
mutable std::mutex m_fullTextSearchMutex;
|
||||
|
||||
SqliteIndexStorage m_sqliteIndexStorage;
|
||||
SqliteBookmarkStorage m_sqliteBookmarkStorage;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "MessageIndexingStatus.h"
|
||||
#include "MessageRefresh.h"
|
||||
#include "MessageStatus.h"
|
||||
#include "TabId.h"
|
||||
#include "TaskDecoratorRepeat.h"
|
||||
#include "TaskFindKeyOnBlackboard.h"
|
||||
#include "TaskGroupSelector.h"
|
||||
@@ -71,6 +72,23 @@ std::string Project::getDescription() const
|
||||
return m_settings->getDescription();
|
||||
}
|
||||
|
||||
bool Project::isLoaded() const
|
||||
{
|
||||
switch (m_state)
|
||||
{
|
||||
case PROJECT_STATE_EMPTY:
|
||||
case PROJECT_STATE_LOADED:
|
||||
case PROJECT_STATE_OUTDATED:
|
||||
case PROJECT_STATE_NEEDS_MIGRATION:
|
||||
return true;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Project::isIndexing() const
|
||||
{
|
||||
return m_refreshStage == RefreshStageType::INDEXING;
|
||||
@@ -238,8 +256,6 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
return;
|
||||
}
|
||||
|
||||
m_refreshStage = RefreshStageType::REFRESHING;
|
||||
|
||||
if (m_state == PROJECT_STATE_NOT_LOADED)
|
||||
{
|
||||
return;
|
||||
@@ -312,6 +328,8 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
}
|
||||
}
|
||||
|
||||
m_refreshStage = RefreshStageType::REFRESHING;
|
||||
|
||||
if (m_state == PROJECT_STATE_NEEDS_MIGRATION)
|
||||
{
|
||||
m_settings->migrate();
|
||||
@@ -324,6 +342,7 @@ void Project::refresh(RefreshMode refreshMode, std::shared_ptr<DialogView> dialo
|
||||
{
|
||||
if (!sourceGroup->prepareIndexing())
|
||||
{
|
||||
m_refreshStage = RefreshStageType::NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -554,7 +573,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
std::make_shared<TaskFindKeyOnBlackboard>("keep_database"),
|
||||
std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
Task::dispatch(std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskLambda>([dialogView, this]() {
|
||||
swapToTempStorage(dialogView);
|
||||
}));
|
||||
})
|
||||
@@ -562,7 +581,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
std::make_shared<TaskGroupSequence>()->addChildTasks(
|
||||
std::make_shared<TaskFindKeyOnBlackboard>("discard_database"),
|
||||
std::make_shared<TaskLambda>([this]() {
|
||||
Task::dispatch(std::make_shared<TaskLambda>([this]() {
|
||||
Task::dispatch(TabId::app(), std::make_shared<TaskLambda>([this]() {
|
||||
discardTempStorage();
|
||||
}));
|
||||
})
|
||||
@@ -575,7 +594,7 @@ void Project::buildIndex(const RefreshInfo& info, std::shared_ptr<DialogView> di
|
||||
}));
|
||||
|
||||
taskSequential->setIsBackgroundTask(true);
|
||||
Task::dispatch(taskSequential);
|
||||
Task::dispatch(TabId::app(), taskSequential);
|
||||
|
||||
m_refreshStage = RefreshStageType::INDEXING;
|
||||
MessageIndexingStarted().dispatch();
|
||||
|
||||
@@ -30,6 +30,7 @@ public:
|
||||
FilePath getProjectSettingsFilePath() const;
|
||||
std::string getDescription() const;
|
||||
|
||||
bool isLoaded() const;
|
||||
bool isIndexing() const;
|
||||
|
||||
bool settingsEqualExceptNameAndLocation(const ProjectSettings& otherSettings) const;
|
||||
|
||||
@@ -12,6 +12,7 @@ class MessageBase
|
||||
public:
|
||||
MessageBase()
|
||||
: m_id(s_nextId++)
|
||||
, m_schedulerId(0)
|
||||
, m_isParallel(false)
|
||||
, m_isReplayed(false)
|
||||
, m_sendAsTask(true)
|
||||
@@ -21,9 +22,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~MessageBase()
|
||||
{
|
||||
}
|
||||
virtual ~MessageBase() = default;
|
||||
|
||||
virtual std::string getType() const = 0;
|
||||
virtual void dispatch() = 0;
|
||||
@@ -33,6 +32,16 @@ public:
|
||||
return m_id;
|
||||
}
|
||||
|
||||
Id getSchedulerId() const
|
||||
{
|
||||
return m_schedulerId;
|
||||
}
|
||||
|
||||
void setSchedulerId(Id schedulerId)
|
||||
{
|
||||
m_schedulerId = schedulerId;
|
||||
}
|
||||
|
||||
bool sendAsTask() const
|
||||
{
|
||||
return m_sendAsTask;
|
||||
@@ -107,6 +116,7 @@ private:
|
||||
static Id s_nextId;
|
||||
|
||||
Id m_id;
|
||||
Id m_schedulerId;
|
||||
|
||||
bool m_isParallel;
|
||||
bool m_isReplayed;
|
||||
|
||||
@@ -53,6 +53,11 @@ public:
|
||||
m_alive = false;
|
||||
}
|
||||
|
||||
virtual Id getSchedulerId() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual std::string doGetType() const = 0;
|
||||
virtual void doHandleMessageBase(MessageBase*) = 0;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "TaskGroupParallel.h"
|
||||
#include "TaskGroupSequence.h"
|
||||
#include "TaskLambda.h"
|
||||
#include "TabId.h"
|
||||
|
||||
std::shared_ptr<MessageQueue> MessageQueue::getInstance()
|
||||
{
|
||||
@@ -252,7 +253,9 @@ void MessageQueue::sendMessage(std::shared_ptr<MessageBase> message)
|
||||
{
|
||||
MessageListenerBase* listener = m_listeners[m_currentListenerIndex];
|
||||
|
||||
if (listener->getType() == message->getType())
|
||||
if (listener->getType() == message->getType() &&
|
||||
(message->getSchedulerId() == 0 || listener->getSchedulerId() == 0 ||
|
||||
listener->getSchedulerId() == message->getSchedulerId()))
|
||||
{
|
||||
// The listenersMutex gets unlocked so changes to listeners are possible while message handling.
|
||||
m_listenersMutex.unlock();
|
||||
@@ -280,7 +283,9 @@ void MessageQueue::sendMessageAsTask(std::shared_ptr<MessageBase> message, bool
|
||||
{
|
||||
MessageListenerBase* listener = m_listeners[i];
|
||||
|
||||
if (listener->getType() == message->getType())
|
||||
if (listener->getType() == message->getType() &&
|
||||
(message->getSchedulerId() == 0 || listener->getSchedulerId() == 0 ||
|
||||
listener->getSchedulerId() == message->getSchedulerId()))
|
||||
{
|
||||
Id listenerId = listener->getId();
|
||||
taskGroup->addTask(std::make_shared<TaskLambda>(
|
||||
@@ -297,12 +302,18 @@ void MessageQueue::sendMessageAsTask(std::shared_ptr<MessageBase> message, bool
|
||||
}
|
||||
}
|
||||
|
||||
Id schedulerId = message->getSchedulerId();
|
||||
if (!schedulerId)
|
||||
{
|
||||
schedulerId = TabId::app();
|
||||
}
|
||||
|
||||
if (asNextTask)
|
||||
{
|
||||
Task::dispatchNext(taskGroup);
|
||||
Task::dispatchNext(schedulerId, taskGroup);
|
||||
}
|
||||
else
|
||||
{
|
||||
Task::dispatch(taskGroup);
|
||||
Task::dispatch(schedulerId, taskGroup);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "MessageActivateBase.h"
|
||||
|
||||
#include "NodeTypeSet.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateAll
|
||||
: public Message<MessageActivateAll>
|
||||
@@ -20,6 +21,7 @@ public:
|
||||
: acceptedNodeTypes(acceptedNodeTypes)
|
||||
{
|
||||
setIsParallel(true);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef MESSAGE_ACTIVATE_BOOKMARK_H
|
||||
#define MESSAGE_ACTIVATE_BOOKMARK_H
|
||||
|
||||
#include "Message.h"
|
||||
|
||||
#include "Bookmark.h"
|
||||
|
||||
class MessageActivateBookmark
|
||||
: public Message<MessageActivateBookmark>
|
||||
{
|
||||
public:
|
||||
MessageActivateBookmark(const std::shared_ptr<Bookmark>& bookmark)
|
||||
: bookmark(bookmark)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~MessageActivateBookmark()
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageActivateBookmark";
|
||||
}
|
||||
|
||||
const std::shared_ptr<Bookmark> bookmark;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_ACTIVATE_BOOKMARK_H
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Message.h"
|
||||
#include "types.h"
|
||||
#include "utilityString.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateEdge
|
||||
: public Message<MessageActivateEdge>
|
||||
@@ -22,6 +23,8 @@ public:
|
||||
{
|
||||
setKeepContent(true);
|
||||
}
|
||||
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,14 +3,17 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "FilePath.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateFile: public Message<MessageActivateFile>
|
||||
class MessageActivateFile
|
||||
: public Message<MessageActivateFile>
|
||||
{
|
||||
public:
|
||||
MessageActivateFile(const FilePath& filePath, unsigned int line = 0)
|
||||
: filePath(filePath)
|
||||
, line(line)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "MessageActivateBase.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateFullTextSearch
|
||||
: public Message<MessageActivateFullTextSearch>
|
||||
@@ -18,6 +19,7 @@ public:
|
||||
: searchTerm(searchTerm)
|
||||
, caseSensitive(caseSensitive)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
void print(std::wostream& os) const override
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "types.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateLocalSymbols
|
||||
: public Message<MessageActivateLocalSymbols>
|
||||
@@ -10,11 +11,13 @@ class MessageActivateLocalSymbols
|
||||
public:
|
||||
MessageActivateLocalSymbols()
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
MessageActivateLocalSymbols(const std::vector<Id>& symbolIds)
|
||||
: symbolIds(symbolIds)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
void addSymbol(Id symbolId)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_ACTIVATE_NODES_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageActivateNodes
|
||||
@@ -24,6 +25,8 @@ public:
|
||||
{
|
||||
addNode(tokenId);
|
||||
}
|
||||
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
void addNode(Id tokenId)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_ACTIVATE_SOURCE_LOCATIONS_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageActivateSourceLocations
|
||||
@@ -11,6 +12,7 @@ public:
|
||||
MessageActivateSourceLocations(const std::vector<Id>& locationIds)
|
||||
: locationIds(locationIds)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_ACTIVATE_TOKEN_IDS_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageActivateTokenIds
|
||||
@@ -11,6 +12,7 @@ public:
|
||||
MessageActivateTokenIds(const std::vector<Id>& tokenIds)
|
||||
: tokenIds(tokenIds)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -24,6 +24,7 @@ public:
|
||||
{
|
||||
setIsParallel(true);
|
||||
setKeepContent(other->keepContent());
|
||||
setSchedulerId(other->getSchedulerId());
|
||||
}
|
||||
|
||||
void print(std::wostream& os) const override
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "types.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateTrail
|
||||
: public Message<MessageActivateTrail>
|
||||
@@ -15,6 +16,7 @@ public:
|
||||
, depth(depth)
|
||||
, horizontalLayout(horizontalLayout)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "NameHierarchy.h"
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
#include "utilityString.h"
|
||||
|
||||
@@ -21,6 +22,7 @@ public:
|
||||
, sourceNameHierarchy(sourceNameHierarchy)
|
||||
, targetNameHierarchy(targetNameHierarchy)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "FilePath.h"
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageChangeFileView
|
||||
: public Message<MessageChangeFileView>
|
||||
@@ -37,6 +38,7 @@ public:
|
||||
, showErrors(showErrors)
|
||||
, switchesViewMode(switchesViewMode)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_CODE_REFERENCE_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageCodeReference
|
||||
: public Message<MessageCodeReference>
|
||||
@@ -17,6 +18,7 @@ public:
|
||||
: type(type)
|
||||
, localReference(localReference)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_DEACTIVATE_EDGE_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageDeactivateEdge
|
||||
: public Message<MessageDeactivateEdge>
|
||||
@@ -10,6 +11,7 @@ public:
|
||||
MessageDeactivateEdge(bool scrollToDefinition)
|
||||
: scrollToDefinition(scrollToDefinition)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef MESSAGE_DISPLAY_BOOKMARK_CREATOR_H
|
||||
#define MESSAGE_DISPLAY_BOOKMARK_CREATOR_H
|
||||
|
||||
#include "Message.h"
|
||||
|
||||
class MessageDisplayBookmarkCreator
|
||||
: public Message<MessageDisplayBookmarkCreator>
|
||||
{
|
||||
public:
|
||||
MessageDisplayBookmarkCreator(Id nodeId = 0)
|
||||
: nodeId(nodeId)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageDisplayBookmarkCreator";
|
||||
}
|
||||
|
||||
const Id nodeId;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_DISPLAY_BOOKMARK_CREATOR_H
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_FIND_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageFind
|
||||
: public Message<MessageFind>
|
||||
@@ -10,6 +11,7 @@ public:
|
||||
MessageFind(bool fulltext = false)
|
||||
: findFulltext(fulltext)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_FLUSH_UPDATES_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageFlushUpdates:
|
||||
public Message<MessageFlushUpdates>
|
||||
@@ -10,6 +11,7 @@ public:
|
||||
MessageFlushUpdates(bool keepsContent = false)
|
||||
{
|
||||
setKeepContent(keepsContent);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
#include "TooltipOrigin.h"
|
||||
@@ -17,6 +18,7 @@ public:
|
||||
, origin(origin)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageFocusOut
|
||||
@@ -14,6 +15,7 @@ public:
|
||||
: tokenIds(tokenIds)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_GRAPH_NODE_BUNDLE_SPLIT_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageGraphNodeBundleSplit
|
||||
@@ -13,6 +14,7 @@ public:
|
||||
, removeOtherNodes(removeOtherNodes)
|
||||
, layoutToList(layoutToList)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "types.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageGraphNodeExpand
|
||||
: public Message<MessageGraphNodeExpand>
|
||||
@@ -13,6 +14,7 @@ public:
|
||||
, expand(expand)
|
||||
, ignoreIfNotReplayed(ignoreIfNotReplayed)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_GRAPH_NODE_HIDE_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageGraphNodeHide
|
||||
@@ -11,6 +12,7 @@ public:
|
||||
MessageGraphNodeHide(Id tokenId)
|
||||
: tokenId(tokenId)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#ifndef MESSAGE_GRAPH_NODE_MOVE_H
|
||||
#define MESSAGE_GRAPH_NODE_MOVE_H
|
||||
|
||||
#include "Vector2.h"
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
#include "Vector2.h"
|
||||
|
||||
class MessageGraphNodeMove
|
||||
: public Message<MessageGraphNodeMove>
|
||||
@@ -13,6 +14,7 @@ public:
|
||||
: tokenId(tokenId)
|
||||
, delta(delta)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_SCROLL_CODE_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageScrollCode
|
||||
: public Message<MessageScrollCode>
|
||||
@@ -12,6 +13,7 @@ public:
|
||||
, inListMode(inListMode)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_SCROLL_GRAPH_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageScrollGraph
|
||||
: public Message<MessageScrollGraph>
|
||||
@@ -12,6 +13,7 @@ public:
|
||||
, yValue(yValue)
|
||||
{
|
||||
setIsLogged(false);
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "FilePath.h"
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageScrollToLine
|
||||
: public Message<MessageScrollToLine>
|
||||
@@ -12,6 +13,7 @@ public:
|
||||
: filePath(filePath)
|
||||
, line(line)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "NodeTypeSet.h"
|
||||
#include "SearchMatch.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageSearch
|
||||
: public Message<MessageSearch>
|
||||
@@ -19,6 +20,7 @@ public:
|
||||
: acceptedNodeTypes(acceptedNodeTypes)
|
||||
, m_matches(matches)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
const std::vector<SearchMatch>& getMatches() const
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "Node.h"
|
||||
#include "NodeTypeSet.h"
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageSearchAutocomplete
|
||||
: public Message<MessageSearchAutocomplete>
|
||||
@@ -13,6 +14,7 @@ public:
|
||||
: query(query)
|
||||
, acceptedNodeTypes(acceptedNodeTypes)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define MESSAGE_SHOW_REFERENCE_H
|
||||
|
||||
#include "Message.h"
|
||||
#include "TabId.h"
|
||||
#include "types.h"
|
||||
|
||||
class MessageShowReference
|
||||
@@ -14,6 +15,7 @@ public:
|
||||
, locationId(locationId)
|
||||
, fromUser(fromUser)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "types.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageShowScope
|
||||
: public Message<MessageShowScope>
|
||||
@@ -12,6 +13,7 @@ public:
|
||||
: scopeLocationId(scopeLocationId)
|
||||
, showErrors(showErrors)
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
|
||||
@@ -3,12 +3,18 @@
|
||||
|
||||
#include "Message.h"
|
||||
#include "MessageActivateBase.h"
|
||||
#include "TabId.h"
|
||||
|
||||
class MessageActivateLegend
|
||||
: public Message<MessageActivateLegend>
|
||||
, public MessageActivateBase
|
||||
{
|
||||
public:
|
||||
MessageActivateLegend()
|
||||
{
|
||||
setSchedulerId(TabId::currentTab());
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageActivateLegend";
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef MESSAGE_BOOKMARK_ACTIVATE_H
|
||||
#define MESSAGE_BOOKMARK_ACTIVATE_H
|
||||
|
||||
#include "Bookmark.h"
|
||||
#include "Message.h"
|
||||
|
||||
class MessageBookmarkActivate
|
||||
: public Message<MessageBookmarkActivate>
|
||||
{
|
||||
public:
|
||||
MessageBookmarkActivate(const std::shared_ptr<Bookmark>& bookmark)
|
||||
: bookmark(bookmark)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageBookmarkActivate";
|
||||
}
|
||||
|
||||
const std::shared_ptr<Bookmark> bookmark;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_BOOKMARK_ACTIVATE_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user