MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / registerStatusCommands

Method registerStatusCommands

app/src/API/Handlers/WindowHandler.cpp:62–92  ·  view source on GitHub ↗

* @brief Register status / group-listing commands. */

Source from the content-addressed store, hash-verified

60 * @brief Register status / group-listing commands.
61 */
62void API::Handlers::WindowHandler::registerStatusCommands()
63{
64 auto& registry = CommandRegistry::instance();
65 const auto empty = API::emptySchema();
66
67 registry.registerCommand(
68 QStringLiteral("ui.window.getStatus"),
69 QStringLiteral("Get dashboard window status: activeGroupId, groupCount, autoLayoutEnabled"),
70 empty,
71 &getStatus);
72 registry.registerCommand(QStringLiteral("ui.window.listGroups"),
73 QStringLiteral("Get list of groups as [{id, text, icon}]"),
74 empty,
75 &getGroups);
76 registry.registerCommand(QStringLiteral("ui.window.setActiveGroup"),
77 QStringLiteral("Set active group by ID (params: groupId int)"),
78 API::makeSchema({
79 {QStringLiteral("groupId"),
80 QStringLiteral("integer"),
81 QStringLiteral("The group ID to activate")}
82 }),
83 &setActiveGroup);
84 registry.registerCommand(QStringLiteral("ui.window.setActiveGroupIndex"),
85 QStringLiteral("Set active group by index (params: index int)"),
86 API::makeSchema({
87 {QStringLiteral("index"),
88 QStringLiteral("integer"),
89 QStringLiteral("The group index to activate")}
90 }),
91 &setActiveGroupIndex);
92}
93
94/**
95 * @brief Register window-state read/write commands.

Callers

nothing calls this directly

Calls 3

emptySchemaFunction · 0.85
registerCommandMethod · 0.80
makeSchemaFunction · 0.70

Tested by

no test coverage detected