Added support for fractional inch user setting.

This commit is contained in:
hokieengr
2018-09-15 18:10:05 -04:00
committed by wmayer
parent b102e15569
commit 77060a75a6
5 changed files with 28 additions and 5 deletions

View File

@@ -98,6 +98,9 @@ void DlgSettingsUnitsImp::saveSettings()
// numerical fractional inch value) needs to be stored.
FracInch = std::pow(2, ui->comboBox_FracInch->currentIndex() + 1);
hGrp->SetInt("FracInch", FracInch);
// Set the actual format value
Base::QuantityFormat::setDenominator(FracInch);
}
void DlgSettingsUnitsImp::loadSettings()
@@ -111,7 +114,7 @@ void DlgSettingsUnitsImp::loadSettings()
ui->spinBoxDecimals->setValue(hGrp->GetInt("Decimals",Base::UnitsApi::getDecimals()));
// Get the current user setting for the minimum fractional inch
FracInch = hGrp->GetInt("FracInch",8); // 8==1/8"
FracInch = hGrp->GetInt("FracInch", Base::QuantityFormat::getDenominator());
// Convert fractional inch to the corresponding combobox index using this
// handy little equation.