Skip to content

Commit

Permalink
Fixes #133: ibu/color formulae do not persist
Browse files Browse the repository at this point in the history
  • Loading branch information
rocketman768 committed Feb 8, 2016
1 parent 3fc9b3c commit 6d572f9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/OptionDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,10 @@ void OptionDialog::saveAndClose()
break;
}

Brewtarget::ibuFormula = Brewtarget::IbuType(
ibuFormulaComboBox->itemData(ibuFormulaComboBox->currentIndex()).toInt(&okay));

Brewtarget::colorFormula = Brewtarget::ColorType(
colorFormulaComboBox->itemData(colorFormulaComboBox->currentIndex()).toInt(&okay));
int ndx = ibuFormulaComboBox->itemData(ibuFormulaComboBox->currentIndex()).toInt(&okay);
Brewtarget::ibuFormula = static_cast<Brewtarget::IbuType>(ndx);
ndx = colorFormulaComboBox->itemData(colorFormulaComboBox->currentIndex()).toInt(&okay);
Brewtarget::colorFormula = static_cast<Brewtarget::ColorType>(ndx);

// Set the right language.
Brewtarget::setLanguage( ndxToLangCode[ comboBox_lang->currentIndex() ] );
Expand Down Expand Up @@ -357,8 +356,8 @@ void OptionDialog::showChanges()
dateComboBox->setCurrentIndex(dateComboBox->findData(Brewtarget::dateFormat));
colorComboBox->setCurrentIndex(colorComboBox->findData(Brewtarget::colorUnit));

colorFormulaComboBox->setCurrentIndex(colorFormulaComboBox->findData(Brewtarget::ibuFormula));
ibuFormulaComboBox->setCurrentIndex(ibuFormulaComboBox->findData(Brewtarget::colorFormula));
colorFormulaComboBox->setCurrentIndex(colorFormulaComboBox->findData(Brewtarget::colorFormula));
ibuFormulaComboBox->setCurrentIndex(ibuFormulaComboBox->findData(Brewtarget::ibuFormula));

// Data directory
lineEdit_dbDir->setText(Brewtarget::getUserDataDir().canonicalPath());
Expand Down

0 comments on commit 6d572f9

Please sign in to comment.