MCPcopy Create free account
hub / github.com/KDE/kdevelop / updateStyleButtons

Method updateStyleButtons

kdevplatform/shell/sourceformatterselectionedit.cpp:640–657  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640void SourceFormatterSelectionEditPrivate::updateStyleButtons()
641{
642 if (languages.empty() || !currentStyle()) {
643 ui.btnDelStyle->setEnabled(false);
644 ui.btnEditStyle->setEnabled(false);
645 // Forbid creating a new style not based on an existing (selected) style,
646 // because it would be useless with no MIME types and no way to add them.
647 ui.btnNewStyle->setEnabled(false);
648 return;
649 }
650
651 const bool userDefined = isUserDefinedStyle(validCurrentStyle());
652 const bool hasEditWidget = currentFormatter().formatter().hasEditStyleWidget();
653
654 ui.btnDelStyle->setEnabled(userDefined);
655 ui.btnEditStyle->setEnabled(userDefined && hasEditWidget);
656 ui.btnNewStyle->setEnabled(hasEditWidget);
657}
658
659void SourceFormatterSelectionEditPrivate::updatePreview()
660{

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
setEnabledMethod · 0.45
hasEditStyleWidgetMethod · 0.45

Tested by

no test coverage detected