* @brief Register layout save/load/serialize commands. */
| 119 | * @brief Register layout save/load/serialize commands. |
| 120 | */ |
| 121 | void API::Handlers::WindowHandler::registerLayoutCommands() |
| 122 | { |
| 123 | auto& registry = CommandRegistry::instance(); |
| 124 | const auto empty = API::emptySchema(); |
| 125 | |
| 126 | registry.registerCommand(QStringLiteral("ui.window.setAutoLayout"), |
| 127 | QStringLiteral("Enable or disable auto layout (params: enabled bool)"), |
| 128 | API::makeSchema({ |
| 129 | {QStringLiteral("enabled"), |
| 130 | QStringLiteral("boolean"), |
| 131 | QStringLiteral("Whether to enable auto layout")} |
| 132 | }), |
| 133 | &setAutoLayout); |
| 134 | registry.registerCommand(QStringLiteral("ui.window.saveLayout"), |
| 135 | QStringLiteral("Save current window layout to project"), |
| 136 | empty, |
| 137 | &saveLayout); |
| 138 | registry.registerCommand(QStringLiteral("ui.window.loadLayout"), |
| 139 | QStringLiteral("Load window layout from project"), |
| 140 | empty, |
| 141 | &loadLayout); |
| 142 | registry.registerCommand(QStringLiteral("ui.window.getLayout"), |
| 143 | QStringLiteral("Get serialized layout JSON from WindowManager"), |
| 144 | empty, |
| 145 | &getLayout); |
| 146 | registry.registerCommand( |
| 147 | QStringLiteral("ui.window.setLayout"), |
| 148 | QStringLiteral("Apply a layout to WindowManager (params: layout object)"), |
| 149 | API::makeSchema({ |
| 150 | {QStringLiteral("layout"), |
| 151 | QStringLiteral("object"), |
| 152 | QStringLiteral("The layout object to apply")} |
| 153 | }), |
| 154 | &setLayout); |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * @brief Register per-widget settings persistence commands. |
nothing calls this directly
no test coverage detected