96 ui->brew_coolwithEdit->addItem(tr("Natural")); |
96 ui->brew_coolwithEdit->addItem(tr("Natural")); |
97 |
97 |
98 ui->brew_aerwithEdit->addItem(tr("None")); |
98 ui->brew_aerwithEdit->addItem(tr("None")); |
99 ui->brew_aerwithEdit->addItem(tr("Air")); |
99 ui->brew_aerwithEdit->addItem(tr("Air")); |
100 ui->brew_aerwithEdit->addItem(tr("Oxygen")); |
100 ui->brew_aerwithEdit->addItem(tr("Oxygen")); |
|
101 |
|
102 ui->bottle_sugarEdit->addItem(""); |
|
103 ui->keg_sugarEdit->addItem(""); |
|
104 query.prepare("SELECT name FROM inventory_fermentables WHERE type = '1' OR type = '3' ORDER BY name"); // Sugars or dry extract |
|
105 query.exec(); |
|
106 while (query.next()) { |
|
107 ui->bottle_sugarEdit->addItem(query.value(0).toString()); |
|
108 ui->keg_sugarEdit->addItem(query.value(0).toString()); |
|
109 } |
101 |
110 |
102 if (id >= 0) { |
111 if (id >= 0) { |
103 query.prepare("SELECT * FROM products WHERE record = :recno"); |
112 query.prepare("SELECT * FROM products WHERE record = :recno"); |
104 query.bindValue(":recno", id); |
113 query.bindValue(":recno", id); |
105 query.exec(); |
114 query.exec(); |
972 ui->tert_sgEdit->setValue(product->fg); |
981 ui->tert_sgEdit->setValue(product->fg); |
973 ui->tert_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->fg)); |
982 ui->tert_attShow->setValue(Utils::calc_svg(product->brew_fermenter_sg, product->fg)); |
974 ui->tert_abvShow->setValue(Utils::abvol(product->brew_fermenter_sg, product->fg)); |
983 ui->tert_abvShow->setValue(Utils::abvol(product->brew_fermenter_sg, product->fg)); |
975 |
984 |
976 // Tab packaging. |
985 // Tab packaging. |
|
986 ui->pack_dateEdit->setText(product->package_date.toString("dd MMM yyyy")); |
|
987 ui->pack_carbloShow->setValue(product->st_carb_min); |
|
988 ui->pack_carbhiShow->setValue(product->st_carb_max); |
|
989 ui->pack_volumeEdit->setValue(product->package_volume); |
|
990 ui->pack_addvolEdit->setValue(product->package_infuse_amount); |
|
991 ui->pack_addabvEdit->setValue(product->package_infuse_abv); |
|
992 ui->pack_notesEdit->setText(product->package_infuse_notes); |
|
993 ui->pack_abvShow->setValue(product->package_abv); |
|
994 ui->pack_phEdit->setValue(product->package_ph); |
|
995 |
|
996 ui->bottle_volumeEdit->setValue(product->bottle_amount); |
|
997 ui->bottle_carbEdit->setValue(product->bottle_carbonation); |
|
998 ui->bottle_sug_amountShow->setValue(product->bottle_priming_amount); |
|
999 ui->bottle_sug_waterEdit->setValue(product->bottle_priming_water); |
|
1000 ui->bottle_tempEdit->setValue(product->bottle_carbonation_temp); |
977 |
1001 |
978 // Tab taste. |
1002 // Tab taste. |
|
1003 ui->taste_dateEdit->setText(product->taste_date.toString("dd MMM yyyy")); |
|
1004 ui->taste_rateEdit->setValue(product->taste_rate); |
|
1005 ui->taste_notesEdit->setPlainText(product->taste_notes); |
|
1006 ui->taste_colorEdit->setText(product->taste_color); |
|
1007 ui->taste_transparencyEdit->setText(product->taste_transparency); |
|
1008 ui->taste_headEdit->setText(product->taste_head); |
|
1009 ui->taste_aromaEdit->setText(product->taste_aroma); |
|
1010 ui->taste_tasteEdit->setText(product->taste_taste); |
|
1011 ui->taste_mouthfeelEdit->setText(product->taste_mouthfeel); |
|
1012 ui->taste_aftertasteEdit->setText(product->taste_aftertaste); |
979 |
1013 |
980 // All signals from tab "Generic" |
1014 // All signals from tab "Generic" |
981 connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed); |
1015 connect(ui->lockedEdit, &QCheckBox::stateChanged, this, &EditProduct::is_changed); |
982 connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditProduct::name_changed); |
1016 connect(ui->nameEdit, &QLineEdit::textChanged, this, &EditProduct::name_changed); |
983 connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(notes_changed())); |
1017 connect(ui->notesEdit, SIGNAL(textChanged()), this, SLOT(notes_changed())); |