* @brief Register status / group-listing commands. */
| 60 | * @brief Register status / group-listing commands. |
| 61 | */ |
| 62 | void 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. |
nothing calls this directly
no test coverage detected