MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / refreshResetButton

Method refreshResetButton

src/gui/TokenEditorWidget.cpp:640–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640void TokenEditorWidget::refreshResetButton()
641{
642 if (m_currentToken.isEmpty()) {
643 m_resetBtn->setEnabled(false);
644 return;
645 }
646 auto& tm = ThemeManager::instance();
647 if (m_activeContainerPath.isEmpty()) {
648 // Root scope: Reset loads the bundled factory value into the
649 // edit buffer for the user to confirm via OK. Only useful
650 // when there's a factory value to fall back to.
651 m_resetBtn->setEnabled(tm.hasFactoryValue(m_currentToken));
652 } else {
653 // Nested scope: Reset means "clear my override here" — useful
654 // only when there IS an override at this scope to clear.
655 // Mirrors right-click → Clear Override on the scope-chain
656 // column, so the button's enable state matches that semantic.
657 m_resetBtn->setEnabled(
658 tm.isOverriddenAt(m_activeContainerPath, m_currentToken));
659 }
660}
661
662// ───────────────────────────────────────────────────────── markDirty ─────
663

Callers

nothing calls this directly

Calls 4

hasFactoryValueMethod · 0.80
isOverriddenAtMethod · 0.80
isEmptyMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected