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

Method saveLayout

app/src/UI/Taskbar.cpp:361–383  ·  view source on GitHub ↗

* @brief Serializes the active group's layout and writes it to the project file; * no-ops during a layout restore so restore-driven signals can't loop back. */

Source from the content-addressed store, hash-verified

359 * no-ops during a layout restore so restore-driven signals can't loop back.
360 */
361void UI::Taskbar::saveLayout()
362{
363 if (!m_windowManager || m_windowIDs.isEmpty() || m_activeGroupId < -2)
364 return;
365
366 if (m_restoringLayout)
367 return;
368
369 const auto opMode = AppState::instance().operationMode();
370 if (opMode != SerialStudio::ProjectFile)
371 return;
372
373 auto* model = &DataModel::ProjectModel::instance();
374 if (model->jsonFilePath().isEmpty())
375 return;
376
377 if (m_taskbarButtons && m_windowIDs.count() < m_taskbarButtons->rowCount())
378 return;
379
380 model->saveWidgetSetting(Keys::layoutKey(m_layoutScope, m_activeGroupId),
381 QStringLiteral("data"),
382 m_windowManager->serializeLayout());
383}
384
385//--------------------------------------------------------------------------------------------------
386// Taskbar group selection code (e.g. when a tab is selected in the tab bar)

Callers

nothing calls this directly

Calls 7

layoutKeyFunction · 0.85
isEmptyMethod · 0.80
operationModeMethod · 0.80
rowCountMethod · 0.80
saveWidgetSettingMethod · 0.80
serializeLayoutMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected