703 qDebug() << " no mash schedule"; |
703 qDebug() << " no mash schedule"; |
704 } |
704 } |
705 |
705 |
706 if (recipe->fermentables.size() < 1) { |
706 if (recipe->fermentables.size() < 1) { |
707 qDebug() << " no fermentables, return."; |
707 qDebug() << " no fermentables, return."; |
|
708 recipe->est_og = 0.980; |
|
709 ui->est_ogEdit->setValue(0.980); |
|
710 ui->est_og2Edit->setValue(0.980); |
|
711 ui->est_og3Edit->setValue(0.980); |
|
712 ui->est_ogShow->setValue(0.980); |
|
713 recipe->est_color = 0; |
|
714 ui->est_colorEdit->setValue(0); |
|
715 ui->est_colorEdit->setStyleSheet(Utils::ebc_to_style(0)); |
|
716 ui->est_color2Edit->setValue(0); |
|
717 ui->est_color2Edit->setStyleSheet(Utils::ebc_to_style(0)); |
|
718 ui->est_colorShow->setValue(0); |
|
719 ui->perc_mashShow->setValue(0); |
|
720 ui->perc_sugarsShow->setValue(0); |
|
721 ui->perc_caraShow->setValue(0); |
|
722 ui->lintnerShow->setValue(0); |
|
723 recipe->est_fg = 0.980; |
|
724 ui->est_fgEdit->setValue(0.980); |
|
725 ui->est_fg3Edit->setValue(0.980); |
|
726 ui->est_fgShow->setValue(0.980); |
|
727 ui->est_abvEdit->setValue(0); |
|
728 ui->est_abv2Edit->setValue(0); |
|
729 ui->est_abvShow->setValue(0); |
|
730 recipe->est_abv = 0; |
|
731 ui->calEdit->setValue(0); |
708 return; |
732 return; |
709 } |
733 } |
710 qDebug() << " adjust to 100" << recipe->fermentables_use100; |
734 qDebug() << " adjust to 100" << recipe->fermentables_use100; |
711 |
735 |
712 for (i = 0; i < recipe->fermentables.size(); i++) { |
736 for (i = 0; i < recipe->fermentables.size(); i++) { |
1340 { |
1364 { |
1341 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
1365 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
1342 int row = pb->objectName().toInt(); |
1366 int row = pb->objectName().toInt(); |
1343 qDebug() << "Delete fermentable row" << row << recipe->fermentables.size(); |
1367 qDebug() << "Delete fermentable row" << row << recipe->fermentables.size(); |
1344 |
1368 |
|
1369 if (recipe->fermentables.size() < 1) |
|
1370 return; |
|
1371 |
1345 int rc = QMessageBox::warning(this, tr("Delete fermentable"), tr("Delete %1").arg(recipe->fermentables.at(row).f_name), |
1372 int rc = QMessageBox::warning(this, tr("Delete fermentable"), tr("Delete %1").arg(recipe->fermentables.at(row).f_name), |
1346 QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
1373 QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
1347 if (rc == QMessageBox::No) |
1374 if (rc == QMessageBox::No) |
1348 return; |
1375 return; |
1349 |
1376 |