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

Method getStatus

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

* @brief Return overall dashboard window status. */

Source from the content-addressed store, hash-verified

202 * @brief Return overall dashboard window status.
203 */
204API::CommandResponse API::Handlers::WindowHandler::getStatus(const QString& id,
205 const QJsonObject& params)
206{
207 Q_UNUSED(params)
208
209 auto* taskbar = UI::UISessionRegistry::instance().primaryTaskbar();
210 auto* wm = UI::UISessionRegistry::instance().primaryWindowManager();
211
212 QJsonObject result;
213
214 if (!taskbar) {
215 result[QStringLiteral("sessionActive")] = false;
216 result[QStringLiteral("activeGroupId")] = -1;
217 result[QStringLiteral("activeGroupIndex")] = -1;
218 result[QStringLiteral("groupCount")] = 0;
219 result[QStringLiteral("hasMaximizedWindow")] = false;
220 result[QStringLiteral("autoLayoutEnabled")] = false;
221 return CommandResponse::makeSuccess(id, result);
222 }
223
224 const auto groups = taskbar->workspaceModel();
225
226 result[QStringLiteral("sessionActive")] = true;
227 result[QStringLiteral("activeGroupId")] = taskbar->activeGroupId();
228 result[QStringLiteral("activeGroupIndex")] = taskbar->activeGroupIndex();
229 result[QStringLiteral("groupCount")] = static_cast<int>(groups.size());
230 result[QStringLiteral("hasMaximizedWindow")] = taskbar->hasMaximizedWindow();
231 result[QStringLiteral("autoLayoutEnabled")] = wm ? wm->autoLayoutEnabled() : false;
232
233 return CommandResponse::makeSuccess(id, result);
234}
235
236/**
237 * @brief Return all groups from the taskbar model.

Callers

nothing calls this directly

Calls 8

primaryTaskbarMethod · 0.80
primaryWindowManagerMethod · 0.80
workspaceModelMethod · 0.80
activeGroupIndexMethod · 0.80
hasMaximizedWindowMethod · 0.80
autoLayoutEnabledMethod · 0.80
activeGroupIdMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected