ui: Changed full text search character to ? and added shortcut CTRL+SHIFT+F
This commit is contained in:
@@ -47,7 +47,14 @@ void SearchController::handleMessage(MessageActivateTokens* message)
|
||||
|
||||
void SearchController::handleMessage(MessageFind* message)
|
||||
{
|
||||
getView()->setFocus();
|
||||
if (message->findFulltext)
|
||||
{
|
||||
getView()->findFulltext();
|
||||
}
|
||||
else
|
||||
{
|
||||
getView()->setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void SearchController::handleMessage(MessageSearchAutocomplete* message)
|
||||
@@ -59,11 +66,8 @@ void SearchController::handleMessage(MessageSearchAutocomplete* message)
|
||||
void SearchController::handleMessage(MessageSearchFullText* message)
|
||||
{
|
||||
LOG_INFO("fulltext string: \"" + message->searchTerm + "\"");
|
||||
std::string prefix = "@";
|
||||
if (message->caseSensitive)
|
||||
{
|
||||
prefix += "@";
|
||||
}
|
||||
std::string 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));
|
||||
|
||||
@@ -16,7 +16,10 @@ public:
|
||||
virtual std::string getName() const;
|
||||
|
||||
virtual void setMatches(const std::vector<SearchMatch>& matches) = 0;
|
||||
|
||||
virtual void setFocus() = 0;
|
||||
virtual void findFulltext() = 0;
|
||||
|
||||
virtual void setAutocompletionList(const std::vector<SearchMatch>& autocompletionList) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -34,6 +34,8 @@ struct SearchMatch
|
||||
static SearchMatch createCommand(CommandType type);
|
||||
static std::string getCommandName(CommandType type);
|
||||
|
||||
static const char FULLTEXT_SEARCH_CHARACTER = '?';
|
||||
|
||||
SearchMatch();
|
||||
SearchMatch(const std::string& query);
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
#include "utility/messaging/Message.h"
|
||||
#include "utility/types.h"
|
||||
|
||||
class MessageFind: public Message<MessageFind>
|
||||
class MessageFind
|
||||
: public Message<MessageFind>
|
||||
{
|
||||
public:
|
||||
MessageFind()
|
||||
MessageFind(bool fulltext = false)
|
||||
: findFulltext(fulltext)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -15,6 +17,8 @@ public:
|
||||
{
|
||||
return "MessageFind";
|
||||
}
|
||||
|
||||
bool findFulltext;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_FIND_H
|
||||
|
||||
Reference in New Issue
Block a user