src/EditProduct.cpp

changeset 218
725da10db56c
parent 214
641540dc6ef2
child 219
fa7cad488e27
--- a/src/EditProduct.cpp	Tue May 17 21:19:31 2022 +0200
+++ b/src/EditProduct.cpp	Wed May 18 08:59:54 2022 +0200
@@ -940,13 +940,11 @@
     ui->brew_preboilvolEdit->setValue(product->brew_preboil_volume);
     ui->brew_preboilvolShow->setValue(product->boil_size * 1.04);
     ui->brew_preboileffShow->setValue(product->brew_preboil_efficiency);
-    calcEfficiencyBeforeBoil();
     ui->brew_aboilphEdit->setValue(product->brew_aboil_ph);
     ui->brew_aboilsgEdit->setValue(product->brew_aboil_sg);
     ui->brew_aboilvolEdit->setValue(product->brew_aboil_volume);
     ui->brew_aboilvolShow->setValue(product->batch_size * 1.04);
     ui->brew_aboileffShow->setValue(product->brew_aboil_efficiency);
-    calcEfficiencyAfterBoil();
     ui->brew_whirlpool9Edit->setValue(product->brew_whirlpool9);
     ui->brew_whirlpool7Edit->setValue(product->brew_whirlpool7);
     ui->brew_whirlpool6Edit->setValue(product->brew_whirlpool6);
@@ -973,11 +971,11 @@
     ui->prim_maxCEdit->setValue(product->primary_max_temp);
     ui->prim_endCEdit->setValue(product->primary_end_temp);
     ui->prim_endsgEdit->setValue(product->primary_end_sg);
-    ui->prim_enddateEdit->setText(product->primary_end_date.toString("dd MMM yyyy"));
+    ui->prim_enddateEdit->setDate(product->primary_end_date);
     ui->prim_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->primary_end_sg));
     ui->sec_tempEdit->setValue(product->secondary_temp);
     ui->sec_sgEdit->setValue(product->secondary_end_sg);
-    ui->sec_enddateEdit->setText(product->secondary_end_date.toString("dd MMM yyyy"));
+    ui->sec_enddateEdit->setDate(product->secondary_end_date);
     ui->sec_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->secondary_end_sg));
     ui->tert_tempEdit->setValue(product->tertiary_temp);
     ui->tert_estsgShow->setValue(product->est_fg);
@@ -1014,6 +1012,8 @@
     ui->taste_mouthfeelEdit->setText(product->taste_mouthfeel);
     ui->taste_aftertasteEdit->setText(product->taste_aftertaste);
 
+    qDebug() << "== Start connecting ==";
+
     // All signals from tab "Generic"
     connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed);
     connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditProduct::name_changed);
@@ -1082,6 +1082,8 @@
     connect(ui->sp_phEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditProduct::sp_ph_changed);
 
     /* All signals from tab Brewday */
+    calcEfficiencyBeforeBoil();
+    calcEfficiencyAfterBoil();
     connect(ui->brew_startButton1, SIGNAL(clicked()), this, SLOT(brew_date_today()));
     connect(ui->brew_startButton2, SIGNAL(clicked()), this, SLOT(brew_date_clear()));
     connect(ui->brew_startDate, &QDateEdit::dateChanged, this, &EditProduct::brew_start_date_changed);

mercurial