--- a/src/EditRecipeTab5.cpp Mon Jun 13 16:47:52 2022 +0200 +++ b/src/EditRecipeTab5.cpp Mon Jun 13 17:34:51 2022 +0200 @@ -20,11 +20,11 @@ bool EditRecipe::yeast_sort_test(const Yeasts &D1, const Yeasts &D2) { - if (D1.y_use > D2.y_use) + if (D1.use > D2.use) return false; - if (D1.y_use < D2.y_use) + if (D1.use < D2.use) return true; - return (D1.y_amount > D2.y_amount); + return (D1.amount > D2.amount); } @@ -60,40 +60,40 @@ for (int i = 0; i < recipe->yeasts.size(); i++) { - ui->yeastsTable->setItem(i, 0, new QTableWidgetItem(recipe->yeasts.at(i).y_name)); - ui->yeastsTable->setItem(i, 1, new QTableWidgetItem(recipe->yeasts.at(i).y_laboratory)); - ui->yeastsTable->setItem(i, 2, new QTableWidgetItem(recipe->yeasts.at(i).y_product_id)); + ui->yeastsTable->setItem(i, 0, new QTableWidgetItem(recipe->yeasts.at(i).name)); + ui->yeastsTable->setItem(i, 1, new QTableWidgetItem(recipe->yeasts.at(i).laboratory)); + ui->yeastsTable->setItem(i, 2, new QTableWidgetItem(recipe->yeasts.at(i).product_id)); - item = new QTableWidgetItem(yeast_forms[recipe->yeasts.at(i).y_form]); + item = new QTableWidgetItem(yeast_forms[recipe->yeasts.at(i).form]); item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 3, item); - item = new QTableWidgetItem(yeast_use[recipe->yeasts.at(i).y_use]); + item = new QTableWidgetItem(yeast_use[recipe->yeasts.at(i).use]); item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 4, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).y_min_temperature, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).min_temperature, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 5, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).y_max_temperature, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).max_temperature, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 6, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).y_tolerance, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).tolerance, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 7, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).y_attenuation, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(i).attenuation, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 8, item); - if (recipe->yeasts.at(i).y_form == 0) - item = new QTableWidgetItem(QString("%1 pack").arg(recipe->yeasts.at(i).y_amount, 1, 'f', 0, '0')); - else if (recipe->yeasts.at(i).y_form == 1) - item = new QTableWidgetItem(QString("%1 gr").arg(recipe->yeasts.at(i).y_amount * 1000.0, 3, 'f', 2, '0')); + if (recipe->yeasts.at(i).form == 0) + item = new QTableWidgetItem(QString("%1 pack").arg(recipe->yeasts.at(i).amount, 1, 'f', 0, '0')); + else if (recipe->yeasts.at(i).form == 1) + item = new QTableWidgetItem(QString("%1 gr").arg(recipe->yeasts.at(i).amount * 1000.0, 3, 'f', 2, '0')); else - item = new QTableWidgetItem(QString("%1 ml").arg(recipe->yeasts.at(i).y_amount * 1000.0, 3, 'f', 2, '0')); + item = new QTableWidgetItem(QString("%1 ml").arg(recipe->yeasts.at(i).amount * 1000.0, 3, 'f', 2, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(i, 9, item); @@ -141,19 +141,19 @@ return; // No yeast in recipe. for (int i = 0; i < recipe->yeasts.size(); i++) { - if (recipe->yeasts.at(i).y_use == 0) { // Primary - if (recipe->yeasts.at(i).y_form == 1) { + if (recipe->yeasts.at(i).use == 0) { // Primary + if (recipe->yeasts.at(i).form == 1) { /* * Dry yeast, build the formule with the yeast parameters. * Based on https://www.lallemandbrewing.com/en/canada/brewers-corner/brewing-tools/pitching-rate-calculator/ */ ui->yeastProcedure->setCurrentIndex(2); - ui->lo_gr_hlEdit->setValue(recipe->yeasts.at(i).y_gr_hl_lo); - ui->hi_gr_hlEdit->setValue(recipe->yeasts.at(i).y_gr_hl_hi); - ui->lo_sgEdit->setValue(recipe->yeasts.at(i).y_sg_lo); - ui->hi_sgEdit->setValue(recipe->yeasts.at(i).y_sg_hi); - double og = recipe->yeasts.at(i).y_sg_lo; - double f1 = recipe->yeasts.at(i).y_gr_hl_lo / 100.0; + ui->lo_gr_hlEdit->setValue(recipe->yeasts.at(i).gr_hl_lo); + ui->hi_gr_hlEdit->setValue(recipe->yeasts.at(i).gr_hl_hi); + ui->lo_sgEdit->setValue(recipe->yeasts.at(i).sg_lo); + ui->hi_sgEdit->setValue(recipe->yeasts.at(i).sg_hi); + double og = recipe->yeasts.at(i).sg_lo; + double f1 = recipe->yeasts.at(i).gr_hl_lo / 100.0; double f2 = round(f1 / 5 * 1000000.0) / 1000000.0; double multiplier = (sg <= og) ? f1 : (f1 + f2 * (sg - og) / 0.008); qDebug() << " sg:" << sg << "og:" << og << "f1:" << f1 << "f2:" << f2 << "multiplier:" << multiplier; @@ -170,21 +170,21 @@ * and http://braukaiser.com/blog/blog/2012/11/03/estimating-yeast-growth/ */ ui->yeastProcedure->setCurrentIndex(1); - if (recipe->yeasts.at(i).y_type == 0) { // Lager yeast + if (recipe->yeasts.at(i).type == 0) { // Lager yeast pitchrate = 1.5; if (sg > 1.060) pitchrate = 2.0; - } else if (recipe->yeasts.at(i).y_type == 6) { // Real Kveik + } else if (recipe->yeasts.at(i).type == 6) { // Real Kveik pitchrate = 0.075; } else { pitchrate = 0.75; if (sg > 1.060) pitchrate = 1.0; } - if (recipe->yeasts.at(i).y_form == 0) - initcells = (recipe->yeasts.at(i).y_cells / 1000000000) * recipe->yeasts.at(i).y_amount * 0.97; // 97% viability assumed. + if (recipe->yeasts.at(i).form == 0) + initcells = (recipe->yeasts.at(i).cells / 1000000000) * recipe->yeasts.at(i).amount * 0.97; // 97% viability assumed. else - initcells = (recipe->yeasts.at(i).y_cells / 1000000) * recipe->yeasts.at(i).y_amount * 0.97; + initcells = (recipe->yeasts.at(i).cells / 1000000) * recipe->yeasts.at(i).amount * 0.97; double needed = round(pitchrate * volume * plato * 10.0) / 10.0; double starter = 0; @@ -213,36 +213,36 @@ qDebug() << "Add yeast row"; for (int i = 0; i < recipe->yeasts.size(); i++) { - if (recipe->yeasts.at(i).y_amount == 0) + if (recipe->yeasts.at(i).amount == 0) return; // Add only one at a time. } - newy.y_name = "Select one"; - newy.y_laboratory = ""; - newy.y_product_id = ""; - newy.y_amount = 0; - newy.y_type = 0; - newy.y_form = 0; - newy.y_min_temperature = 0; - newy.y_max_temperature = 0; - newy.y_flocculation = 0; - newy.y_attenuation = 0; - newy.y_cells = 0; - newy.y_tolerance = 0; - newy.y_inventory = 0; - newy.y_use = 0; - newy.y_sta1 = false; - newy.y_bacteria = false; - newy.y_harvest_top = false; - newy.y_harvest_time = 0; - newy.y_pitch_temperature = 0; - newy.y_pofpos = false; - newy.y_zymocide = 0; - newy.y_gr_hl_lo = 0; - newy.y_sg_lo = 0; - newy.y_gr_hl_hi = 0; - newy.y_sg_hi = 0; - newy.y_cost = 0; + newy.name = "Select one"; + newy.laboratory = ""; + newy.product_id = ""; + newy.amount = 0; + newy.type = 0; + newy.form = 0; + newy.min_temperature = 0; + newy.max_temperature = 0; + newy.flocculation = 0; + newy.attenuation = 0; + newy.cells = 0; + newy.tolerance = 0; + newy.inventory = 0; + newy.use = 0; + newy.sta1 = false; + newy.bacteria = false; + newy.harvest_top = false; + newy.harvest_time = 0; + newy.pitch_temperature = 0; + newy.pofpos = false; + newy.zymocide = 0; + newy.gr_hl_lo = 0; + newy.sg_lo = 0; + newy.gr_hl_hi = 0; + newy.sg_hi = 0; + newy.cost = 0; recipe->yeasts.append(newy); emit refreshAll(); @@ -258,7 +258,7 @@ int row = pb->objectName().toInt(); qDebug() << "Delete yeast row" << row << recipe->yeasts.size(); - int rc = QMessageBox::warning(this, tr("Delete yeast"), tr("Delete %1").arg(recipe->yeasts.at(row).y_name), + int rc = QMessageBox::warning(this, tr("Delete yeast"), tr("Delete %1").arg(recipe->yeasts.at(row).name), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (rc == QMessageBox::No) return; @@ -275,14 +275,14 @@ qDebug() << "yeast_amount_changed()" << recipe->yeasts_row << val; - if (recipe->yeasts.at(recipe->yeasts_row).y_form == 0) { - recipe->yeasts[recipe->yeasts_row].y_amount = val; + if (recipe->yeasts.at(recipe->yeasts_row).form == 0) { + recipe->yeasts[recipe->yeasts_row].amount = val; item = new QTableWidgetItem(QString("%1 pack").arg(val, 1, 'f', 0, '0')); - } else if (recipe->yeasts.at(recipe->yeasts_row).y_form == 1) { - recipe->yeasts[recipe->yeasts_row].y_amount = val / 1000.0; + } else if (recipe->yeasts.at(recipe->yeasts_row).form == 1) { + recipe->yeasts[recipe->yeasts_row].amount = val / 1000.0; item = new QTableWidgetItem(QString("%1 gr").arg(val, 3, 'f', 2, '0')); } else { - recipe->yeasts[recipe->yeasts_row].y_amount = val / 1000.0; + recipe->yeasts[recipe->yeasts_row].amount = val / 1000.0; item = new QTableWidgetItem(QString("%1 ml").arg(val, 3, 'f', 2, '0')); } item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); @@ -310,7 +310,7 @@ */ QString sql = "SELECT name,laboratory,product_id,type,form,min_temperature,max_temperature,flocculation,attenuation," "cells,tolerance,sta1,bacteria,harvest_top,harvest_time,pitch_temperature,pofpos,zymocide," - "gr_hl_lo,sg_lo,gr_hl_hi,sg_hi,cost FROM inventory_yeasts "; + "gr_hl_lo,sg_lo,gr_hl_hi,sg_hi,cost FROM inventoryeasts "; if (instock) sql.append("WHERE inventory > 0 "); sql.append("ORDER BY laboratory,product_id,name"); @@ -325,41 +325,41 @@ /* * Replace the yeast record contents */ - recipe->yeasts[recipe->yeasts_row].y_name = query.value(0).toString(); - recipe->yeasts[recipe->yeasts_row].y_laboratory = query.value(1).toString(); - recipe->yeasts[recipe->yeasts_row].y_product_id = query.value(2).toString(); - recipe->yeasts[recipe->yeasts_row].y_type = query.value(3).toInt(); - recipe->yeasts[recipe->yeasts_row].y_form = query.value(4).toInt(); - recipe->yeasts[recipe->yeasts_row].y_min_temperature = query.value(5).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_max_temperature = query.value(6).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_flocculation = query.value(7).toInt(); - recipe->yeasts[recipe->yeasts_row].y_attenuation = query.value(8).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_cells = query.value(9).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_tolerance = query.value(10).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_sta1 = query.value(11).toInt() ? true:false; - recipe->yeasts[recipe->yeasts_row].y_bacteria = query.value(12).toInt() ? true:false; - recipe->yeasts[recipe->yeasts_row].y_harvest_top = query.value(13).toInt() ? true:false; - recipe->yeasts[recipe->yeasts_row].y_harvest_time = query.value(14).toInt(); - recipe->yeasts[recipe->yeasts_row].y_pitch_temperature = query.value(15).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_pofpos = query.value(16).toInt() ? true:false; - recipe->yeasts[recipe->yeasts_row].y_zymocide = query.value(17).toInt(); - recipe->yeasts[recipe->yeasts_row].y_gr_hl_lo = query.value(18).toInt(); - recipe->yeasts[recipe->yeasts_row].y_sg_lo = query.value(19).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_gr_hl_hi = query.value(20).toInt(); - recipe->yeasts[recipe->yeasts_row].y_sg_hi = query.value(21).toDouble(); - recipe->yeasts[recipe->yeasts_row].y_cost = query.value(22).toDouble(); + recipe->yeasts[recipe->yeasts_row].name = query.value(0).toString(); + recipe->yeasts[recipe->yeasts_row].laboratory = query.value(1).toString(); + recipe->yeasts[recipe->yeasts_row].product_id = query.value(2).toString(); + recipe->yeasts[recipe->yeasts_row].type = query.value(3).toInt(); + recipe->yeasts[recipe->yeasts_row].form = query.value(4).toInt(); + recipe->yeasts[recipe->yeasts_row].min_temperature = query.value(5).toDouble(); + recipe->yeasts[recipe->yeasts_row].max_temperature = query.value(6).toDouble(); + recipe->yeasts[recipe->yeasts_row].flocculation = query.value(7).toInt(); + recipe->yeasts[recipe->yeasts_row].attenuation = query.value(8).toDouble(); + recipe->yeasts[recipe->yeasts_row].cells = query.value(9).toDouble(); + recipe->yeasts[recipe->yeasts_row].tolerance = query.value(10).toDouble(); + recipe->yeasts[recipe->yeasts_row].sta1 = query.value(11).toInt() ? true:false; + recipe->yeasts[recipe->yeasts_row].bacteria = query.value(12).toInt() ? true:false; + recipe->yeasts[recipe->yeasts_row].harvest_top = query.value(13).toInt() ? true:false; + recipe->yeasts[recipe->yeasts_row].harvest_time = query.value(14).toInt(); + recipe->yeasts[recipe->yeasts_row].pitch_temperature = query.value(15).toDouble(); + recipe->yeasts[recipe->yeasts_row].pofpos = query.value(16).toInt() ? true:false; + recipe->yeasts[recipe->yeasts_row].zymocide = query.value(17).toInt(); + recipe->yeasts[recipe->yeasts_row].gr_hl_lo = query.value(18).toInt(); + recipe->yeasts[recipe->yeasts_row].sg_lo = query.value(19).toDouble(); + recipe->yeasts[recipe->yeasts_row].gr_hl_hi = query.value(20).toInt(); + recipe->yeasts[recipe->yeasts_row].sg_hi = query.value(21).toDouble(); + recipe->yeasts[recipe->yeasts_row].cost = query.value(22).toDouble(); /* * Update the visible fields */ - ynameEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_name); - ylaboratoryEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_laboratory); - yproduct_idEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_product_id); - if (recipe->yeasts.at(recipe->yeasts_row).y_form == 0) { + ynameEdit->setText(recipe->yeasts.at(recipe->yeasts_row).name); + ylaboratoryEdit->setText(recipe->yeasts.at(recipe->yeasts_row).laboratory); + yproduct_idEdit->setText(recipe->yeasts.at(recipe->yeasts_row).product_id); + if (recipe->yeasts.at(recipe->yeasts_row).form == 0) { yamountEdit->setDecimals(0); yamountEdit->setSingleStep(1.0); yamountLabel->setText(tr("Total packs:")); - } else if (recipe->yeasts.at(recipe->yeasts_row).y_form == 1) { + } else if (recipe->yeasts.at(recipe->yeasts_row).form == 1) { yamountEdit->setDecimals(1); yamountEdit->setSingleStep(0.5); yamountLabel->setText(tr("Amount in gr:")); @@ -369,27 +369,27 @@ yamountLabel->setText(tr("Amount in ml:")); } - ui->yeastsTable->setItem(recipe->yeasts_row, 0, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).y_name)); - ui->yeastsTable->setItem(recipe->yeasts_row, 1, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).y_laboratory)); - ui->yeastsTable->setItem(recipe->yeasts_row, 2, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).y_product_id)); + ui->yeastsTable->setItem(recipe->yeasts_row, 0, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).name)); + ui->yeastsTable->setItem(recipe->yeasts_row, 1, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).laboratory)); + ui->yeastsTable->setItem(recipe->yeasts_row, 2, new QTableWidgetItem(recipe->yeasts.at(recipe->yeasts_row).product_id)); - item = new QTableWidgetItem(yeast_forms[recipe->yeasts.at(recipe->yeasts_row).y_form]); + item = new QTableWidgetItem(yeast_forms[recipe->yeasts.at(recipe->yeasts_row).form]); item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 3, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).y_min_temperature, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).min_temperature, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 5, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).y_max_temperature, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).max_temperature, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 6, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).y_tolerance, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).tolerance, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 7, item); - item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).y_attenuation, 2, 'f', 1, '0')); + item = new QTableWidgetItem(QString("%1").arg(recipe->yeasts.at(recipe->yeasts_row).attenuation, 2, 'f', 1, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 8, item); @@ -406,7 +406,7 @@ this->yselectEdit->setCurrentIndex(-1); this->yselectEdit->clear(); - QString sql = "SELECT name,laboratory,product_id,inventory FROM inventory_yeasts "; + QString sql = "SELECT name,laboratory,product_id,inventory FROM inventoryeasts "; if (val) sql.append("WHERE inventory > 0 "); sql.append("ORDER BY laboratory,product_id,name"); @@ -426,7 +426,7 @@ { qDebug() << "yeast_useat_changed()" << recipe->yeasts_row << val; - recipe->yeasts[recipe->yeasts_row].y_use = val; + recipe->yeasts[recipe->yeasts_row].use = val; QTableWidgetItem *item = new QTableWidgetItem(yeast_use[val]); item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); ui->yeastsTable->setItem(recipe->yeasts_row, 5, item); @@ -484,9 +484,9 @@ instockLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); yamountLabel = new QLabel(dialog); yamountLabel->setObjectName(QString::fromUtf8("amountLabel")); - if (recipe->yeasts.at(recipe->yeasts_row).y_form == 0) + if (recipe->yeasts.at(recipe->yeasts_row).form == 0) yamountLabel->setText(tr("Total packs:")); - else if (recipe->yeasts.at(recipe->yeasts_row).y_form == 1) + else if (recipe->yeasts.at(recipe->yeasts_row).form == 1) yamountLabel->setText(tr("Amount in gr:")); else yamountLabel->setText(tr("Amount in ml:")); @@ -500,17 +500,17 @@ ynameEdit = new QLineEdit(dialog); ynameEdit->setObjectName(QString::fromUtf8("ynameEdit")); - ynameEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_name); + ynameEdit->setText(recipe->yeasts.at(recipe->yeasts_row).name); ynameEdit->setGeometry(QRect(160, 10, 511, 23)); ynameEdit->setReadOnly(true); ylaboratoryEdit = new QLineEdit(dialog); ylaboratoryEdit->setObjectName(QString::fromUtf8("ylaboratoryEdit")); - ylaboratoryEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_laboratory); + ylaboratoryEdit->setText(recipe->yeasts.at(recipe->yeasts_row).laboratory); ylaboratoryEdit->setGeometry(QRect(160, 40, 511, 23)); ylaboratoryEdit->setReadOnly(true); yproduct_idEdit = new QLineEdit(dialog); yproduct_idEdit->setObjectName(QString::fromUtf8("yproduct_idEdit")); - yproduct_idEdit->setText(recipe->yeasts.at(recipe->yeasts_row).y_product_id); + yproduct_idEdit->setText(recipe->yeasts.at(recipe->yeasts_row).product_id); yproduct_idEdit->setGeometry(QRect(160, 70, 511, 23)); yproduct_idEdit->setReadOnly(true); yselectEdit = new QComboBox(dialog); @@ -525,18 +525,18 @@ yamountEdit->setGeometry(QRect(160, 130, 121, 24)); yamountEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); yamountEdit->setAccelerated(true); - if (recipe->yeasts.at(recipe->yeasts_row).y_form == 0) { + if (recipe->yeasts.at(recipe->yeasts_row).form == 0) { yamountEdit->setDecimals(0); yamountEdit->setSingleStep(1.0); - yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).y_amount); - } else if (recipe->yeasts.at(recipe->yeasts_row).y_form == 1) { + yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).amount); + } else if (recipe->yeasts.at(recipe->yeasts_row).form == 1) { yamountEdit->setDecimals(1); yamountEdit->setSingleStep(0.5); - yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).y_amount * 1000.0); + yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).amount * 1000.0); } else { yamountEdit->setDecimals(1); yamountEdit->setSingleStep(0.5); - yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).y_amount * 1000.0); + yamountEdit->setValue(recipe->yeasts.at(recipe->yeasts_row).amount * 1000.0); } yamountEdit->setMaximum(1000000000.0); useatEdit = new QComboBox(dialog); @@ -546,7 +546,7 @@ useatEdit->addItem(tr("Secondary")); useatEdit->addItem(tr("Tertiary")); useatEdit->addItem(tr("Bottle")); - useatEdit->setCurrentIndex(recipe->yeasts.at(recipe->yeasts_row).y_use); + useatEdit->setCurrentIndex(recipe->yeasts.at(recipe->yeasts_row).use); yeast_instock_changed(true); @@ -584,9 +584,9 @@ return; for (int i = 0; i < recipe->yeasts.size(); i++) { - if (recipe->yeasts.at(i).y_form == 1) { // Only adjust dry yeast - amount = recipe->yeasts.at(i).y_amount * factor; - recipe->yeasts[i].y_amount = amount; + if (recipe->yeasts.at(i).form == 1) { // Only adjust dry yeast + amount = recipe->yeasts.at(i).amount * factor; + recipe->yeasts[i].amount = amount; } } }