Tue, 12 Apr 2022 22:33:24 +0200
Added miscs popup editor. No edit functions yet. Delete misc row added.
128 | 1 | /** |
2 | * EditRecipe.cpp is part of bmsapp. | |
3 | * | |
4 | * tab 4, miscs. | |
5 | * | |
6 | * bmsapp is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License, or | |
9 | * (at your option) any later version. | |
10 | * | |
11 | * bmsapp is distributed in the hope that it will be useful, | |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | * GNU General Public License for more details. | |
15 | * | |
16 | * You should have received a copy of the GNU General Public License | |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | */ | |
19 | ||
20 | ||
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
21 | bool EditRecipe::misc_sort_test(const Miscs &D1, const Miscs &D2) |
128 | 22 | { |
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
23 | if (D1.m_use_use > D2.m_use_use) |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
24 | return false; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
25 | if (D1.m_use_use < D2.m_use_use) |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
26 | return true; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
27 | if (D1.m_type > D2.m_type) |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
28 | return false; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
29 | if (D1.m_type < D2.m_type) |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
30 | return true; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
31 | return (D1.m_amount > D2.m_amount); |
128 | 32 | } |
33 | ||
34 | ||
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
35 | void EditRecipe::refreshMiscs() |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
36 | { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
37 | QString w; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
38 | QWidget* pWidget; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
39 | QHBoxLayout* pLayout; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
40 | QTableWidgetItem *item; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
41 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
42 | qDebug() << "refreshMiscs" << recipe->miscs.size(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
43 | std::sort(recipe->miscs.begin(), recipe->miscs.end(), misc_sort_test); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
44 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
45 | /* |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
46 | * During filling the table turn off the cellChanged signal because every cell that is filled |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
47 | * triggers the cellChanged signal. The QTableWidget has no better signal to use. |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
48 | */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
49 | this->ignoreChanges = true; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
50 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
51 | const QStringList labels({tr("Ingredient"), tr("Type"), tr("Use at"), tr("Time"), tr("Amount"), tr("Delete"), tr("Edit") }); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
52 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
53 | ui->miscsTable->setColumnCount(7); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
54 | ui->miscsTable->setColumnWidth(0, 300); /* Ingredient */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
55 | ui->miscsTable->setColumnWidth(1, 100); /* Type */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
56 | ui->miscsTable->setColumnWidth(2, 100); /* Added */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
57 | ui->miscsTable->setColumnWidth(3, 75); /* Time */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
58 | ui->miscsTable->setColumnWidth(4, 90); /* Amount */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
59 | ui->miscsTable->setColumnWidth(5, 80); /* Delete */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
60 | ui->miscsTable->setColumnWidth(6, 80); /* Edit */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
61 | ui->miscsTable->setHorizontalHeaderLabels(labels); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
62 | ui->miscsTable->verticalHeader()->hide(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
63 | ui->miscsTable->setRowCount(recipe->miscs.size()); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
64 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
65 | for (int i = 0; i < recipe->miscs.size(); i++) { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
66 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
67 | ui->miscsTable->setItem(i, 0, new QTableWidgetItem(recipe->miscs.at(i).m_name)); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
68 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
69 | item = new QTableWidgetItem(m_types[recipe->miscs.at(i).m_type]); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
70 | item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
71 | ui->miscsTable->setItem(i, 1, item); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
72 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
73 | item = new QTableWidgetItem(m_uses[recipe->miscs.at(i).m_use_use]); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
74 | item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
75 | ui->miscsTable->setItem(i, 2, item); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
76 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
77 | if (recipe->miscs.at(i).m_use_use == 2) { // Boil |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
78 | item = new QTableWidgetItem(QString("%1 min.").arg(recipe->miscs.at(i).m_time, 1, 'f', 0, '0')); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
79 | } else if (recipe->miscs.at(i).m_use_use == 3 || recipe->miscs.at(i).m_use_use == 4) { // Primary or secondary |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
80 | item = new QTableWidgetItem(QString("%1 days.").arg(recipe->miscs.at(i).m_time / 1440, 1, 'f', 0, '0')); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
81 | } else { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
82 | item = new QTableWidgetItem(QString("")); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
83 | } |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
84 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
85 | ui->miscsTable->setItem(i, 3, item); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
86 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
87 | if (recipe->miscs.at(i).m_amount_is_weight) |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
88 | item = new QTableWidgetItem(QString("%1 gr").arg(recipe->miscs.at(i).m_amount * 1000.0, 2, 'f', 1, '0')); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
89 | else |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
90 | item = new QTableWidgetItem(QString("%1 ml").arg(recipe->miscs.at(i).m_amount * 1000.0, 2, 'f', 1, '0')); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
91 | item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
92 | ui->miscsTable->setItem(i, 4, item); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
93 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
94 | /* |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
95 | * Add the Delete and Edit row buttons. |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
96 | * Not for water agents, these are set on the water tab. |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
97 | */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
98 | if (recipe->miscs.at(i).m_type == 4) { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
99 | ui->miscsTable->removeCellWidget(i, 5); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
100 | ui->miscsTable->removeCellWidget(i, 6); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
101 | } else { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
102 | pWidget = new QWidget(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
103 | QPushButton* btn_dele = new QPushButton(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
104 | btn_dele->setObjectName(QString("%1").arg(i)); /* Send row with the button */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
105 | btn_dele->setText(tr("Delete")); |
132
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
106 | connect(btn_dele, SIGNAL(clicked()), this, SLOT(on_deleteMiscRow_clicked())); |
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
107 | pLayout = new QHBoxLayout(pWidget); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
108 | pLayout->addWidget(btn_dele); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
109 | pLayout->setContentsMargins(5, 0, 5, 0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
110 | pWidget->setLayout(pLayout); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
111 | ui->miscsTable->setCellWidget(i, 5, pWidget); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
112 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
113 | pWidget = new QWidget(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
114 | QPushButton* btn_edit = new QPushButton(); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
115 | btn_edit->setObjectName(QString("%1").arg(i)); /* Send row with the button */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
116 | btn_edit->setText(tr("Edit")); |
132
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
117 | connect(btn_edit, SIGNAL(clicked()), this, SLOT(on_editMiscRow_clicked())); |
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
118 | pLayout = new QHBoxLayout(pWidget); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
119 | pLayout->addWidget(btn_edit); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
120 | pLayout->setContentsMargins(5, 0, 5, 0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
121 | pWidget->setLayout(pLayout); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
122 | ui->miscsTable->setCellWidget(i, 6, pWidget); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
123 | } |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
124 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
125 | /* |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
126 | * Update the water agents. |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
127 | */ |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
128 | if (recipe->miscs.at(i).m_type == 4) { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
129 | if (recipe->miscs.at(i).m_name == "CaCl2") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
130 | ui->bs_cacl2Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
131 | } else if (recipe->miscs.at(i).m_name == "CaSO4") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
132 | ui->bs_caso4Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
133 | } else if (recipe->miscs.at(i).m_name == "MgSO4") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
134 | ui->bs_mgso4Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
135 | } else if (recipe->miscs.at(i).m_name == "NaCl") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
136 | ui->bs_naclEdit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
137 | } else if (recipe->miscs.at(i).m_name == "MgCl2") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
138 | ui->bs_mgcl2Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
139 | } else if (recipe->miscs.at(i).m_name == "NaHCO3") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
140 | ui->bs_nahco3Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
141 | } else if (recipe->miscs.at(i).m_name == "CaCO3") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
142 | ui->bs_caco3Edit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
143 | } else if (recipe->miscs.at(i).m_name == "Melkzuur" || recipe->miscs.at(i).m_name == "Lactic") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
144 | recipe->wa_acid_name = 0; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
145 | recipe->wa_acid_perc = my_acids.at(0).AcidPrc; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
146 | ui->mw_acidPick->setCurrentIndex(0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
147 | ui->mw_acidpercEdit->setValue(my_acids.at(0).AcidPrc); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
148 | ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
149 | } else if (recipe->miscs.at(i).m_name == "Zoutzuur" || recipe->miscs.at(i).m_name == "Hydrochloric") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
150 | recipe->wa_acid_name = 1; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
151 | recipe->wa_acid_perc = my_acids.at(1).AcidPrc; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
152 | ui->mw_acidPick->setCurrentIndex(1); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
153 | ui->mw_acidpercEdit->setValue(my_acids.at(1).AcidPrc); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
154 | ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
155 | } else if (recipe->miscs.at(i).m_name == "Fosforzuur" || recipe->miscs.at(i).m_name == "Phosphoric") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
156 | recipe->wa_acid_name = 2; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
157 | recipe->wa_acid_perc = my_acids.at(2).AcidPrc; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
158 | ui->mw_acidPick->setCurrentIndex(2); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
159 | ui->mw_acidpercEdit->setValue(my_acids.at(2).AcidPrc); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
160 | ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
161 | } else if (recipe->miscs.at(i).m_name == "Zwavelzuur" || recipe->miscs.at(i).m_name == "Sulfuric") { |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
162 | recipe->wa_acid_name = 3; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
163 | recipe->wa_acid_perc = my_acids.at(3).AcidPrc; |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
164 | ui->mw_acidPick->setCurrentIndex(3); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
165 | ui->mw_acidpercEdit->setValue(my_acids.at(3).AcidPrc); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
166 | ui->mw_acidvolEdit->setValue(recipe->miscs.at(i).m_amount * 1000.0); |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
167 | } |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
168 | } |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
169 | } |
132
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
170 | this->ignoreChanges = false; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
171 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
172 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
173 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
174 | void EditRecipe::on_addMiscRow_clicked() |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
175 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
176 | Miscs newm; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
177 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
178 | qDebug() << "Add misc row"; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
179 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
180 | for (int i = 0; i < recipe->miscs.size(); i++) { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
181 | if (recipe->miscs.at(i).m_amount == 0) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
182 | return; // Add only one at a time. |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
183 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
184 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
185 | newm.m_name = "Select one"; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
186 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
187 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
188 | recipe->miscs.append(newm); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
189 | emit refreshAll(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
190 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
191 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
192 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
193 | void EditRecipe::on_deleteMiscRow_clicked() |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
194 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
195 | QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
196 | int row = pb->objectName().toInt(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
197 | qDebug() << "Delete misc row" << row << recipe->miscs.size(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
198 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
199 | if (recipe->miscs.size() < 1) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
200 | return; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
201 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
202 | int rc = QMessageBox::warning(this, tr("Delete misc"), tr("Delete %1").arg(recipe->miscs.at(row).m_name), |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
203 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
204 | if (rc == QMessageBox::No) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
205 | return; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
206 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
207 | this->ignoreChanges = true; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
208 | recipe->miscs.removeAt(row); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
209 | this->ignoreChanges = false; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
210 | is_changed(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
211 | emit refreshAll(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
212 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
213 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
214 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
215 | void EditRecipe::misc_amount_changed(double val) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
216 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
217 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
218 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
219 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
220 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
221 | void EditRecipe::misc_time_changed(int val) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
222 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
223 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
224 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
225 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
226 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
227 | void EditRecipe::misc_select_changed(int val) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
228 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
229 | QSqlQuery query; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
230 | bool instock = hinstockEdit->isChecked(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
231 | QString w; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
232 | QTableWidgetItem *item; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
233 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
234 | if (val < 1) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
235 | return; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
236 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
237 | qDebug() << "misc_select_changed()" << recipe->fermentables_row << val << instock; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
238 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
239 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
240 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
241 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
242 | void EditRecipe::misc_instock_changed(bool val) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
243 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
244 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
245 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
246 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
247 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
248 | void EditRecipe::misc_useat_changed(int val) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
249 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
250 | |
131
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
251 | } |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
252 | |
0115b97e8c39
Added global variables, C++ lovers will hate that. Added global acid data. Fixed several load and save errors in the json arrays in the recipe record. Added first part of the miscs table. The first part of the water tab has values.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
253 | |
132
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
254 | void EditRecipe::on_editMiscRow_clicked() |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
255 | { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
256 | QSqlQuery query; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
257 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
258 | QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender()); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
259 | recipe->miscs_row = pb->objectName().toInt(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
260 | qDebug() << "Edit misc row" << recipe->miscs_row; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
261 | Miscs backup = recipe->miscs.at(recipe->miscs_row); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
262 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
263 | QDialog* dialog = new QDialog(this); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
264 | dialog->resize(738, 230); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
265 | QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
266 | buttonBox->setObjectName(QString::fromUtf8("buttonBox")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
267 | buttonBox->setGeometry(QRect(30, 180, 671, 32)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
268 | buttonBox->setLayoutDirection(Qt::LeftToRight); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
269 | buttonBox->setOrientation(Qt::Horizontal); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
270 | buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
271 | buttonBox->setCenterButtons(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
272 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
273 | QLabel *nameLabel = new QLabel(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
274 | nameLabel->setObjectName(QString::fromUtf8("nameLabel")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
275 | nameLabel->setText(tr("Current ingredient:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
276 | nameLabel->setGeometry(QRect(10, 10, 141, 20)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
277 | nameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
278 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
279 | QLabel *amountLabel = new QLabel(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
280 | amountLabel->setObjectName(QString::fromUtf8("amountLabel")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
281 | if (recipe->miscs.at(recipe->miscs_row).m_amount_is_weight) |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
282 | amountLabel->setText(tr("Amount in gr:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
283 | else |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
284 | amountLabel->setText(tr("Amount in ml:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
285 | amountLabel->setGeometry(QRect(10, 70, 141, 20)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
286 | amountLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
287 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
288 | mtimeLabel = new QLabel(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
289 | mtimeLabel->setObjectName(QString::fromUtf8("mtimeLabel")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
290 | if (recipe->miscs.at(recipe->miscs_row).m_use_use == 3 || recipe->miscs.at(recipe->miscs_row).m_use_use == 4) // Fermentation stages |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
291 | mtimeLabel->setText(tr("Time in days:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
292 | else if (recipe->miscs.at(recipe->miscs_row).m_use_use == 2) // Boil |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
293 | mtimeLabel->setText(tr("Time in minutes:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
294 | else |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
295 | mtimeLabel->setText(""); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
296 | mtimeLabel->setGeometry(QRect(10, 100, 141, 20)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
297 | mtimeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
298 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
299 | QLabel *selectLabel = new QLabel(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
300 | selectLabel->setObjectName(QString::fromUtf8("selectLabel")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
301 | selectLabel->setText(tr("Select ingredient:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
302 | selectLabel->setGeometry(QRect(10, 40, 141, 20)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
303 | selectLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
304 | QLabel *instockLabel = new QLabel(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
305 | instockLabel->setObjectName(QString::fromUtf8("instockLabel")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
306 | instockLabel->setText(tr("In stock:")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
307 | instockLabel->setGeometry(QRect(525, 40, 121, 20)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
308 | instockLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
309 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
310 | mselectEdit = new QComboBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
311 | mselectEdit->setObjectName(QString::fromUtf8("selectEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
312 | mselectEdit->setGeometry(QRect(160, 40, 371, 23)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
313 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
314 | mnameEdit = new QLineEdit(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
315 | mnameEdit->setObjectName(QString::fromUtf8("mnameEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
316 | mnameEdit->setText(recipe->miscs.at(recipe->miscs_row).m_name); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
317 | mnameEdit->setGeometry(QRect(160, 10, 511, 23)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
318 | mnameEdit->setReadOnly(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
319 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
320 | mamountEdit = new QDoubleSpinBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
321 | mamountEdit->setObjectName(QString::fromUtf8("mamountEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
322 | mamountEdit->setGeometry(QRect(160, 70, 121, 24)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
323 | mamountEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
324 | mamountEdit->setAccelerated(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
325 | mamountEdit->setDecimals(1); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
326 | mamountEdit->setMaximum(1000000.0); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
327 | mamountEdit->setSingleStep(0.5); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
328 | mamountEdit->setValue(recipe->miscs.at(recipe->miscs_row).m_amount * 1000.0); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
329 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
330 | mtimeEdit = new QSpinBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
331 | mtimeEdit->setObjectName(QString::fromUtf8("mtimeEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
332 | mtimeEdit->setGeometry(QRect(160, 100, 121, 24)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
333 | mtimeEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
334 | mtimeEdit->setAccelerated(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
335 | mtimeEdit->setMaximum(10000.0); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
336 | if (recipe->miscs.at(recipe->miscs_row).m_use_use == 3 || recipe->miscs.at(recipe->miscs_row).m_use_use == 4) { // Fermentation stages |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
337 | mtimeEdit->setValue(recipe->miscs.at(recipe->miscs_row).m_time / 1440); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
338 | mtimeEdit->setReadOnly(false); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
339 | } else if (recipe->miscs.at(recipe->miscs_row).m_use_use == 2) { // Boil |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
340 | mtimeEdit->setValue(recipe->miscs.at(recipe->miscs_row).m_time); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
341 | mtimeEdit->setReadOnly(false); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
342 | } else { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
343 | mtimeEdit->setReadOnly(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
344 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
345 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
346 | useatEdit = new QComboBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
347 | useatEdit->setObjectName(QString::fromUtf8("useatEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
348 | useatEdit->setGeometry(QRect(160, 130, 161, 23)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
349 | useatEdit->addItem(tr("Starter")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
350 | useatEdit->addItem(tr("Mash")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
351 | useatEdit->addItem(tr("Boil")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
352 | useatEdit->addItem(tr("Primary")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
353 | useatEdit->addItem(tr("Secondary")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
354 | useatEdit->addItem(tr("Bottling")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
355 | useatEdit->setCurrentIndex(recipe->miscs.at(recipe->miscs_row).m_use_use); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
356 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
357 | minstockEdit = new QCheckBox(dialog); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
358 | minstockEdit->setObjectName(QString::fromUtf8("minstockEdit")); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
359 | minstockEdit->setGeometry(QRect(655, 40, 85, 21)); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
360 | minstockEdit->setChecked(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
361 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
362 | misc_instock_changed(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
363 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
364 | connect(mselectEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::misc_select_changed); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
365 | connect(mamountEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::misc_amount_changed); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
366 | connect(mtimeEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &EditRecipe::misc_time_changed); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
367 | connect(useatEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::misc_useat_changed); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
368 | connect(minstockEdit, &QCheckBox::stateChanged, this, &EditRecipe::misc_instock_changed); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
369 | connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
370 | connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
371 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
372 | dialog->setModal(true); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
373 | dialog->exec(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
374 | if (dialog->result() == QDialog::Rejected) { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
375 | qDebug() << "reject and rollback"; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
376 | recipe->miscs[recipe->miscs_row] = backup; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
377 | } else { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
378 | /* Clear time if misc is not used for boil or fermentation. */ |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
379 | if (! (recipe->miscs.at(recipe->miscs_row).m_use_use == 2 || |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
380 | recipe->miscs.at(recipe->miscs_row).m_use_use == 3 || |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
381 | recipe->miscs.at(recipe->miscs_row).m_use_use == 4)) { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
382 | if (recipe->miscs.at(recipe->miscs_row).m_time) { |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
383 | recipe->miscs[recipe->miscs_row].m_time = 0; |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
384 | is_changed(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
385 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
386 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
387 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
388 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
389 | disconnect(mselectEdit, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
390 | disconnect(mamountEdit, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
391 | disconnect(mtimeEdit, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
392 | disconnect(useatEdit, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
393 | disconnect(minstockEdit, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
394 | disconnect(buttonBox, nullptr, nullptr, nullptr); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
395 | |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
396 | emit refreshAll(); |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
397 | } |
9ede9c75cb54
Added miscs popup editor. No edit functions yet. Delete misc row added.
Michiel Broek <mbroek@mbse.eu>
parents:
131
diff
changeset
|
398 |