ui: added color_scheme_test command displaying all graph node types and states
implementations for other views comming.
This commit is contained in:
@@ -32,6 +32,7 @@ PersistentStorage::PersistentStorage(const FilePath& dbPath)
|
||||
{
|
||||
m_commandIndex.addNode(0, NameHierarchy(SearchMatch::getCommandName(SearchMatch::COMMAND_ALL)));
|
||||
m_commandIndex.addNode(0, NameHierarchy(SearchMatch::getCommandName(SearchMatch::COMMAND_ERROR)));
|
||||
m_commandIndex.addNode(0, NameHierarchy(SearchMatch::getCommandName(SearchMatch::COMMAND_COLOR_SCHEME_TEST)));
|
||||
m_commandIndex.finishSetup();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ std::string NameHierarchy::serialize(NameHierarchy nameHierarchy)
|
||||
NameHierarchy NameHierarchy::deserialize(const std::string& serializedName)
|
||||
{
|
||||
NameHierarchy nameHierarchy;
|
||||
|
||||
|
||||
std::vector<std::string> serializedNameElements = utility::splitToVector(serializedName, "\n");
|
||||
for (size_t i = 0; i < serializedNameElements.size(); i++)
|
||||
{
|
||||
@@ -46,6 +46,14 @@ NameHierarchy::NameHierarchy(const std::string& name)
|
||||
push(std::make_shared<NameElement>(name));
|
||||
}
|
||||
|
||||
NameHierarchy::NameHierarchy(const std::vector<std::string>& names)
|
||||
{
|
||||
for (const std::string& name : names)
|
||||
{
|
||||
push(std::make_shared<NameElement>(name));
|
||||
}
|
||||
}
|
||||
|
||||
NameHierarchy::~NameHierarchy()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
|
||||
NameHierarchy();
|
||||
NameHierarchy(const std::string& name);
|
||||
NameHierarchy(const std::vector<std::string>& names);
|
||||
~NameHierarchy();
|
||||
|
||||
void push(std::shared_ptr<NameElement> element);
|
||||
|
||||
@@ -32,7 +32,6 @@ std::string SearchMatch::getSearchTypeName(SearchType type)
|
||||
case SEARCH_FULLTEXT:
|
||||
return "fulltext";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string SearchMatch::searchMatchesToString(const std::vector<SearchMatch>& matches)
|
||||
@@ -64,11 +63,31 @@ std::string SearchMatch::getCommandName(CommandType type)
|
||||
return "overview";
|
||||
case COMMAND_ERROR:
|
||||
return "error";
|
||||
case COMMAND_COLOR_SCHEME_TEST:
|
||||
return "color_scheme_test";
|
||||
}
|
||||
|
||||
return "none";
|
||||
}
|
||||
|
||||
SearchMatch::CommandType SearchMatch::getCommandType(const std::string& name)
|
||||
{
|
||||
if (name == "overview")
|
||||
{
|
||||
return COMMAND_ALL;
|
||||
}
|
||||
else if (name == "error")
|
||||
{
|
||||
return COMMAND_ERROR;
|
||||
}
|
||||
else if (name == "color_scheme_test")
|
||||
{
|
||||
return COMMAND_COLOR_SCHEME_TEST;
|
||||
}
|
||||
|
||||
return COMMAND_ALL;
|
||||
}
|
||||
|
||||
SearchMatch::SearchMatch()
|
||||
: typeName("")
|
||||
, searchType(SEARCH_NONE)
|
||||
|
||||
@@ -23,7 +23,8 @@ struct SearchMatch
|
||||
enum CommandType
|
||||
{
|
||||
COMMAND_ALL,
|
||||
COMMAND_ERROR
|
||||
COMMAND_ERROR,
|
||||
COMMAND_COLOR_SCHEME_TEST
|
||||
};
|
||||
|
||||
static void log(const std::vector<SearchMatch>& matches, const std::string& query);
|
||||
@@ -33,6 +34,7 @@ struct SearchMatch
|
||||
|
||||
static SearchMatch createCommand(CommandType type);
|
||||
static std::string getCommandName(CommandType type);
|
||||
static CommandType getCommandType(const std::string& name);
|
||||
|
||||
static const char FULLTEXT_SEARCH_CHARACTER = '?';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user