src/EditProductTab1.cpp

Sun, 19 Jun 2022 10:40:37 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sun, 19 Jun 2022 10:40:37 +0200
changeset 297
c8f0ecc8a1cc
parent 296
2f4e250cfed9
child 301
fe6346211b5b
permissions
-rw-r--r--

Added co2pressure (carbonation) log graph.

175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * EditProduct.cpp is part of bmsapp.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * Tab 1, generic settings.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * bmsapp is free software: you can redistribute it and/or modify
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * the Free Software Foundation, either version 3 of the License, or
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * (at your option) any later version.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 *
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * bmsapp is distributed in the hope that it will be useful,
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * GNU General Public License for more details.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 *
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20
227
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
21 void EditProduct::code_changed(QString code)
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
22 {
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
23 product->code = code;
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
24 is_changed();
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
25 }
7966bf14cc34 Implemented insert a new product. Fixed missing product code edit slot.
Michiel Broek <mbroek@mbse.eu>
parents: 225
diff changeset
26
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
27
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
28 void EditProduct::name_changed(QString name)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
29 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
30 product->name = name;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
31 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
32 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
33
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
34
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
35 void EditProduct::notes_changed()
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
36 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
37 /* The text cannot be passed in a simple way :) */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
38 product->notes = ui->notesEdit->toPlainText();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
39 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
40 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
41
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
42
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
43 /*
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
44 * New beerstyle is selected.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
45 */
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
46 void EditProduct::style_changed(int val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
47 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
48 QSqlQuery query;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
49
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
50 query.prepare("SELECT * FROM profile_styles ORDER BY style_guide,style_letter,name");
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
51 query.exec();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
52 query.first();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
53 // Skip to the record index.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
54 for (int i = 0; i < (val - 1); i++) {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
55 query.next();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
56 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
57 // Set relevant fields and update ranges.
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
58 product->st_name = query.value(1).toString();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
59 product->st_category = query.value(2).toString();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
60 product->st_category_number = query.value(3).toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
61 product->st_letter = query.value(4).toString();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
62 product->st_guide = query.value(5).toString();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
63 product->st_type = query.value(6).toInt();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
64 product->st_og_min = query.value(7).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
65 product->st_og_max = query.value(8).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
66 product->st_fg_min = query.value(9).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
67 product->st_fg_max = query.value(10).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
68 product->st_ibu_min = query.value(11).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
69 product->st_ibu_max = query.value(12).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
70 product->st_color_min = query.value(13).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
71 product->st_color_max = query.value(14).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
72 product->st_carb_min = query.value(15).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
73 product->st_carb_max = query.value(16).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
74 product->st_abv_min = query.value(17).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
75 product->st_abv_max = query.value(18).toDouble();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
76
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
77 ui->st_nameEdit->setText(product->st_name);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
78 ui->st_groupEdit->setText(product->st_letter);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
79 ui->st_guideEdit->setText(product->st_guide);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
80 ui->st_catEdit->setText(product->st_category);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
81 ui->st_catnrEdit->setText(QString("%1").arg(product->st_category_number));
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
82 ui->st_typeEdit->setText(style_types[product->st_type]);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
83
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
84 ui->est_ogShow->setRange(query.value(7).toDouble(), query.value(8).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
85 ui->est_fgShow->setRange(query.value(9).toDouble(), query.value(10).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
86 ui->est_ibuShow->setRange(query.value(11).toDouble(), query.value(12).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
87 ui->est_colorShow->setRange(query.value(13).toDouble(), query.value(14).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
88 ui->est_carbShow->setRange(query.value(15).toDouble(), query.value(16).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
89 ui->est_abvShow->setRange(query.value(17).toDouble(), query.value(18).toDouble());
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
90
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
91 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
92 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
93
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
94
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
95 void EditProduct::colormethod_changed(int val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
96 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
97 product->color_method = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
98 calcFermentables();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
99 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
100 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
101
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
102
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
103 void EditProduct::ibumethod_changed(int val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
104 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
105 product->ibu_method = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
106 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
107 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
108 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
109
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
110
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
111 void EditProduct::est_og_changed(double val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
112 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
113 product->est_og = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
114 calcFermentablesFromOG(val);// Adjust fermentables amounts
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
115 calcFermentables(); // Update the product details
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
116 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
117 calcMash();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
118 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
119 emit refreshAll();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
120 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
121
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
122
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
123 void EditProduct::efficiency_changed(double val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
124 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
125 double estog = product->est_og;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
126 product->efficiency = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
127 calcFermentablesFromOG(estog);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
128 calcFermentables();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
129 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
130 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
131 emit refreshAll();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
132 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
133
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
134
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
135 void EditProduct::boil_time_changed(int val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
136 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
137 qDebug() << "boil_time_changed" << val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
138 double new_evap = (0.1 * product->batch_size) * val / 60.0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
139 product->boil_size = product->batch_size + new_evap;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
140 product->boil_time = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
141 ui->boil_sizeEdit->setValue(product->boil_size);
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
142 ui->brew_preboilvolShow->setValue(product->boil_size * 1.04);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
143 calcFermentables();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
144 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
145 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
146 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
147
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
148
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
149 void EditProduct::batch_size_changed(double val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
150 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
151 qDebug() << "batch_size_changed" << val << "old" << product->batch_size;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
152
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
153 double evap = (0.1 * val) * product->boil_time / 60.0;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
154 product->boil_size = val + evap;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
155 double factor = val / product->batch_size;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
156 ui->boil_sizeEdit->setValue(product->boil_size);
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
157 ui->brew_preboilvolShow->setValue(product->boil_size * 1.04);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
158 product->sparge_volume *= factor;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 ui->sp_volEdit->setValue(product->sparge_volume);
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
160 ui->brew_spargevolShow->setValue(product->sparge_volume);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161 product->batch_size = val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
162 calcFermentablesFromOG(product->est_og); // Keep the OG
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
163 adjustWaters(factor);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
164 calcFermentables();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
165 adjustHops(factor);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
166 adjustMiscs(factor);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
167 adjustYeasts(factor);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
168 calcIBUs();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
169 calcWater();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
170 calcMash();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
171 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
172 emit refreshAll();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
173 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
174
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
176 void EditProduct::brew_type_changed(int val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
177 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
178 product->type;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
179 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
180 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
181
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
182
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
183 void EditProduct::locked_changed(bool val)
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
184 {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
185 qDebug() << "locked_changed" << val;
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
186
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
187 if (product->stage < PROD_STAGE_READY)
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
188 return;
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
189
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
190 product->locked = val;
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
191 product->stage = val ? PROD_STAGE_CLOSED : PROD_STAGE_READY;
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
192 setStage();
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
193 is_changed();
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
194 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
195
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
196
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
197 void EditProduct::setStage()
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
198 {
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
199 int stage = product->stage;
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
200 bool locked = product->locked;
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
201
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
202 /*
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
203 * See if we need to set a new stage.
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
204 */
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
205 if ((stage == PROD_STAGE_PLAN) && (product->est_og > 1.005) && (product->est_color > 3) && (product->est_ibu > 3))
205
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
206 stage = PROD_STAGE_WAIT;
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
207 if ((stage == PROD_STAGE_WAIT) && (product->brew_date_start.date().isValid()))
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
208 stage = PROD_STAGE_BREW;
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
209 if ((stage == PROD_STAGE_BREW) && (! product->brew_date_start.date().isValid()))
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
210 stage = PROD_STAGE_WAIT;
219
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
211 /* from PROD_STAGE_BREW to PROD_STAGE_PRIMARY is handled in EditProductTab9.cpp */
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
212 /* from PROD_STAGE_PRIMARY to PROD_STAGE_SECONDARY is handled in EditProductTab10.cpp */
224
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
213 /* from PROD_STAGE_SECONDARY to PROD_STAGE_TERIARY is handled in EditProductTab10.cpp */
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
214 if ((stage == PROD_STAGE_TERTIARY) && product->package_date.isValid())
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
215 stage = PROD_STAGE_PACKAGE;
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
216 if ((stage == PROD_STAGE_PACKAGE) && (! product->package_date.isValid()))
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
217 stage = PROD_STAGE_TERTIARY;
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
218 /* from PROD_STAGE_PACKAGE to PROD_STAGE_CARBONATION is handled in EditProductTab11.cpp */
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
219 if ((stage == PROD_STAGE_CARBONATION) && (product->package_date.daysTo(QDate::currentDate()) > 14))
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
220 stage = PROD_STAGE_MATURE;
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
221
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
222 if (product->stage != stage) {
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
223 qDebug() << "setStage() change state:" << prod_stages[product->stage] << "to:" << prod_stages[stage];
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
224 product->stage = stage;
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
225 is_changed();
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
226 } else {
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
227 qDebug() << "setStage() stage:" << prod_stages[stage];
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
228 }
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
229
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
230 ui->stageEdit->setText(prod_stages[stage]);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
231
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
232 /* Tab 1, generic */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
233 ui->typeEdit->setDisabled(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
234 ui->color_methodEdit->setDisabled(locked);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
235 ui->ibu_methodEdit->setDisabled(locked);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
236 ui->beerstyleEdit->setDisabled(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
237 ui->nameEdit->setReadOnly(stage > PROD_STAGE_WAIT);
271
f56c0dff0a3d Added the main record update to the product splitting. Block edit of the product code if the product is splitted.
Michiel Broek <mbroek@mbse.eu>
parents: 233
diff changeset
238 ui->codeEdit->setReadOnly(stage > PROD_STAGE_WAIT || product->divide_type); /* Never change this in a splitted product. */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
239 ui->notesEdit->setReadOnly(locked);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
240 ui->batch_sizeEdit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
241 ui->batch_sizeEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
242 ui->boil_sizeEdit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
243 ui->boil_sizeEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
244 ui->boil_timeEdit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
245 ui->boil_timeEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
246 ui->efficiencyEdit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
247 ui->efficiencyEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
248 ui->est_ogEdit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
249 ui->est_ogEdit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
271
f56c0dff0a3d Added the main record update to the product splitting. Block edit of the product code if the product is splitted.
Michiel Broek <mbroek@mbse.eu>
parents: 233
diff changeset
250 /*
f56c0dff0a3d Added the main record update to the product splitting. Block edit of the product code if the product is splitted.
Michiel Broek <mbroek@mbse.eu>
parents: 233
diff changeset
251 * The next two items are displayed on the same location.
f56c0dff0a3d Added the main record update to the product splitting. Block edit of the product code if the product is splitted.
Michiel Broek <mbroek@mbse.eu>
parents: 233
diff changeset
252 * But they are not needed at the same time.
f56c0dff0a3d Added the main record update to the product splitting. Block edit of the product code if the product is splitted.
Michiel Broek <mbroek@mbse.eu>
parents: 233
diff changeset
253 */
225
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
254 if (stage > PROD_STAGE_PACKAGE) {
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
255 ui->ok_pmptLabel->hide();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
256 ui->ok_pmptIcon->hide();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
257 } else {
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
258 ui->ok_pmptLabel->show();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
259 ui->ok_pmptIcon->show();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
260 }
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
261 if (stage >= PROD_STAGE_READY) {
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
262 ui->lockedLabel->show();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
263 ui->lockedEdit->show();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
264 } else {
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
265 ui->lockedLabel->hide();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
266 ui->lockedEdit->hide();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
267 }
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
268
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
269 /* Tab 2, equipment */
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
270 ui->tabWidget->setTabEnabled(1, stage < PROD_STAGE_BREW);
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
271
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
272 /* Tab 3, fermentables */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
273 ui->est_og2Edit->setReadOnly(stage > PROD_STAGE_WAIT);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
274 ui->est_og2Edit->setButtonSymbols((stage > PROD_STAGE_WAIT) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
275 ui->addFermentable->setEnabled(stage <= PROD_STAGE_PACKAGE);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
276
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
277 /* Tab 4, hops */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
278 ui->addHop->setEnabled(stage <= PROD_STAGE_PACKAGE);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
279
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
280 /* Tab 5, miscs */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
281 ui->addMisc->setEnabled(stage <= PROD_STAGE_PACKAGE);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
282
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
283 /* Tab 6, yeasts */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
284 ui->addYeast->setEnabled(stage <= PROD_STAGE_PACKAGE);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
285
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
286 /* Tab 7, mash */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
287 ui->addMash->setEnabled(stage <= PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
288 ui->mash_nameEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
289 ui->mash_pickEdit->setDisabled(stage > PROD_STAGE_BREW);
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
290
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
291 /* Tab 8, water */
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
292 ui->sp_sourceEdit->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
293 ui->wt_sourceEdit->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
294 ui->w1_nameEdit->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
295 ui->w2_nameEdit->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
296 ui->mw_acidPick->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
297 ui->sp_acidtypeEdit->setDisabled(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
298 ui->w2_volEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
299 ui->w2_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
300 ui->sp_phEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
301 ui->sp_phEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
302 ui->sp_tempEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
303 ui->sp_tempEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
304 ui->sp_volEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
305 ui->sp_volEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
306 ui->bs_cacl2Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
307 ui->bs_cacl2Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
308 ui->bs_caso4Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
309 ui->bs_caso4Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
310 ui->bs_mgso4Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
311 ui->bs_mgso4Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
312 ui->bs_naclEdit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
313 ui->bs_naclEdit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
314 ui->bs_mgcl2Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
315 ui->bs_mgcl2Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
316 ui->bs_nahco3Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
317 ui->bs_nahco3Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
318 ui->bs_caco3Edit->setReadOnly(stage > PROD_STAGE_BREW);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
319 ui->bs_caco3Edit->setButtonSymbols((stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
320 if (stage > PROD_STAGE_BREW) {
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
321 ui->mw_phEdit->setReadOnly(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
322 ui->mw_phEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
323 ui->mw_acidvolEdit->setReadOnly(true);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
324 ui->mw_acidvolEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
325 } else {
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
326 ui->mw_phEdit->setReadOnly(! product->calc_acid);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
327 ui->mw_phEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
328 ui->mw_acidvolEdit->setReadOnly(product->calc_acid);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
329 ui->mw_acidvolEdit->setButtonSymbols(product->calc_acid ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
330 }
184
da148d6b4c95 Added brewday boil box. The setLocked function changed into setStage. Fixed bug that resetted the efficiency to the equipment default.
Michiel Broek <mbroek@mbse.eu>
parents: 175
diff changeset
331 ui->mw_autoEdit->setDisabled(stage > PROD_STAGE_BREW);
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
332
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
333 /* Tab 9, brewday */
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
334 ui->tabWidget->setTabEnabled(8, stage > PROD_STAGE_PLAN);
211
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
335 if (product->log_brew) {
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
336 ui->brew_logLabel->show();
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
337 ui->brew_logButton->show();
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
338 } else {
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
339 ui->brew_logLabel->hide();
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
340 ui->brew_logButton->hide();
bec0386b1df1 Only show brew_log prompt and button if there is a log.
Michiel Broek <mbroek@mbse.eu>
parents: 210
diff changeset
341 }
214
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
342 ui->brew_ackLabel->hide();
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
343 ui->brew_ackButton->hide();
205
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
344 if (product->stage < PROD_STAGE_BREW) {
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
345 ui->brew_startButton1->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
346 ui->brew_startButton2->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
347 ui->brew_startDate->setReadOnly(false);
219
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
348 ui->brew_startDate->setMinimumDate(product->birth.addDays(-1)); // The birth date is the first valid date.
205
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
349 ui->brew_endButton1->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
350 ui->brew_startLabel2->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
351 ui->brew_endLabel->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
352 ui->brew_endLabel2->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
353 ui->brew_startTime->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
354 ui->brew_endDate->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
355 ui->brew_endTime->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
356 } else if (product->stage == PROD_STAGE_BREW) {
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
357 ui->brew_startButton1->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
358 ui->brew_startButton2->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
359 ui->brew_startDate->setReadOnly(false);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
360 ui->brew_startLabel2->show();
210
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
361
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
362 /*
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
363 * Enable brew_end settings if it is the right date or later.
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
364 * If some essential values are filled in.
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
365 */
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
366 int brewTime = product->brew_date_start.date().daysTo(QDate::currentDate());
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
367
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
368 if ((brewTime >= 0) && (product->brew_cooling_method > 0) && (product->brew_cooling_time > 0) &&
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
369 (product->brew_aboil_sg > 1.002) && (product->brew_aboil_volume > 0)) {
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
370 ui->brew_endLabel->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
371 ui->brew_startLabel2->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
372 ui->brew_endLabel2->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
373 ui->brew_endButton1->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
374 ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
375 ui->brew_startTime->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
376 ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
377 ui->brew_endDate->show();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
378 ui->brew_endDate->setReadOnly(false);
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
379 ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
380 ui->brew_endTime->show();
214
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
381 if (product->brew_date_end.isValid() && product->brew_date_start.isValid() &&
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
382 (product->brew_date_start.msecsTo(product->brew_date_end) > 7200000)) {
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
383 /* The start and end dates are valid, and the end is more then two hours after the start. */
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
384 ui->brew_ackLabel->show();
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
385 ui->brew_ackButton->show();
641540dc6ef2 Added the brew end date and time settings. Added a confirm button the is only displayed if everything is ready for the next step. This check includes that the end of the brew is at least two hours after the start. This completes the brewday tab page.
Michiel Broek <mbroek@mbse.eu>
parents: 211
diff changeset
386 }
210
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
387 } else {
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
388 ui->brew_endButton1->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
389 ui->brew_startLabel2->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
390 ui->brew_endLabel->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
391 ui->brew_endLabel2->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
392 ui->brew_startTime->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
393 ui->brew_endDate->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
394 ui->brew_endTime->hide();
b45bd6da5220 Implemented brewday change cooling, aeration, whirlpool and fermenter volumes values. All editable values on the brewday tab are now functional.
Michiel Broek <mbroek@mbse.eu>
parents: 206
diff changeset
395 }
205
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
396 } else {
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
397 ui->brew_startButton1->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
398 ui->brew_startButton2->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
399 ui->brew_startDate->setReadOnly(true);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
400 ui->brew_startLabel2->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
401 ui->brew_endLabel->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
402 ui->brew_endLabel2->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
403 ui->brew_endButton1->hide();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
404 ui->brew_startTime->setButtonSymbols(QAbstractSpinBox::NoButtons);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
405 ui->brew_startTime->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
406 ui->brew_startTime->setReadOnly(true);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
407 ui->brew_endDate->setButtonSymbols(QAbstractSpinBox::NoButtons);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
408 ui->brew_endDate->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
409 ui->brew_endDate->setReadOnly(true);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
410 ui->brew_endTime->setButtonSymbols(QAbstractSpinBox::NoButtons);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
411 ui->brew_endTime->show();
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
412 ui->brew_endTime->setReadOnly(true);
ae6109192fb2 First changes for brewdate date edit.
Michiel Broek <mbroek@mbse.eu>
parents: 204
diff changeset
413 }
206
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
414 ui->brew_mashphEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
415 ui->brew_mashphEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
416 ui->brew_mashsgEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
417 ui->brew_mashsgEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
418 ui->brew_spargephEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
419 ui->brew_spargephEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
420 ui->brew_preboilphEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
421 ui->brew_preboilphEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
422 ui->brew_preboilsgEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
423 ui->brew_preboilsgEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
424 ui->brew_preboilvolEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
425 ui->brew_preboilvolEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
426 ui->brew_preboilButton->setDisabled(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
427 ui->brew_aboilphEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
428 ui->brew_aboilphEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
429 ui->brew_aboilsgEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
430 ui->brew_aboilsgEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
431 ui->brew_aboilvolEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
432 ui->brew_aboilvolEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
433 ui->brew_aboilButton->setDisabled(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
434 ui->brew_cooltoEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
435 ui->brew_cooltoEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
436 ui->brew_cooltimeEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
437 ui->brew_cooltimeEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
438 ui->brew_coolwithEdit->setDisabled(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
439 ui->brew_whirlpool9Edit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
440 ui->brew_whirlpool9Edit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
441 ui->brew_whirlpool7Edit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
442 ui->brew_whirlpool7Edit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
443 ui->brew_whirlpool6Edit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
444 ui->brew_whirlpool6Edit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
445 ui->brew_whirlpool2Edit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
446 ui->brew_whirlpool2Edit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
447 ui->brew_aerspeedEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
448 ui->brew_aerspeedEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
449 ui->brew_aertimeEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
450 ui->brew_aertimeEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
451 ui->brew_aerwithEdit->setDisabled(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
452 ui->brew_trublossEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
453 ui->brew_trublossEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
454 ui->brew_topupwaterEdit->setReadOnly(stage > PROD_STAGE_BREW);
83ae8ac83f51 Enable/disable read/write al settings on the brewday tab as needed.
Michiel Broek <mbroek@mbse.eu>
parents: 205
diff changeset
455 ui->brew_topupwaterEdit->setButtonSymbols( (stage > PROD_STAGE_BREW) ? QAbstractSpinBox::NoButtons : QAbstractSpinBox::UpDownArrows);
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
456
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
457 /* Tab 10, fermentation */
190
bb6c06910f0f Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 189
diff changeset
458 ui->tabWidget->setTabEnabled(9, stage > PROD_STAGE_WAIT);
296
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
459 if (product->log_fermentation) {
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
460 ui->ferm_log1Label->show();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
461 ui->ferm_log1Button->show();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
462 } else {
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
463 ui->ferm_log1Label->hide();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
464 ui->ferm_log1Button->hide();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
465 }
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
466 if (product->log_ispindel) {
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
467 ui->ferm_log2Label->show();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
468 ui->ferm_log2Button->show();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
469 } else {
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
470 ui->ferm_log2Label->hide();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
471 ui->ferm_log2Button->hide();
2f4e250cfed9 Added fermenter and iSpindel graphs.
Michiel Broek <mbroek@mbse.eu>
parents: 271
diff changeset
472 }
219
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
473 ui->prim_enddateEdit->setReadOnly(true);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
474 ui->prim_enddateEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
475 ui->prim_enddateButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
476 ui->prim_ackButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
477 ui->sec_enddateEdit->setReadOnly(true);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
478 ui->sec_enddateEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
479 ui->sec_enddateButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
480 ui->sec_ackButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
481 ui->prim_startCEdit->setReadOnly(product->stage != PROD_STAGE_PRIMARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
482 ui->prim_startCEdit->setButtonSymbols((product->stage == PROD_STAGE_PRIMARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
483 ui->prim_maxCEdit->setReadOnly(product->stage != PROD_STAGE_PRIMARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
484 ui->prim_maxCEdit->setButtonSymbols((product->stage == PROD_STAGE_PRIMARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
485 ui->prim_endCEdit->setReadOnly(product->stage != PROD_STAGE_PRIMARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
486 ui->prim_endCEdit->setButtonSymbols((product->stage == PROD_STAGE_PRIMARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
487 ui->prim_endsgEdit->setReadOnly(product->stage != PROD_STAGE_PRIMARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
488 ui->prim_endsgEdit->setButtonSymbols((product->stage == PROD_STAGE_PRIMARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
489 if (product->stage == PROD_STAGE_PRIMARY)
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
490 ui->prim_endsgButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
491 else
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
492 ui->prim_endsgButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
493 if ((product->primary_start_temp > 0) && (product->primary_max_temp > 0) && (product->primary_end_temp > 0) &&
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
494 (product->primary_end_sg > 0.980) && (product->stage == PROD_STAGE_PRIMARY)) {
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
495 ui->prim_enddateEdit->setReadOnly(false);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
496 ui->prim_enddateEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
497 ui->prim_enddateEdit->setMinimumDate(product->brew_date_end.date());
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
498 ui->prim_enddateEdit->setMaximumDate(QDate::currentDate());
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
499 ui->prim_enddateButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
500 if (product->primary_end_date.isValid()) {
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
501 ui->prim_ackButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
502 }
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
503 }
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
504 ui->sec_tempEdit->setReadOnly(product->stage != PROD_STAGE_SECONDARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
505 ui->sec_tempEdit->setButtonSymbols((product->stage == PROD_STAGE_SECONDARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
506 ui->sec_sgEdit->setReadOnly(product->stage != PROD_STAGE_SECONDARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
507 ui->sec_sgEdit->setButtonSymbols((product->stage == PROD_STAGE_SECONDARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
508 if (product->stage == PROD_STAGE_SECONDARY)
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
509 ui->sec_sgButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
510 else
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
511 ui->sec_sgButton->hide();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
512 if ((product->secondary_end_sg > 0.980) && (product->secondary_temp > 0) && (product->stage == PROD_STAGE_SECONDARY)) {
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
513 ui->sec_enddateEdit->setReadOnly(false);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
514 ui->sec_enddateEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
515 ui->sec_enddateEdit->setMinimumDate(product->primary_end_date.addDays(-1)); // Allow same date as primary end.
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
516 ui->sec_enddateEdit->setMaximumDate(QDate::currentDate());
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
517 ui->sec_enddateButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
518 if (product->secondary_end_date.isValid()) {
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
519 ui->sec_ackButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
520 }
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
521 }
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
522 ui->tert_tempEdit->setReadOnly(product->stage != PROD_STAGE_TERTIARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
523 ui->tert_tempEdit->setButtonSymbols((product->stage == PROD_STAGE_TERTIARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
524 ui->tert_sgEdit->setReadOnly(product->stage != PROD_STAGE_TERTIARY);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
525 ui->tert_sgEdit->setButtonSymbols((product->stage == PROD_STAGE_TERTIARY) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
526 if (product->stage == PROD_STAGE_TERTIARY)
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
527 ui->tert_sgButton->show();
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
528 else
fa7cad488e27 Added fermentation stages data. The two graphs are for later.
Michiel Broek <mbroek@mbse.eu>
parents: 214
diff changeset
529 ui->tert_sgButton->hide();
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
530
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
531 /* Tab 11, packaging */
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
532 ui->tabWidget->setTabEnabled(10, stage > PROD_STAGE_PLAN);
224
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
533 bool pack = ((stage > PROD_STAGE_PLAN) && (stage <= PROD_STAGE_PACKAGE)) ? true:false;
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
534 ui->pack_volumeEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
535 ui->pack_volumeEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
536 ui->pack_phEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
537 ui->pack_phEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
538 ui->pack_addvolEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
539 ui->pack_addvolEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
540 ui->pack_addabvEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
541 ui->pack_addabvEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
542 ui->pack_notesEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
543 ui->bottle_volumeEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
544 ui->bottle_volumeEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
545 ui->bottle_carbEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
546 ui->bottle_carbEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
547 ui->bottle_sugarEdit->setDisabled(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
548 ui->bottle_sug_waterEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
549 ui->bottle_sug_waterEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
550 ui->bottle_tempEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
551 ui->bottle_tempEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
552 ui->keg_volumeEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
553 ui->keg_volumeEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
554 ui->keg_carbEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
555 ui->keg_carbEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
556 ui->keg_sugarEdit->setDisabled(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
557 ui->keg_sug_waterEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
558 ui->keg_sug_waterEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
559 ui->keg_tempEdit->setReadOnly(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
560 ui->keg_tempEdit->setButtonSymbols((pack) ? QAbstractSpinBox::UpDownArrows : QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
561 ui->keg_forcedEdit->setDisabled(! pack);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
562 ui->pack_dateEdit->setReadOnly(true);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
563 ui->pack_dateEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
564 ui->pack_dateButton->hide();
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
565 ui->pack_ackButton->hide();
297
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
566 if (product->log_co2pressure) {
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
567 ui->carb_logLabel->show();
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
568 ui->carb_logButton->show();
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
569 } else {
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
570 ui->carb_logLabel->hide();
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
571 ui->carb_logButton->hide();
c8f0ecc8a1cc Added co2pressure (carbonation) log graph.
Michiel Broek <mbroek@mbse.eu>
parents: 296
diff changeset
572 }
224
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
573 if (((stage == PROD_STAGE_TERTIARY) || (stage == PROD_STAGE_PACKAGE)) &&
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
574 (product->package_volume > 1) && ((product->bottle_amount + product->keg_amount) > 1)) {
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
575 ui->pack_dateEdit->setReadOnly(false);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
576 ui->pack_dateEdit->setButtonSymbols(QAbstractSpinBox::UpDownArrows);
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
577 ui->pack_dateEdit->setMinimumDate(product->secondary_end_date.addDays(-1)); // Allow same date as secondary end.
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
578 ui->pack_dateEdit->setMaximumDate(QDate::currentDate());
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
579 ui->pack_dateButton->show();
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
580 if (stage == PROD_STAGE_PACKAGE)
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
581 ui->pack_ackButton->show();
d369948a3eb5 Added stage changing from tertiary fermentation upto carbonation. Show, hide, readonly etc for the package tab. Make sure current sugar amounts are displayed. Added package date and buttons.
Michiel Broek <mbroek@mbse.eu>
parents: 219
diff changeset
582 }
189
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
583
722a4eed545d Added select equipment.
Michiel Broek <mbroek@mbse.eu>
parents: 184
diff changeset
584 /* Tab 12, tasting */
190
bb6c06910f0f Added calcSupplies() which shows if ingredients are in stock to brew the recipe. In tab 3, changed the fermentables numbers into more readable enum constants. Disable delete and edit buttons in fermentables rows for bottle and kegs sugars. Better mash time calculation in calcFermentables. Added check supplies. Added recalculate volumes. Update inventory when a fermentable is replaced. Added tooltips in brewing salts fields in the miscs table.
Michiel Broek <mbroek@mbse.eu>
parents: 189
diff changeset
585 ui->tabWidget->setTabEnabled(11, stage > PROD_STAGE_PACKAGE);
225
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
586 ui->taste_dateEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
587 if (stage == PROD_STAGE_TASTE) {
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
588 ui->taste_dateEdit->setMinimumDate(product->package_date.addDays(41));
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
589 ui->taste_dateEdit->setMaximumDate(QDate::currentDate());
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
590 }
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
591 ui->taste_dateButton->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
592 ui->taste_colorEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
593 ui->taste_transparencyEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
594 ui->taste_headEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
595 ui->taste_aromaEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
596 ui->taste_tasteEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
597 ui->taste_mouthfeelEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
598 ui->taste_aftertasteEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
599 ui->taste_notesEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
600 ui->taste_rateEdit->setEnabled(stage == PROD_STAGE_TASTE);
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
601 if ((product->taste_color != "") && (product->taste_transparency != "") && (product->taste_head != "") &&
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
602 (product->taste_aroma != "") && (product->taste_taste != "") && (product->taste_mouthfeel != "") &&
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
603 (product->taste_aftertaste != "") && (product->taste_notes != "") && (product->taste_rate > 0) &&
233
baf666307ebb Hide the taste ack button of stage is not taste.
Michiel Broek <mbroek@mbse.eu>
parents: 227
diff changeset
604 (product->taste_date.isValid() && (stage == PROD_STAGE_TASTE)))
225
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
605 ui->taste_ackButton->show();
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
606 else
448e4187cada Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.
Michiel Broek <mbroek@mbse.eu>
parents: 224
diff changeset
607 ui->taste_ackButton->hide();
175
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
608 }
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
609
f1ed3a2a94e9 Initial import of EditProduct, the part from EditRecipe is ported.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
610

mercurial