logic: Made history menu use on Messages instead of SearchMatch
* Common base class MessageActivateBase for activation messages with getter for SearchMatches * Removed duplicate logic for creating SearchMatches from Messages * Fixed can't reactivate fulltext search from history menu * Renamed history message and moved to sub directory * Fixed activating node type filters didn't clear code view
This commit is contained in:
@@ -181,9 +181,9 @@ std::shared_ptr<DialogView> Application::getDialogView()
|
||||
return std::make_shared<DialogView>(nullptr);
|
||||
}
|
||||
|
||||
void Application::updateHistory(const std::vector<SearchMatch>& history)
|
||||
void Application::updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems)
|
||||
{
|
||||
m_mainView->updateHistoryMenu(history);
|
||||
m_mainView->updateHistoryMenu(historyMenuItems);
|
||||
}
|
||||
|
||||
void Application::updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks)
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
int handleDialog(const std::wstring& message, const std::vector<std::wstring>& options);
|
||||
std::shared_ptr<DialogView> getDialogView();
|
||||
|
||||
void updateHistory(const std::vector<SearchMatch>& history);
|
||||
void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems);
|
||||
void updateBookmarks(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
|
||||
private:
|
||||
|
||||
@@ -428,10 +428,16 @@ add_files(
|
||||
utility/messaging/type/error/MessageErrorsHelpMessage.h
|
||||
utility/messaging/type/error/MessageShowError.h
|
||||
|
||||
utility/messaging/type/history/MessageHistoryToPosition.h
|
||||
utility/messaging/type/history/MessageHistoryRedo.h
|
||||
utility/messaging/type/history/MessageHistoryUndo.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
|
||||
utility/messaging/type/MessageActivateLocalSymbols.h
|
||||
utility/messaging/type/MessageActivateNodes.h
|
||||
utility/messaging/type/MessageActivateSourceLocations.h
|
||||
@@ -468,7 +474,6 @@ add_files(
|
||||
utility/messaging/type/MessageProjectEdit.h
|
||||
utility/messaging/type/MessageProjectNew.h
|
||||
utility/messaging/type/MessageQuitApplication.h
|
||||
utility/messaging/type/MessageRedo.h
|
||||
utility/messaging/type/MessageRefresh.h
|
||||
utility/messaging/type/MessageResetZoom.h
|
||||
utility/messaging/type/MessageScrollCode.h
|
||||
@@ -476,7 +481,6 @@ add_files(
|
||||
utility/messaging/type/MessageScrollToLine.h
|
||||
utility/messaging/type/MessageSearch.h
|
||||
utility/messaging/type/MessageSearchAutocomplete.h
|
||||
utility/messaging/type/MessageSearchFullText.h
|
||||
utility/messaging/type/MessageShowReference.h
|
||||
utility/messaging/type/MessageShowScope.h
|
||||
utility/messaging/type/MessageShowStatus.h
|
||||
@@ -486,8 +490,6 @@ add_files(
|
||||
utility/messaging/type/MessageSwitchColorScheme.h
|
||||
utility/messaging/type/MessageTooltipHide.h
|
||||
utility/messaging/type/MessageTooltipShow.h
|
||||
utility/messaging/type/MessageToUndoRedoPosition.h
|
||||
utility/messaging/type/MessageUndo.h
|
||||
utility/messaging/type/MessageWindowClosed.h
|
||||
utility/messaging/type/MessageWindowFocus.h
|
||||
utility/messaging/type/MessageZoom.h
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/messaging/type/MessageScrollToLine.h"
|
||||
#include "utility/utility.h"
|
||||
|
||||
ActivationController::ActivationController(StorageAccess* storageAccess)
|
||||
: m_storageAccess(storageAccess)
|
||||
@@ -152,22 +153,15 @@ void ActivationController::handleMessage(MessageSearch* message)
|
||||
}
|
||||
|
||||
MessageActivateTokens m(message);
|
||||
m.isFromSearch = message->isFromSearch;
|
||||
|
||||
if (message->isFromSearch)
|
||||
m.isFromSearch = true;
|
||||
for (const SearchMatch& match : matches)
|
||||
{
|
||||
m.tokenIds = message->getTokenIdsOfMatches();
|
||||
m.searchMatches = matches;
|
||||
if (match.tokenIds.size() && match.tokenIds[0] != 0)
|
||||
{
|
||||
utility::append(m.tokenIds, match.tokenIds);
|
||||
m.searchMatches.push_back(match);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::pair<std::vector<Id>, std::vector<SearchMatch>> ret =
|
||||
m_storageAccess->getNodeIdsAndSearchMatchesForNameHierarchies(message->getTokenNamesOfMatches());
|
||||
|
||||
m.tokenIds = ret.first;
|
||||
m.searchMatches = ret.second;
|
||||
}
|
||||
|
||||
m.dispatchImmediately();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ void CodeController::handleMessage(MessageActivateAll* message)
|
||||
Project* currentProject = Application::getInstance()->getCurrentProject().get();
|
||||
if (!currentProject || message->acceptedNodeTypes != NodeTypeSet::all())
|
||||
{
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -132,6 +133,25 @@ void CodeController::handleMessage(MessageActivateErrors* message)
|
||||
showCodeSnippets(snippets, params, false);
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
TRACE("code fulltext");
|
||||
|
||||
saveOrRestoreViewMode(message);
|
||||
|
||||
m_collection = m_storageAccess->getFullTextSearchLocations(message->searchTerm, message->caseSensitive);
|
||||
|
||||
CodeView::ScrollParams scrollParams(CodeView::ScrollParams::SCROLL_TO_DEFINITION);
|
||||
getView()->scrollTo(scrollParams);
|
||||
|
||||
CodeView::CodeParams params;
|
||||
params.clearSnippets = true;
|
||||
params.showContents = !message->isReplayed();
|
||||
params.useSingleFileCache = false;
|
||||
|
||||
showCodeSnippets(getSnippetsForCollection(m_collection), params);
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageActivateLocalSymbols* message)
|
||||
{
|
||||
CodeView* view = getView();
|
||||
@@ -326,25 +346,6 @@ void CodeController::handleMessage(MessageScrollCode* message)
|
||||
}
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
TRACE("code fulltext");
|
||||
|
||||
saveOrRestoreViewMode(message);
|
||||
|
||||
m_collection = m_storageAccess->getFullTextSearchLocations(message->searchTerm, message->caseSensitive);
|
||||
|
||||
CodeView::ScrollParams scrollParams(CodeView::ScrollParams::SCROLL_TO_DEFINITION);
|
||||
getView()->scrollTo(scrollParams);
|
||||
|
||||
CodeView::CodeParams params;
|
||||
params.clearSnippets = true;
|
||||
params.showContents = !message->isReplayed();
|
||||
params.useSingleFileCache = false;
|
||||
|
||||
showCodeSnippets(getSnippetsForCollection(m_collection), params);
|
||||
}
|
||||
|
||||
void CodeController::handleMessage(MessageShowError* message)
|
||||
{
|
||||
CodeView* view = getView();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "utility/messaging/type/error/MessageErrorCountClear.h"
|
||||
#include "utility/messaging/type/error/MessageShowError.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateLocalSymbols.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageActivateTrailEdge.h"
|
||||
@@ -20,7 +21,6 @@
|
||||
#include "utility/messaging/type/MessageFocusOut.h"
|
||||
#include "utility/messaging/type/MessageScrollCode.h"
|
||||
#include "utility/messaging/type/MessageScrollToLine.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
#include "utility/messaging/type/MessageShowScope.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
@@ -37,6 +37,7 @@ class CodeController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateLocalSymbols>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageActivateTrailEdge>
|
||||
@@ -48,7 +49,6 @@ class CodeController
|
||||
, public MessageListener<MessageFocusOut>
|
||||
, public MessageListener<MessageScrollCode>
|
||||
, public MessageListener<MessageScrollToLine>
|
||||
, public MessageListener<MessageSearchFullText>
|
||||
, public MessageListener<MessageShowError>
|
||||
, public MessageListener<MessageShowScope>
|
||||
{
|
||||
@@ -61,6 +61,7 @@ private:
|
||||
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateLocalSymbols* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageActivateTrailEdge* message);
|
||||
@@ -72,7 +73,6 @@ private:
|
||||
virtual void handleMessage(MessageFocusOut* message);
|
||||
virtual void handleMessage(MessageScrollCode* message);
|
||||
virtual void handleMessage(MessageScrollToLine* message);
|
||||
virtual void handleMessage(MessageSearchFullText* message);
|
||||
virtual void handleMessage(MessageShowError* message);
|
||||
virtual void handleMessage(MessageShowScope* message);
|
||||
|
||||
|
||||
@@ -55,6 +55,11 @@ void ErrorController::handleMessage(MessageActivateErrors* message)
|
||||
}
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
@@ -140,11 +145,6 @@ void ErrorController::handleMessage(MessageShowError* message)
|
||||
getView()->setErrorId(message->errorId);
|
||||
}
|
||||
|
||||
void ErrorController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
m_showsErrors = false;
|
||||
}
|
||||
|
||||
ErrorView* ErrorController::getView() const
|
||||
{
|
||||
return Controller::getView<ErrorView>();
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "utility/messaging/type/error/MessageErrorsForFile.h"
|
||||
#include "utility/messaging/type/error/MessageErrorsHelpMessage.h"
|
||||
#include "utility/messaging/type/error/MessageShowError.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
#include "component/view/ErrorView.h"
|
||||
@@ -23,6 +23,7 @@ class ErrorController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageErrorCountClear>
|
||||
, public MessageListener<MessageErrorCountUpdate>
|
||||
@@ -31,7 +32,6 @@ class ErrorController
|
||||
, public MessageListener<MessageErrorsHelpMessage>
|
||||
, public MessageListener<MessageFinishedParsing>
|
||||
, public MessageListener<MessageShowError>
|
||||
, public MessageListener<MessageSearchFullText>
|
||||
{
|
||||
public:
|
||||
ErrorController(StorageAccess* storageAccess);
|
||||
@@ -43,6 +43,7 @@ public:
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageErrorCountClear* message);
|
||||
virtual void handleMessage(MessageErrorCountUpdate* message);
|
||||
@@ -51,7 +52,6 @@ private:
|
||||
virtual void handleMessage(MessageErrorsHelpMessage* message);
|
||||
virtual void handleMessage(MessageFinishedParsing* message);
|
||||
virtual void handleMessage(MessageShowError* message);
|
||||
virtual void handleMessage(MessageSearchFullText* message);
|
||||
|
||||
ErrorView* getView() const;
|
||||
|
||||
|
||||
@@ -69,6 +69,11 @@ void GraphController::handleMessage(MessageActivateErrors* message)
|
||||
clear();
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
TRACE("graph activate");
|
||||
@@ -259,11 +264,6 @@ void GraphController::handleMessage(MessageScrollGraph* message)
|
||||
}
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
void GraphController::handleMessage(MessageFocusIn* message)
|
||||
{
|
||||
getView()->focusTokenIds(message->tokenIds);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/error/MessageActivateErrors.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageActivateTrail.h"
|
||||
#include "utility/messaging/type/MessageActivateTrailEdge.h"
|
||||
@@ -18,7 +19,6 @@
|
||||
#include "utility/messaging/type/MessageGraphNodeHide.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeMove.h"
|
||||
#include "utility/messaging/type/MessageScrollGraph.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
#include "utility/messaging/type/MessageShowReference.h"
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
@@ -34,6 +34,7 @@ class GraphController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageActivateTrail>
|
||||
, public MessageListener<MessageActivateTrailEdge>
|
||||
@@ -45,7 +46,6 @@ class GraphController
|
||||
, public MessageListener<MessageGraphNodeHide>
|
||||
, public MessageListener<MessageGraphNodeMove>
|
||||
, public MessageListener<MessageScrollGraph>
|
||||
, public MessageListener<MessageSearchFullText>
|
||||
, public MessageListener<MessageShowReference>
|
||||
{
|
||||
public:
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageActivateTrail* message);
|
||||
virtual void handleMessage(MessageActivateTrailEdge* message);
|
||||
@@ -66,7 +67,6 @@ private:
|
||||
virtual void handleMessage(MessageGraphNodeHide* message);
|
||||
virtual void handleMessage(MessageGraphNodeMove* message);
|
||||
virtual void handleMessage(MessageScrollGraph* message);
|
||||
virtual void handleMessage(MessageSearchFullText* message);
|
||||
virtual void handleMessage(MessageShowReference* message);
|
||||
|
||||
GraphView* getView() const;
|
||||
|
||||
@@ -16,39 +16,27 @@ SearchController::~SearchController()
|
||||
|
||||
void SearchController::handleMessage(MessageActivateAll* message)
|
||||
{
|
||||
if (message->acceptedNodeTypes != NodeTypeSet::all())
|
||||
{
|
||||
if (message->isReplayed())
|
||||
{
|
||||
getView()->setMatches(SearchMatch::createCommandsForNodeTypes(message->acceptedNodeTypes));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
getView()->setMatches(std::vector<SearchMatch>(1, SearchMatch::createCommand(SearchMatch::COMMAND_ALL)));
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateErrors* message)
|
||||
{
|
||||
SearchMatch match = SearchMatch::createCommand(SearchMatch::COMMAND_ERROR);
|
||||
getView()->setMatches(std::vector<SearchMatch>(1, match));
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
if ((message->isFromSearch && !message->isReplayed()) || message->keepContent())
|
||||
if (message->keepContent())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (message->searchMatches.size())
|
||||
{
|
||||
getView()->setMatches(message->searchMatches);
|
||||
}
|
||||
else if (message->tokenIds.size())
|
||||
{
|
||||
getView()->setMatches(m_storageAccess->getSearchMatchesForTokenIds(message->tokenIds));
|
||||
}
|
||||
getView()->setMatches(message->getSearchMatches());
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageFind* message)
|
||||
@@ -79,16 +67,6 @@ void SearchController::handleMessage(MessageSearchAutocomplete* message)
|
||||
view->setAutocompletionList(m_storageAccess->getAutocompletionMatches(message->query, message->acceptedNodeTypes));
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
LOG_INFO(L"fulltext string: \"" + message->searchTerm + L"\"");
|
||||
std::wstring prefix(message->caseSensitive ? 2 : 1, SearchMatch::FULLTEXT_SEARCH_CHARACTER);
|
||||
|
||||
SearchMatch match(prefix + message->searchTerm);
|
||||
match.searchType = SearchMatch::SEARCH_FULLTEXT;
|
||||
getView()->setMatches(std::vector<SearchMatch>(1, match));
|
||||
}
|
||||
|
||||
SearchView* SearchController::getView()
|
||||
{
|
||||
return Controller::getView<SearchView>();
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/error/MessageActivateErrors.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageFind.h"
|
||||
#include "utility/messaging/type/MessageSearchAutocomplete.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
|
||||
class StorageAccess;
|
||||
class SearchView;
|
||||
@@ -17,10 +17,10 @@ class SearchController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageFind>
|
||||
, public MessageListener<MessageSearchAutocomplete>
|
||||
, public MessageListener<MessageSearchFullText>
|
||||
{
|
||||
public:
|
||||
SearchController(StorageAccess* storageAccess);
|
||||
@@ -29,10 +29,10 @@ public:
|
||||
private:
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageFind* message);
|
||||
virtual void handleMessage(MessageSearchAutocomplete* message);
|
||||
virtual void handleMessage(MessageSearchFullText* message);
|
||||
|
||||
SearchView* getView();
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "utility/messaging/type/MessageFlushUpdates.h"
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/utility.h"
|
||||
|
||||
#include "Application.h"
|
||||
#include "component/view/UndoRedoView.h"
|
||||
@@ -27,7 +28,6 @@ void UndoRedoController::clear()
|
||||
m_list.clear();
|
||||
m_iterator = m_list.begin();
|
||||
|
||||
m_history.clear();
|
||||
m_historyOffset = 0;
|
||||
updateHistory();
|
||||
|
||||
@@ -67,6 +67,19 @@ void UndoRedoController::handleMessage(MessageActivateErrors* message)
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageActivateFullTextSearch* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageActivateFullTextSearch*>(lastMessage())->searchTerm == message->searchTerm &&
|
||||
static_cast<MessageActivateFullTextSearch*>(lastMessage())->caseSensitive == message->caseSensitive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageActivateFullTextSearch>(*message), Command::ORDER_ACTIVATE);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageActivateLocalSymbols* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message))
|
||||
@@ -200,7 +213,7 @@ void UndoRedoController::handleMessage(MessageGraphNodeMove* message)
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageRedo* message)
|
||||
void UndoRedoController::handleMessage(MessageHistoryRedo* message)
|
||||
{
|
||||
if (m_iterator == m_list.end())
|
||||
{
|
||||
@@ -226,92 +239,7 @@ void UndoRedoController::handleMessage(MessageRedo* message)
|
||||
updateHistory();
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
if (!message->uiOnly)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_iterator == m_list.begin())
|
||||
{
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ALL) }).dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
replayCommands();
|
||||
}
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageScrollCode* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message))
|
||||
{
|
||||
static_cast<MessageScrollCode*>(lastMessage())->value = message->value;
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageScrollCode>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageScrollGraph* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message))
|
||||
{
|
||||
static_cast<MessageScrollGraph*>(lastMessage())->xValue = message->xValue;
|
||||
static_cast<MessageScrollGraph*>(lastMessage())->yValue = message->yValue;
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageScrollGraph>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageSearchFullText*>(lastMessage())->searchTerm == message->searchTerm &&
|
||||
static_cast<MessageSearchFullText*>(lastMessage())->caseSensitive == message->caseSensitive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageSearchFullText>(*message), Command::ORDER_ACTIVATE);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowError* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageShowError*>(lastMessage())->errorId == message->errorId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageShowError>(*message), Command::ORDER_ADAPT);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowReference* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageShowReference*>(lastMessage())->refIndex == message->refIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageShowReference>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowScope* message)
|
||||
{
|
||||
Command command(std::make_shared<MessageShowScope>(*message), Command::ORDER_VIEW);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageToUndoRedoPosition* message)
|
||||
void UndoRedoController::handleMessage(MessageHistoryToPosition* message)
|
||||
{
|
||||
size_t index = 0;
|
||||
const size_t activeIndex = message->index + m_historyOffset;
|
||||
@@ -359,7 +287,7 @@ void UndoRedoController::handleMessage(MessageToUndoRedoPosition* message)
|
||||
updateHistory();
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageUndo* message)
|
||||
void UndoRedoController::handleMessage(MessageHistoryUndo* message)
|
||||
{
|
||||
if (!m_list.size())
|
||||
{
|
||||
@@ -400,6 +328,78 @@ void UndoRedoController::handleMessage(MessageUndo* message)
|
||||
updateHistory();
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageRefresh* message)
|
||||
{
|
||||
if (!message->uiOnly)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_iterator == m_list.begin())
|
||||
{
|
||||
MessageActivateAll().dispatch();
|
||||
}
|
||||
else
|
||||
{
|
||||
replayCommands();
|
||||
}
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageScrollCode* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message))
|
||||
{
|
||||
static_cast<MessageScrollCode*>(lastMessage())->value = message->value;
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageScrollCode>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageScrollGraph* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message))
|
||||
{
|
||||
static_cast<MessageScrollGraph*>(lastMessage())->xValue = message->xValue;
|
||||
static_cast<MessageScrollGraph*>(lastMessage())->yValue = message->yValue;
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageScrollGraph>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowError* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageShowError*>(lastMessage())->errorId == message->errorId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageShowError>(*message), Command::ORDER_ADAPT);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowReference* message)
|
||||
{
|
||||
if (sameMessageTypeAsLast(message) &&
|
||||
static_cast<MessageShowReference*>(lastMessage())->refIndex == message->refIndex)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Command command(std::make_shared<MessageShowReference>(*message), Command::ORDER_VIEW, true);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::handleMessage(MessageShowScope* message)
|
||||
{
|
||||
Command command(std::make_shared<MessageShowScope>(*message), Command::ORDER_VIEW);
|
||||
processCommand(command);
|
||||
}
|
||||
|
||||
void UndoRedoController::replayCommands()
|
||||
{
|
||||
std::list<Command>::iterator startIterator = m_iterator;
|
||||
@@ -468,6 +468,9 @@ void UndoRedoController::replayCommand(std::list<Command>::iterator it)
|
||||
}
|
||||
|
||||
m->dispatch();
|
||||
|
||||
m->setIsReplayed(false);
|
||||
m->setIsLast(false);
|
||||
}
|
||||
|
||||
void UndoRedoController::processCommand(Command command)
|
||||
@@ -549,16 +552,20 @@ MessageBase* UndoRedoController::lastMessage() const
|
||||
|
||||
void UndoRedoController::updateHistory()
|
||||
{
|
||||
const size_t historySize = 50;
|
||||
const size_t historyListSize = 50;
|
||||
const size_t historyMenuSize = 20;
|
||||
|
||||
std::vector<SearchMatch> matches;
|
||||
bool firstActiveMessage = false;
|
||||
std::vector<SearchMatch> historyListMatches;
|
||||
std::vector<std::shared_ptr<MessageBase>> historyMenuItems;
|
||||
std::set<SearchMatch> uniqueMatches;
|
||||
|
||||
size_t index = 0;
|
||||
int currentIndex = -1;
|
||||
m_historyOffset = 0;
|
||||
|
||||
bool historyMenuFull = false;
|
||||
bool historyListFull = false;
|
||||
|
||||
for (std::list<Command>::const_reverse_iterator it = m_list.rbegin(); it != m_list.rend(); it++)
|
||||
{
|
||||
if (m_iterator == it.base())
|
||||
@@ -566,96 +573,54 @@ void UndoRedoController::updateHistory()
|
||||
currentIndex = index;
|
||||
}
|
||||
|
||||
if (it->order == Command::ORDER_ACTIVATE)
|
||||
if (it->order == Command::ORDER_ACTIVATE && dynamic_cast<MessageActivateBase*>(it->message.get()))
|
||||
{
|
||||
index++;
|
||||
|
||||
SearchMatch match = getSearchMatchForMessage(it->message.get());
|
||||
if (match.text.empty())
|
||||
std::vector<SearchMatch> m = dynamic_cast<MessageActivateBase*>(it->message.get())->getSearchMatches();
|
||||
if (!m.size() || m[0].text.empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!firstActiveMessage)
|
||||
{
|
||||
firstActiveMessage = true;
|
||||
SearchMatch match = m[0];
|
||||
|
||||
for (size_t i = 0; i < m_history.size(); i++)
|
||||
if (!historyMenuFull && uniqueMatches.insert(match).second)
|
||||
{
|
||||
historyMenuItems.push_back(it->message);
|
||||
|
||||
if (historyMenuItems.size() == historyMenuSize)
|
||||
{
|
||||
if (m_history[i] == match)
|
||||
{
|
||||
m_history.erase(m_history.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_history.push_front(match);
|
||||
if (m_history.size() > historyMenuSize)
|
||||
{
|
||||
m_history.pop_back();
|
||||
historyMenuFull = true;
|
||||
}
|
||||
}
|
||||
|
||||
matches.push_back(match);
|
||||
|
||||
if (matches.size() > historySize)
|
||||
if (!historyListFull)
|
||||
{
|
||||
matches.erase(matches.begin());
|
||||
m_historyOffset++;
|
||||
historyListMatches.push_back(match);
|
||||
|
||||
if (historyListMatches.size() > historyListSize)
|
||||
{
|
||||
historyListMatches.erase(historyListMatches.begin());
|
||||
m_historyOffset++;
|
||||
}
|
||||
|
||||
if (historyListMatches.size() == historyListSize &&
|
||||
currentIndex != -1 && currentIndex - m_historyOffset != historyListSize - 1)
|
||||
{
|
||||
historyListFull = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (matches.size() == historySize && currentIndex != -1 && currentIndex - m_historyOffset != historySize - 1)
|
||||
if (historyMenuFull && historyListFull)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getView()->updateHistory(matches, currentIndex - m_historyOffset);
|
||||
Application::getInstance()->updateHistory(std::vector<SearchMatch>(m_history.begin(), m_history.end()));
|
||||
}
|
||||
|
||||
SearchMatch UndoRedoController::getSearchMatchForMessage(MessageBase* message) const
|
||||
{
|
||||
if (message->getType() == MessageActivateAll::getStaticType())
|
||||
{
|
||||
SearchMatch match = SearchMatch::createCommand(SearchMatch::COMMAND_ALL);
|
||||
if (dynamic_cast<MessageActivateAll*>(message)->acceptedNodeTypes != NodeTypeSet::all())
|
||||
{
|
||||
match.name = match.text = L"filter"; // TODO: show acceptedNodeTypes names or at least type ids
|
||||
}
|
||||
return match;
|
||||
}
|
||||
else if (message->getType() == MessageActivateTokens::getStaticType())
|
||||
{
|
||||
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(message);
|
||||
if (msg->searchMatches.size())
|
||||
{
|
||||
return msg->searchMatches.front();
|
||||
}
|
||||
else if (msg->isAggregation)
|
||||
{
|
||||
SearchMatch match;
|
||||
match.name = match.text = L"aggregation"; // TODO: show aggregation source and target
|
||||
match.searchType = SearchMatch::SEARCH_TOKEN;
|
||||
match.nodeType = NodeType::NODE_TYPE;
|
||||
return match;
|
||||
}
|
||||
}
|
||||
else if (message->getType() == MessageSearchFullText::getStaticType())
|
||||
{
|
||||
MessageSearchFullText* msg = dynamic_cast<MessageSearchFullText*>(message);
|
||||
std::wstring prefix(msg->caseSensitive ? 2 : 1, SearchMatch::FULLTEXT_SEARCH_CHARACTER);
|
||||
|
||||
SearchMatch match(prefix + msg->searchTerm);
|
||||
match.searchType = SearchMatch::SEARCH_FULLTEXT;
|
||||
return match;
|
||||
}
|
||||
else if (message->getType() == MessageActivateErrors::getStaticType())
|
||||
{
|
||||
return SearchMatch::createCommand(SearchMatch::COMMAND_ERROR);
|
||||
}
|
||||
|
||||
return SearchMatch();
|
||||
getView()->updateHistory(historyListMatches, currentIndex - m_historyOffset);
|
||||
Application::getInstance()->updateHistoryMenu(historyMenuItems);
|
||||
}
|
||||
|
||||
void UndoRedoController::dump() const
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/error/MessageActivateErrors.h"
|
||||
#include "utility/messaging/type/error/MessageShowError.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryRedo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryToPosition.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryUndo.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateLocalSymbols.h"
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageActivateTrail.h"
|
||||
@@ -19,15 +23,11 @@
|
||||
#include "utility/messaging/type/MessageGraphNodeExpand.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeHide.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeMove.h"
|
||||
#include "utility/messaging/type/MessageRedo.h"
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
#include "utility/messaging/type/MessageScrollCode.h"
|
||||
#include "utility/messaging/type/MessageScrollGraph.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
#include "utility/messaging/type/MessageShowReference.h"
|
||||
#include "utility/messaging/type/MessageShowScope.h"
|
||||
#include "utility/messaging/type/MessageToUndoRedoPosition.h"
|
||||
#include "utility/messaging/type/MessageUndo.h"
|
||||
|
||||
#include "component/controller/Controller.h"
|
||||
|
||||
@@ -38,6 +38,7 @@ class UndoRedoController
|
||||
: public Controller
|
||||
, public MessageListener<MessageActivateAll>
|
||||
, public MessageListener<MessageActivateErrors>
|
||||
, public MessageListener<MessageActivateFullTextSearch>
|
||||
, public MessageListener<MessageActivateLocalSymbols>
|
||||
, public MessageListener<MessageActivateTokens>
|
||||
, public MessageListener<MessageActivateTrail>
|
||||
@@ -49,16 +50,15 @@ class UndoRedoController
|
||||
, public MessageListener<MessageGraphNodeExpand>
|
||||
, public MessageListener<MessageGraphNodeHide>
|
||||
, public MessageListener<MessageGraphNodeMove>
|
||||
, public MessageListener<MessageRedo>
|
||||
, public MessageListener<MessageHistoryRedo>
|
||||
, public MessageListener<MessageHistoryToPosition>
|
||||
, public MessageListener<MessageHistoryUndo>
|
||||
, public MessageListener<MessageRefresh>
|
||||
, public MessageListener<MessageScrollCode>
|
||||
, public MessageListener<MessageScrollGraph>
|
||||
, public MessageListener<MessageSearchFullText>
|
||||
, public MessageListener<MessageShowError>
|
||||
, public MessageListener<MessageShowReference>
|
||||
, public MessageListener<MessageShowScope>
|
||||
, public MessageListener<MessageToUndoRedoPosition>
|
||||
, public MessageListener<MessageUndo>
|
||||
{
|
||||
public:
|
||||
UndoRedoController(StorageAccess* storageAccess);
|
||||
@@ -87,6 +87,7 @@ private:
|
||||
|
||||
virtual void handleMessage(MessageActivateAll* message);
|
||||
virtual void handleMessage(MessageActivateErrors* message);
|
||||
virtual void handleMessage(MessageActivateFullTextSearch* message);
|
||||
virtual void handleMessage(MessageActivateLocalSymbols* message);
|
||||
virtual void handleMessage(MessageActivateTokens* message);
|
||||
virtual void handleMessage(MessageActivateTrail* message);
|
||||
@@ -98,16 +99,15 @@ private:
|
||||
virtual void handleMessage(MessageGraphNodeExpand* message);
|
||||
virtual void handleMessage(MessageGraphNodeHide* message);
|
||||
virtual void handleMessage(MessageGraphNodeMove* message);
|
||||
virtual void handleMessage(MessageRedo* message);
|
||||
virtual void handleMessage(MessageHistoryRedo* message);
|
||||
virtual void handleMessage(MessageHistoryToPosition* message);
|
||||
virtual void handleMessage(MessageHistoryUndo* message);
|
||||
virtual void handleMessage(MessageRefresh* message);
|
||||
virtual void handleMessage(MessageScrollCode* message);
|
||||
virtual void handleMessage(MessageScrollGraph* message);
|
||||
virtual void handleMessage(MessageSearchFullText* message);
|
||||
virtual void handleMessage(MessageShowError* message);
|
||||
virtual void handleMessage(MessageShowReference* message);
|
||||
virtual void handleMessage(MessageShowScope* message);
|
||||
virtual void handleMessage(MessageToUndoRedoPosition* message);
|
||||
virtual void handleMessage(MessageUndo* message);
|
||||
|
||||
void replayCommands();
|
||||
void replayCommands(std::list<Command>::iterator it);
|
||||
@@ -119,7 +119,6 @@ private:
|
||||
MessageBase* lastMessage() const;
|
||||
|
||||
void updateHistory();
|
||||
SearchMatch getSearchMatchForMessage(MessageBase* message) const;
|
||||
|
||||
void dump() const;
|
||||
|
||||
@@ -128,7 +127,6 @@ private:
|
||||
std::list<Command> m_list;
|
||||
std::list<Command>::iterator m_iterator;
|
||||
|
||||
std::deque<SearchMatch> m_history;
|
||||
size_t m_historyOffset;
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
struct SearchMatch;
|
||||
class Bookmark;
|
||||
class MessageBase;
|
||||
|
||||
class MainView
|
||||
: public ViewLayout
|
||||
@@ -27,7 +28,7 @@ public:
|
||||
virtual void activateWindow() = 0;
|
||||
|
||||
virtual void updateRecentProjectMenu() = 0;
|
||||
virtual void updateHistoryMenu(const std::vector<SearchMatch>& history) = 0;
|
||||
virtual void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems) = 0;
|
||||
virtual void updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>>& bookmarks) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -74,9 +74,8 @@ struct SearchMatch
|
||||
SearchType searchType;
|
||||
std::vector<size_t> indices;
|
||||
|
||||
int score;
|
||||
|
||||
bool hasChildren;
|
||||
int score = 0;
|
||||
bool hasChildren = false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,23 +1,34 @@
|
||||
#ifndef MESSAGE_ACTIVATE_ALL_H
|
||||
#define MESSAGE_ACTIVATE_ALL_H
|
||||
|
||||
#include "data/graph/Node.h"
|
||||
#include "data/NodeTypeSet.h"
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/messaging/type/MessageActivateBase.h"
|
||||
|
||||
#include "data/NodeTypeSet.h"
|
||||
|
||||
class MessageActivateAll
|
||||
: public Message<MessageActivateAll>
|
||||
, public MessageActivateBase
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageActivateAll";
|
||||
}
|
||||
|
||||
MessageActivateAll(NodeTypeSet acceptedNodeTypes = NodeTypeSet::all())
|
||||
: acceptedNodeTypes(acceptedNodeTypes)
|
||||
{
|
||||
setIsParallel(true);
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
{
|
||||
return "MessageActivateAll";
|
||||
if (acceptedNodeTypes != NodeTypeSet::all())
|
||||
{
|
||||
return SearchMatch::createCommandsForNodeTypes(acceptedNodeTypes);
|
||||
}
|
||||
return { SearchMatch::createCommand(SearchMatch::COMMAND_ALL) };
|
||||
}
|
||||
|
||||
NodeTypeSet acceptedNodeTypes;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef MESSAGE_ACTIVATE_BASE_H
|
||||
#define MESSAGE_ACTIVATE_BASE_H
|
||||
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
class MessageActivateBase
|
||||
{
|
||||
public:
|
||||
virtual ~MessageActivateBase() = default;
|
||||
|
||||
virtual std::vector<SearchMatch> getSearchMatches() const = 0;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_ACTIVATE_BASE_H
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef MESSAGE_ACTIVATE_FULLTEXT_SEARCH_H
|
||||
#define MESSAGE_ACTIVATE_FULLTEXT_SEARCH_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/messaging/type/MessageActivateBase.h"
|
||||
|
||||
class MessageActivateFullTextSearch
|
||||
: public Message<MessageActivateFullTextSearch>
|
||||
, public MessageActivateBase
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageActivateFullTextSearch";
|
||||
}
|
||||
|
||||
MessageActivateFullTextSearch(const std::wstring& searchTerm, bool caseSensitive = false)
|
||||
: searchTerm(searchTerm)
|
||||
, caseSensitive(caseSensitive)
|
||||
{
|
||||
}
|
||||
|
||||
void print(std::wostream& os) const override
|
||||
{
|
||||
os << searchTerm;
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
{
|
||||
std::wstring prefix(caseSensitive ? 2 : 1, SearchMatch::FULLTEXT_SEARCH_CHARACTER);
|
||||
SearchMatch match(prefix + searchTerm);
|
||||
match.searchType = SearchMatch::SEARCH_FULLTEXT;
|
||||
return { match };
|
||||
}
|
||||
|
||||
const std::wstring searchTerm;
|
||||
bool caseSensitive;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_ACTIVATE_FULLTEXT_SEARCH_H
|
||||
@@ -2,12 +2,14 @@
|
||||
#define MESSAGE_ACTIVATE_TOKENS_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/messaging/type/MessageActivateBase.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
#include "data/search/SearchMatch.h"
|
||||
|
||||
class MessageActivateTokens
|
||||
: public Message<MessageActivateTokens>
|
||||
, public MessageActivateBase
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
@@ -24,12 +26,31 @@ public:
|
||||
setKeepContent(other->keepContent());
|
||||
}
|
||||
|
||||
virtual void print(std::wostream& os) const
|
||||
void print(std::wostream& os) const override
|
||||
{
|
||||
for (const Id& id : tokenIds)
|
||||
{
|
||||
os << id << L" ";
|
||||
}
|
||||
|
||||
for (const SearchMatch& match : searchMatches)
|
||||
{
|
||||
os << match.tokenName.getQualifiedName() << L" ";
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
{
|
||||
if (isAggregation)
|
||||
{
|
||||
SearchMatch match;
|
||||
match.name = match.text = L"aggregation"; // TODO: show aggregation source and target
|
||||
match.searchType = SearchMatch::SEARCH_TOKEN;
|
||||
match.nodeType = NodeType::NODE_TYPE;
|
||||
return { match };
|
||||
}
|
||||
|
||||
return searchMatches;
|
||||
}
|
||||
|
||||
std::vector<NameHierarchy> getTokenNamesOfMatches() const
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#ifndef MESSAGE_NEW_ERRORS_H
|
||||
#define MESSAGE_NEW_ERRORS_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
#include "data/ErrorCountInfo.h"
|
||||
#include "data/ErrorInfo.h"
|
||||
|
||||
class MessageNewErrors
|
||||
: public Message<MessageNewErrors>
|
||||
{
|
||||
public:
|
||||
MessageNewErrors(const std::vector<ErrorInfo>& errors, ErrorCountInfo errorCount)
|
||||
: errors(errors)
|
||||
, errorCount(errorCount)
|
||||
{
|
||||
setSendAsTask(false);
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageNewErrors";
|
||||
}
|
||||
|
||||
virtual void print(std::wostream& os) const
|
||||
{
|
||||
os << errors.size() << L" errors";
|
||||
}
|
||||
|
||||
std::vector<ErrorInfo> errors;
|
||||
const ErrorCountInfo errorCount;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_NEW_ERRORS_H
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef MESSAGE_REDO_H
|
||||
#define MESSAGE_REDO_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageRedo
|
||||
: public Message<MessageRedo>
|
||||
{
|
||||
public:
|
||||
MessageRedo()
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageRedo";
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGE_REDO_H
|
||||
@@ -15,9 +15,8 @@ public:
|
||||
return "MessageSearch";
|
||||
}
|
||||
|
||||
MessageSearch(const std::vector<SearchMatch>& matches, NodeTypeSet acceptedNodeTypes = NodeTypeSet::all())
|
||||
: isFromSearch(true)
|
||||
, acceptedNodeTypes(acceptedNodeTypes)
|
||||
MessageSearch(const std::vector<SearchMatch>& matches, NodeTypeSet acceptedNodeTypes)
|
||||
: acceptedNodeTypes(acceptedNodeTypes)
|
||||
, m_matches(matches)
|
||||
{
|
||||
}
|
||||
@@ -27,41 +26,14 @@ public:
|
||||
return m_matches;
|
||||
}
|
||||
|
||||
std::vector<Id> getTokenIdsOfMatches() const
|
||||
{
|
||||
std::vector<Id> tokenIds;
|
||||
for (const SearchMatch& match : m_matches)
|
||||
{
|
||||
for (const Id tokenId : match.tokenIds)
|
||||
{
|
||||
if (tokenId)
|
||||
{
|
||||
tokenIds.push_back(tokenId);
|
||||
}
|
||||
}
|
||||
}
|
||||
return tokenIds;
|
||||
}
|
||||
|
||||
std::vector<NameHierarchy> getTokenNamesOfMatches() const
|
||||
{
|
||||
std::vector<NameHierarchy> tokenNames;
|
||||
for (const SearchMatch& match : m_matches)
|
||||
{
|
||||
tokenNames.push_back(match.tokenName);
|
||||
}
|
||||
return tokenNames;
|
||||
}
|
||||
|
||||
virtual void print(std::wostream& os) const
|
||||
{
|
||||
for (const SearchMatch& match : m_matches)
|
||||
{
|
||||
os << " @" << match.name << "-" << match.tokenName.getQualifiedName();
|
||||
os << " @" << match.name;
|
||||
}
|
||||
}
|
||||
|
||||
bool isFromSearch;
|
||||
NodeTypeSet acceptedNodeTypes;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
#ifndef MESSAGE_SEARCH_FULLTEXT_H
|
||||
#define MESSAGE_SEARCH_FULLTEXT_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageSearchFullText: public Message<MessageSearchFullText>
|
||||
{
|
||||
public:
|
||||
MessageSearchFullText(const std::wstring& searchTerm, bool caseSensitive = false)
|
||||
: searchTerm(searchTerm)
|
||||
, caseSensitive(caseSensitive)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageSearchFullText";
|
||||
}
|
||||
|
||||
virtual void print(std::wostream& os) const
|
||||
{
|
||||
os << searchTerm;
|
||||
}
|
||||
|
||||
const std::wstring searchTerm;
|
||||
bool caseSensitive;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_SEARCH_FULLTEXT_H
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef MESSAGE_TO_UNDO_REDO_POSITION_H
|
||||
#define MESSAGE_TO_UNDO_REDO_POSITION_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageToUndoRedoPosition
|
||||
: public Message<MessageToUndoRedoPosition>
|
||||
{
|
||||
public:
|
||||
MessageToUndoRedoPosition(size_t index)
|
||||
: index(index)
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageToUndoRedoPosition";
|
||||
}
|
||||
|
||||
size_t index;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_TO_UNDO_REDO_POSITION_H
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef MESSAGE_UNDO_H
|
||||
#define MESSAGE_UNDO_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageUndo
|
||||
: public Message<MessageUndo>
|
||||
{
|
||||
public:
|
||||
MessageUndo()
|
||||
{
|
||||
}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageUndo";
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGE_UNDO_H
|
||||
@@ -1,11 +1,14 @@
|
||||
#ifndef MESSAGE_ACTIVATE_ERRORS_H
|
||||
#define MESSAGE_ACTIVATE_ERRORS_H
|
||||
|
||||
#include "data/ErrorFilter.h"
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/messaging/type/MessageActivateBase.h"
|
||||
|
||||
#include "data/ErrorFilter.h"
|
||||
|
||||
class MessageActivateErrors
|
||||
: public Message<MessageActivateErrors>
|
||||
, public MessageActivateBase
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
@@ -19,6 +22,20 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
{
|
||||
std::vector<SearchMatch> matches = { SearchMatch::createCommand(SearchMatch::COMMAND_ERROR) };
|
||||
if (!file.empty())
|
||||
{
|
||||
SearchMatch match;
|
||||
match.name = match.text = file.fileName();
|
||||
match.searchType = SearchMatch::SEARCH_TOKEN;
|
||||
match.nodeType = NodeType::NODE_FILE;
|
||||
matches.push_back(match);
|
||||
}
|
||||
return matches;
|
||||
}
|
||||
|
||||
const ErrorFilter filter;
|
||||
const FilePath file;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MESSAGE_HISTORY_REDO_H
|
||||
#define MESSAGE_HISTORY_REDO_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageHistoryRedo
|
||||
: public Message<MessageHistoryRedo>
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageHistoryRedo";
|
||||
}
|
||||
|
||||
MessageHistoryRedo()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGE_HISTORY_REDO_H
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef MESSAGE_HISTORY_TO_POSITION_H
|
||||
#define MESSAGE_HISTORY_TO_POSITION_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageHistoryToPosition
|
||||
: public Message<MessageHistoryToPosition>
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageHistoryToPosition";
|
||||
}
|
||||
|
||||
MessageHistoryToPosition(size_t index)
|
||||
: index(index)
|
||||
{
|
||||
}
|
||||
|
||||
const size_t index;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_HISTORY_TO_POSITION_H
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MESSAGE_HISTORY_UNDO_H
|
||||
#define MESSAGE_HISTORY_UNDO_H
|
||||
|
||||
#include "utility/messaging/Message.h"
|
||||
|
||||
class MessageHistoryUndo
|
||||
: public Message<MessageHistoryUndo>
|
||||
{
|
||||
public:
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageHistoryUndo";
|
||||
}
|
||||
|
||||
MessageHistoryUndo()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // MESSAGE_HISTORY_UNDO_H
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QLabel>
|
||||
#include <QScrollBar>
|
||||
|
||||
#include "utility/messaging/type/MessageToUndoRedoPosition.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryToPosition.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
@@ -168,7 +168,7 @@ void QtHistoryList::onItemClicked(QListWidgetItem *item)
|
||||
{
|
||||
if (historyItem->index != m_currentIndex)
|
||||
{
|
||||
MessageToUndoRedoPosition(historyItem->index).dispatch();
|
||||
MessageHistoryToPosition(historyItem->index).dispatch();
|
||||
}
|
||||
close();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
#include "qt/element/QtSearchBarButton.h"
|
||||
@@ -96,5 +96,5 @@ void QtSearchBar::refreshStyle()
|
||||
|
||||
void QtSearchBar::homeButtonClicked()
|
||||
{
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ALL) }).dispatch();
|
||||
MessageActivateAll().dispatch();
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
#include "data/NodeTypeSet.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
#include "utility/messaging/type/MessageActivateFullTextSearch.h"
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/messaging/type/MessageSearchFullText.h"
|
||||
#include "utility/messaging/type/MessageSearchAutocomplete.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/utilityString.h"
|
||||
@@ -89,7 +89,7 @@ void QtSmartSearchBox::fullTextSearch()
|
||||
caseSensitive = true;
|
||||
}
|
||||
|
||||
MessageSearchFullText(term, caseSensitive).dispatch();
|
||||
MessageActivateFullTextSearch(term, caseSensitive).dispatch();
|
||||
}
|
||||
|
||||
QtSmartSearchBox::QtSmartSearchBox(QWidget* parent)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QMovie>
|
||||
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/messaging/type/error/MessageErrorsAll.h"
|
||||
#include "utility/messaging/type/MessageShowStatus.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
@@ -118,5 +118,5 @@ void QtStatusBar::showStatus()
|
||||
|
||||
void QtStatusBar::showErrors()
|
||||
{
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ERROR) }).dispatch();
|
||||
MessageErrorsAll().dispatch();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QTimer>
|
||||
|
||||
#include "utility/messaging/type/MessageUndo.h"
|
||||
#include "utility/messaging/type/MessageRedo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryUndo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryRedo.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
|
||||
#include "qt/element/QtHistoryList.h"
|
||||
@@ -91,7 +91,7 @@ void QtUndoRedo::undoReleased()
|
||||
if (m_pressed)
|
||||
{
|
||||
m_pressed = false;
|
||||
MessageUndo().dispatch();
|
||||
MessageHistoryUndo().dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void QtUndoRedo::redoReleased()
|
||||
if (m_pressed)
|
||||
{
|
||||
m_pressed = false;
|
||||
MessageRedo().dispatch();
|
||||
MessageHistoryRedo().dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <QUrl>
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/MessageRedo.h"
|
||||
#include "utility/messaging/type/MessageUndo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryRedo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryUndo.h"
|
||||
|
||||
QtContextMenu* QtContextMenu::s_instance;
|
||||
|
||||
@@ -103,12 +103,12 @@ void QtContextMenu::show()
|
||||
|
||||
void QtContextMenu::undoActionTriggered()
|
||||
{
|
||||
MessageUndo().dispatch();
|
||||
MessageHistoryUndo().dispatch();
|
||||
}
|
||||
|
||||
void QtContextMenu::redoActionTriggered()
|
||||
{
|
||||
MessageRedo().dispatch();
|
||||
MessageHistoryRedo().dispatch();
|
||||
}
|
||||
|
||||
void QtContextMenu::copyFullPathActionTriggered()
|
||||
|
||||
@@ -133,12 +133,12 @@ void QtMainView::updateRecentProjectMenu()
|
||||
);
|
||||
}
|
||||
|
||||
void QtMainView::updateHistoryMenu(const std::vector<SearchMatch>& history)
|
||||
void QtMainView::updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems)
|
||||
{
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
{
|
||||
m_window->updateHistoryMenu(history);
|
||||
m_window->updateHistoryMenu(historyMenuItems);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual void activateWindow();
|
||||
|
||||
virtual void updateRecentProjectMenu();
|
||||
virtual void updateHistoryMenu(const std::vector<SearchMatch>& history);
|
||||
virtual void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems);
|
||||
virtual void updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
|
||||
private:
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "utility/file/FileSystem.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/messaging/type/error/MessageErrorsHelpMessage.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryRedo.h"
|
||||
#include "utility/messaging/type/history/MessageHistoryUndo.h"
|
||||
#include "utility/messaging/type/MessageActivateAll.h"
|
||||
#include "utility/messaging/type/MessageActivateBase.h"
|
||||
#include "utility/messaging/type/MessageActivateBookmark.h"
|
||||
#include "utility/messaging/type/MessageCodeReference.h"
|
||||
#include "utility/messaging/type/MessageDisplayBookmarkCreator.h"
|
||||
@@ -37,11 +41,8 @@
|
||||
#include "utility/messaging/type/MessageFind.h"
|
||||
#include "utility/messaging/type/MessageInterruptTasks.h"
|
||||
#include "utility/messaging/type/MessageLoadProject.h"
|
||||
#include "utility/messaging/type/MessageRedo.h"
|
||||
#include "utility/messaging/type/MessageRefresh.h"
|
||||
#include "utility/messaging/type/MessageResetZoom.h"
|
||||
#include "utility/messaging/type/MessageSearch.h"
|
||||
#include "utility/messaging/type/MessageUndo.h"
|
||||
#include "utility/messaging/type/MessageWindowClosed.h"
|
||||
#include "utility/messaging/type/MessageZoom.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
@@ -83,12 +84,12 @@ bool MouseReleaseFilter::eventFilter(QObject* obj, QEvent* event)
|
||||
|
||||
if (mouseEvent->button() == m_backButton)
|
||||
{
|
||||
MessageUndo().dispatch();
|
||||
MessageHistoryUndo().dispatch();
|
||||
return true;
|
||||
}
|
||||
else if (mouseEvent->button() == m_forwardButton)
|
||||
{
|
||||
MessageRedo().dispatch();
|
||||
MessageHistoryRedo().dispatch();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -344,9 +345,9 @@ void QtMainWindow::forceEnterLicense(LicenseChecker::LicenseState state)
|
||||
connect(window, &QtWindow::canceled, dynamic_cast<QApplication*>(QCoreApplication::instance()), &QApplication::quit);
|
||||
}
|
||||
|
||||
void QtMainWindow::updateHistoryMenu(const std::vector<SearchMatch>& history)
|
||||
void QtMainWindow::updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems)
|
||||
{
|
||||
m_history = history;
|
||||
m_history = historyMenuItems;
|
||||
setupHistoryMenu();
|
||||
}
|
||||
|
||||
@@ -394,7 +395,7 @@ void QtMainWindow::keyPressEvent(QKeyEvent* event)
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_Backspace:
|
||||
MessageUndo().dispatch();
|
||||
MessageHistoryUndo().dispatch();
|
||||
break;
|
||||
|
||||
case Qt::Key_Escape:
|
||||
@@ -626,7 +627,7 @@ void QtMainWindow::codeReferenceNext()
|
||||
|
||||
void QtMainWindow::overview()
|
||||
{
|
||||
MessageSearch({ SearchMatch::createCommand(SearchMatch::COMMAND_ALL) }).dispatch();
|
||||
MessageActivateAll().dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::closeWindow()
|
||||
@@ -659,12 +660,12 @@ void QtMainWindow::forceRefresh()
|
||||
|
||||
void QtMainWindow::undo()
|
||||
{
|
||||
MessageUndo().dispatch();
|
||||
MessageHistoryUndo().dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::redo()
|
||||
{
|
||||
MessageRedo().dispatch();
|
||||
MessageHistoryRedo().dispatch();
|
||||
}
|
||||
|
||||
void QtMainWindow::zoomIn()
|
||||
@@ -755,9 +756,7 @@ void QtMainWindow::openHistoryAction()
|
||||
QAction* action = qobject_cast<QAction*>(sender());
|
||||
if (action)
|
||||
{
|
||||
MessageSearch msg({ m_history[action->data().toInt()] });
|
||||
msg.isFromSearch = false;
|
||||
msg.dispatch();
|
||||
m_history[action->data().toInt()]->dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -886,7 +885,13 @@ void QtMainWindow::setupHistoryMenu()
|
||||
|
||||
for (size_t i = 0; i < m_history.size(); i++)
|
||||
{
|
||||
SearchMatch& match = m_history[i];
|
||||
MessageActivateBase* msg = dynamic_cast<MessageActivateBase*>(m_history[i].get());
|
||||
if (!msg)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const SearchMatch match = msg->getSearchMatches()[0];
|
||||
const std::wstring name = utility::elide(match.getFullName(), utility::ELIDE_RIGHT, 50);
|
||||
|
||||
QAction* action = new QAction();
|
||||
|
||||
@@ -75,7 +75,7 @@ public:
|
||||
|
||||
void forceEnterLicense(LicenseChecker::LicenseState state);
|
||||
|
||||
void updateHistoryMenu(const std::vector<SearchMatch>& history);
|
||||
void updateHistoryMenu(const std::vector<std::shared_ptr<MessageBase>>& historyMenuItems);
|
||||
void updateBookmarksMenu(const std::vector<std::shared_ptr<Bookmark>>& bookmarks);
|
||||
|
||||
void setContentEnabled(bool enabled);
|
||||
@@ -183,7 +183,7 @@ private:
|
||||
QAction* m_viewSeparator;
|
||||
|
||||
QMenu* m_historyMenu;
|
||||
std::vector<SearchMatch> m_history;
|
||||
std::vector<std::shared_ptr<MessageBase>> m_history;
|
||||
|
||||
QMenu* m_bookmarksMenu;
|
||||
std::vector<std::shared_ptr<Bookmark>> m_bookmarks;
|
||||
|
||||
Reference in New Issue
Block a user