diff --git a/kcalc.cpp b/kcalc.cpp --- a/kcalc.cpp +++ b/kcalc.cpp @@ -1728,7 +1728,6 @@ action_constants_show_->setChecked(false); action_constants_show_->setEnabled(false); - action_bitset_show_->setChecked(false); action_bitset_show_->setEnabled(false); showMemButtons(false); showScienceButtons(false); @@ -1751,6 +1750,9 @@ constants_menu_ = 0; KCalcSettings::setCalculatorMode(KCalcSettings::EnumCalculatorMode::simple); + // must be done after setting the calculator mode because the + // slotBitsetshow slot should save the state only in numeral mode + action_bitset_show_->setChecked(false); } //------------------------------------------------------------------------------ @@ -1761,7 +1763,6 @@ action_constants_show_->setEnabled(true); action_constants_show_->setChecked(KCalcSettings::showConstants()); - action_bitset_show_->setChecked(false); action_bitset_show_->setEnabled(false); // show some individual buttons @@ -1787,6 +1788,9 @@ } KCalcSettings::setCalculatorMode(KCalcSettings::EnumCalculatorMode::science); + // must be done after setting the calculator mode because the + // slotBitsetshow slot should save the state only in numeral mode + action_bitset_show_->setChecked(false); } //------------------------------------------------------------------------------ @@ -1797,7 +1801,6 @@ action_constants_show_->setEnabled(true); action_constants_show_->setChecked(KCalcSettings::showConstants()); - action_bitset_show_->setChecked(false); action_bitset_show_->setEnabled(false); // show some individual buttons @@ -1823,6 +1826,9 @@ } KCalcSettings::setCalculatorMode(KCalcSettings::EnumCalculatorMode::statistics); + // must be done after setting the calculator mode because the + // slotBitsetshow slot should save the state only in numeral mode + action_bitset_show_->setChecked(false); } //------------------------------------------------------------------------------ @@ -2005,7 +2011,8 @@ void KCalculator::slotBitsetshow(bool toggled) { mBitset->setVisible(toggled); - KCalcSettings::setShowBitset(toggled); + if (KCalcSettings::calculatorMode() == KCalcSettings::EnumCalculatorMode::numeral) + KCalcSettings::setShowBitset(toggled); } //------------------------------------------------------------------------------