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:
Eberhard Graether
2018-11-05 01:28:12 +01:00
parent bd4a554b27
commit f13aec70dd
170 changed files with 2972 additions and 823 deletions
+13 -3
View File
@@ -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;
+15 -4
View File
@@ -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
@@ -1,14 +1,14 @@
#ifndef MESSAGE_DISPLAY_BOOKMARKS_H
#define MESSAGE_DISPLAY_BOOKMARKS_H
#ifndef MESSAGE_BOOKMARKS_BROWSE_H
#define MESSAGE_BOOKMARKS_BROWSE_H
#include "Bookmark.h"
#include "Message.h"
class MessageDisplayBookmarks
: public Message<MessageDisplayBookmarks>
class MessageBookmarkBrowse
: public Message<MessageBookmarkBrowse>
{
public:
MessageDisplayBookmarks(
MessageBookmarkBrowse(
Bookmark::BookmarkFilter filter = Bookmark::FILTER_UNKNOWN,
Bookmark::BookmarkOrder order = Bookmark::ORDER_NONE
)
@@ -19,11 +19,11 @@ public:
static const std::string getStaticType()
{
return "MessageDisplayBookmarks";
return "MessageBookmarkBrowse";
}
const Bookmark::BookmarkFilter filter;
const Bookmark::BookmarkOrder order;
};
#endif // MESSAGE_DISPLAY_BOOKMARKS_H
#endif // MESSAGE_BOOKMARKS_BROWSE_H
@@ -0,0 +1,31 @@
#ifndef MESSAGE_BOOKMARK_BUTTON_STATE_H
#define MESSAGE_BOOKMARK_BUTTON_STATE_H
#include "Message.h"
class MessageBookmarkButtonState:
public Message<MessageBookmarkButtonState>
{
public:
enum ButtonState
{
CAN_CREATE = 0,
CANNOT_CREATE,
ALREADY_CREATED
};
static const std::string getStaticType()
{
return "MessageBookmarkButtonState";
}
MessageBookmarkButtonState(Id schedulerId, ButtonState state)
: state(state)
{
setSchedulerId(schedulerId);
}
const ButtonState state;
};
#endif // MESSAGE_BOOKMARK_BUTTON_STATE_H
@@ -0,0 +1,23 @@
#ifndef MESSAGE_BOOKMARK_CREATE_H
#define MESSAGE_BOOKMARK_CREATE_H
#include "Message.h"
class MessageBookmarkCreate
: public Message<MessageBookmarkCreate>
{
public:
MessageBookmarkCreate(Id nodeId = 0)
: nodeId(nodeId)
{
}
static const std::string getStaticType()
{
return "MessageBookmarkCreate";
}
const Id nodeId;
};
#endif // MESSAGE_BOOKMARK_CREATE_H
@@ -0,0 +1,16 @@
#ifndef MESSAGE_BOOKMARK_DELETE_H
#define MESSAGE_BOOKMARK_DELETE_H
#include "Message.h"
class MessageBookmarkDelete:
public Message<MessageBookmarkDelete>
{
public:
static const std::string getStaticType()
{
return "MessageBookmarkDelete";
}
};
#endif // MESSAGE_BOOKMARK_DELETE_H
@@ -0,0 +1,16 @@
#ifndef MESSAGE_BOOKMARK_EDIT_H
#define MESSAGE_BOOKMARK_EDIT_H
#include "Message.h"
class MessageBookmarkEdit:
public Message<MessageBookmarkEdit>
{
public:
static const std::string getStaticType()
{
return "MessageBookmarkEdit";
}
};
#endif // MESSAGE_BOOKMARK_EDIT_H
@@ -2,6 +2,7 @@
#define MESSAGE_CODE_SHOW_DEFINITION_H
#include "Message.h"
#include "TabId.h"
#include "types.h"
class MessageCodeShowDefinition
@@ -16,6 +17,7 @@ public:
MessageCodeShowDefinition(Id nodeId)
: nodeId(nodeId)
{
setSchedulerId(TabId::currentTab());
}
virtual void print(std::wostream& os) const
@@ -5,6 +5,7 @@
#include "MessageActivateBase.h"
#include "ErrorFilter.h"
#include "TabId.h"
class MessageActivateErrors
: public Message<MessageActivateErrors>
@@ -20,6 +21,7 @@ public:
: filter(filter)
, file(file)
{
setSchedulerId(TabId::currentTab());
}
std::vector<SearchMatch> getSearchMatches() const override
@@ -2,6 +2,7 @@
#define MESSAGE_SHOW_ERROR_H
#include "Message.h"
#include "TabId.h"
class MessageShowError
: public Message<MessageShowError>
@@ -15,6 +16,7 @@ public:
MessageShowError(Id errorId)
: errorId(errorId)
{
setSchedulerId(TabId::currentTab());
}
const Id errorId;
@@ -2,6 +2,7 @@
#define MESSAGE_HISTORY_REDO_H
#include "Message.h"
#include "TabId.h"
class MessageHistoryRedo
: public Message<MessageHistoryRedo>
@@ -14,6 +15,7 @@ public:
MessageHistoryRedo()
{
setSchedulerId(TabId::currentTab());
}
};
@@ -2,6 +2,7 @@
#define MESSAGE_HISTORY_TO_POSITION_H
#include "Message.h"
#include "TabId.h"
class MessageHistoryToPosition
: public Message<MessageHistoryToPosition>
@@ -15,6 +16,7 @@ public:
MessageHistoryToPosition(size_t index)
: index(index)
{
setSchedulerId(TabId::currentTab());
}
const size_t index;
@@ -2,6 +2,7 @@
#define MESSAGE_HISTORY_UNDO_H
#include "Message.h"
#include "TabId.h"
class MessageHistoryUndo
: public Message<MessageHistoryUndo>
@@ -14,6 +15,7 @@ public:
MessageHistoryUndo()
{
setSchedulerId(TabId::currentTab());
}
};
@@ -0,0 +1,16 @@
#ifndef MESSAGE_TAB_CLOSE_H
#define MESSAGE_TAB_CLOSE_H
#include "Message.h"
class MessageTabClose
: public Message<MessageTabClose>
{
public:
static const std::string getStaticType()
{
return "MessageTabClose";
}
};
#endif // MESSAGE_TAB_CLOSE_H
@@ -0,0 +1,16 @@
#ifndef MESSAGE_TAB_OPEN_H
#define MESSAGE_TAB_OPEN_H
#include "Message.h"
class MessageTabOpen
: public Message<MessageTabOpen>
{
public:
static const std::string getStaticType()
{
return "MessageTabOpen";
}
};
#endif // MESSAGE_TAB_OPEN_H
@@ -0,0 +1,51 @@
#ifndef MESSAGE_TAB_OPEN_WITH_H
#define MESSAGE_TAB_OPEN_WITH_H
#include "FilePath.h"
#include "Message.h"
#include "SearchMatch.h"
class MessageTabOpenWith
: public Message<MessageTabOpenWith>
{
public:
static const std::string getStaticType()
{
return "MessageTabOpenWith";
}
MessageTabOpenWith(Id tokenId, Id locationId = 0)
: tokenId(tokenId)
, locationId(locationId)
{
}
MessageTabOpenWith(const FilePath& path, size_t line = 0)
: filePath(path)
, line(line)
{
}
MessageTabOpenWith(const SearchMatch& match)
: match(match)
{
}
MessageTabOpenWith& showNewTab(bool show)
{
showTab = show;
return *this;
}
const Id tokenId = 0;
const Id locationId = 0;
const FilePath filePath;
const SearchMatch match;
const size_t line = 0;
bool showTab = false;
};
#endif // MESSAGE_TAB_OPEN_WITH_H
@@ -0,0 +1,23 @@
#ifndef MESSAGE_TAB_SELECT_H
#define MESSAGE_TAB_SELECT_H
#include "Message.h"
class MessageTabSelect
: public Message<MessageTabSelect>
{
public:
MessageTabSelect(bool next)
: next(next)
{
}
static const std::string getStaticType()
{
return "MessageTabSelect";
}
bool next;
};
#endif // MESSAGE_TAB_SELECT_H
@@ -0,0 +1,26 @@
#ifndef MESSAGE_TAB_STATE_H
#define MESSAGE_TAB_STATE_H
#include "Message.h"
#include "SearchMatch.h"
class MessageTabState
: public Message<MessageTabState>
{
public:
MessageTabState(Id tabId, const std::vector<SearchMatch>& searchMatches)
: tabId(tabId)
, searchMatches(searchMatches)
{
}
static const std::string getStaticType()
{
return "MessageTabState";
}
const Id tabId;
const std::vector<SearchMatch> searchMatches;
};
#endif // MESSAGE_TAB_STATE_H