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

Method applyThemeOverride

app/src/Misc/CLI.cpp:642–665  ·  view source on GitHub ↗

* @brief Activates the theme named by --theme, if any. */

Source from the content-addressed store, hash-verified

640 * @brief Activates the theme named by --theme, if any.
641 */
642void CLI::applyThemeOverride()
643{
644 if (!m_parser.isSet(m_opts.themeOpt))
645 return;
646
647 const QString name = m_parser.value(m_opts.themeOpt).trimmed();
648 if (name.isEmpty())
649 return;
650
651 auto& tm = Misc::ThemeManager::instance();
652 const QStringList& themes = tm.availableThemes();
653 const int idx = themes.indexOf(name);
654 if (idx < 0) {
655 qWarning().noquote() << "[CLI] Unknown --theme value:" << name
656 << "-- available themes:" << themes;
657 return;
658 }
659
660 if (runtimeMode())
661 tm.setSettingsPersistent(false);
662
663 if (tm.theme() != idx)
664 tm.setTheme(idx);
665}
666
667/**
668 * @brief Configures runtime/operator-mode export, dashboard, and taskbar overrides.

Callers 1

mainFunction · 0.80

Calls 6

isEmptyMethod · 0.80
themeMethod · 0.80
setThemeMethod · 0.80
valueMethod · 0.45
indexOfMethod · 0.45
setSettingsPersistentMethod · 0.45

Tested by

no test coverage detected