src/EditRecipeTab6.cpp

Tue, 19 Apr 2022 21:26:56 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 19 Apr 2022 21:26:56 +0200
changeset 146
aad2f9f38fc5
parent 145
fd4f0de86fd9
child 147
af1386a6ece7
permissions
-rw-r--r--

Added swap mash rows.

128
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 /**
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2 * EditRecipe.cpp is part of bmsapp.
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 *
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4 * tab 6, mash.
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 *
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 * bmsapp is free software: you can redistribute it and/or modify
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 * the Free Software Foundation, either version 3 of the License, or
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9 * (at your option) any later version.
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10 *
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 * bmsapp is distributed in the hope that it will be useful,
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 * GNU General Public License for more details.
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
15 *
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
18 */
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
19
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
20
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
21 void EditRecipe::refreshMashs()
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
22 {
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
23 QString w;
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
24 QWidget* pWidget;
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
25 QHBoxLayout* pLayout;
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
26 QTableWidgetItem *item;
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
27 QIcon down_icon, up_icon;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
28
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
29 down_icon.addFile(QString::fromUtf8(":/icons/silk/bullet_arrow_down.png"), QSize(), QIcon::Normal, QIcon::Off);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
30 up_icon.addFile(QString::fromUtf8(":/icons/silk/bullet_arrow_up.png"), QSize(), QIcon::Normal, QIcon::Off);
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
31
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
32 qDebug() << "refreshYeasts" << recipe->yeasts.size();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
33 std::sort(recipe->yeasts.begin(), recipe->yeasts.end(), yeast_sort_test);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
34
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
35 /*
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
36 * During filling the table turn off the cellChanged signal because every cell that is filled
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
37 * triggers the cellChanged signal. The QTableWidget has no better signal to use.
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
38 */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
39 this->ignoreChanges = true;
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
40
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
41 const QStringList labels({tr("Step name"), tr("Type"), tr("Start"), tr("End"), tr("Rest"), tr("Ramp"),
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
42 tr("Inf/dec"), tr("Inf/dec"), tr("Volume"), tr("W/G ratio"), "", "", tr("Delete"), tr("Edit") });
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
43
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
44 ui->mashsTable->setColumnCount(14);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
45 ui->mashsTable->setColumnWidth(0, 189); /* Step name */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
46 ui->mashsTable->setColumnWidth(1, 100); /* Type */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
47 ui->mashsTable->setColumnWidth(2, 70); /* Start temp */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
48 ui->mashsTable->setColumnWidth(3, 70); /* End temp */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
49 ui->mashsTable->setColumnWidth(4, 70); /* Rest time */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
50 ui->mashsTable->setColumnWidth(5, 70); /* Ramp time */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
51 ui->mashsTable->setColumnWidth(6, 70); /* Infusion vol */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
52 ui->mashsTable->setColumnWidth(7, 70); /* Infusion tmp */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
53 ui->mashsTable->setColumnWidth(8, 70); /* Volume */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
54 ui->mashsTable->setColumnWidth(9, 80); /* W/G ratio */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
55 ui->mashsTable->setColumnWidth(10, 30); /* Up button */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
56 ui->mashsTable->setColumnWidth(11, 30); /* Down button */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
57 ui->mashsTable->setColumnWidth(12, 80); /* Delete */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
58 ui->mashsTable->setColumnWidth(13, 80); /* Edit */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
59 ui->mashsTable->setHorizontalHeaderLabels(labels);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
60 ui->mashsTable->verticalHeader()->hide();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
61 ui->mashsTable->setRowCount(recipe->mashs.size());
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
62
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
63 for (int i = 0; i < recipe->mashs.size(); i++) {
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
64
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
65 ui->mashsTable->setItem(i, 0, new QTableWidgetItem(recipe->mashs.at(i).step_name));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
66
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
67 item = new QTableWidgetItem(step_types[recipe->mashs.at(i).step_type]);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
68 item->setTextAlignment(Qt::AlignCenter|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
69 ui->mashsTable->setItem(i, 1, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
70
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
71 item = new QTableWidgetItem(QString("%1 °C").arg(recipe->mashs.at(i).step_temp, 2, 'f', 1, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
72 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
73 ui->mashsTable->setItem(i, 2, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
74
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
75 item = new QTableWidgetItem(QString("%1 °C").arg(recipe->mashs.at(i).end_temp, 2, 'f', 1, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
76 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
77 ui->mashsTable->setItem(i, 3, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
78
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
79 item = new QTableWidgetItem(QString("%1 min").arg(recipe->mashs.at(i).step_time, 1, 'f', 0, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
80 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
81 ui->mashsTable->setItem(i, 4, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
82
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
83 item = new QTableWidgetItem(QString("%1 min").arg(recipe->mashs.at(i).ramp_time, 1, 'f', 0, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
84 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
85 ui->mashsTable->setItem(i, 5, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
86
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
87 if (recipe->mashs.at(i).step_infuse_amount) {
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
88 item = new QTableWidgetItem(QString("%1 L").arg(recipe->mashs.at(i).step_infuse_amount, 2, 'f', 1, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
89 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
90 ui->mashsTable->setItem(i, 6, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
91 item = new QTableWidgetItem(QString("%1 °C").arg(recipe->mashs.at(i).step_infuse_temp, 3, 'f', 2, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
92 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
93 ui->mashsTable->setItem(i, 7, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
94 } else {
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
95 ui->mashsTable->removeCellWidget(i, 6);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
96 ui->mashsTable->removeCellWidget(i, 7);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
97 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
98
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
99 item = new QTableWidgetItem(QString("%1 L").arg(recipe->mashs.at(i).step_volume, 2, 'f', 1, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
100 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
101 ui->mashsTable->setItem(i, 8, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
102
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
103 item = new QTableWidgetItem(QString("%1 L/kg").arg(recipe->mashs.at(i).step_wg_ratio, 3, 'f', 2, '0'));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
104 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
105 ui->mashsTable->setItem(i, 9, item);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
106
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
107 if (i > 0) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
108 pWidget = new QWidget();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
109 QPushButton* btn_up = new QPushButton();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
110 btn_up->setObjectName(QString("%1").arg(i)); /* Send row with the button */
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
111 btn_up->setIcon(up_icon);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
112 connect(btn_up, SIGNAL(clicked()), this, SLOT(upMashRow_clicked()));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
113 pLayout = new QHBoxLayout(pWidget);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
114 pLayout->addWidget(btn_up);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
115 pLayout->setContentsMargins(5, 0, 5, 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
116 pWidget->setLayout(pLayout);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
117 ui->mashsTable->setCellWidget(i, 10, pWidget);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
118 } else {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
119 ui->mashsTable->removeCellWidget(i, 10);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
120 }
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
121
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
122 if (i < (recipe->mashs.size() - 1)) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
123 pWidget = new QWidget();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
124 QPushButton* btn_down = new QPushButton();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
125 btn_down->setObjectName(QString("%1").arg(i)); /* Send row with the button */
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
126 btn_down->setIcon(down_icon);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
127 connect(btn_down, SIGNAL(clicked()), this, SLOT(downMashRow_clicked()));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
128 pLayout = new QHBoxLayout(pWidget);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
129 pLayout->addWidget(btn_down);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
130 pLayout->setContentsMargins(5, 0, 5, 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
131 pWidget->setLayout(pLayout);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
132 ui->mashsTable->setCellWidget(i, 11, pWidget);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
133 } else {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
134 ui->mashsTable->removeCellWidget(i, 11);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
135 }
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
136
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
137 pWidget = new QWidget();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
138 QPushButton* btn_dele = new QPushButton();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
139 btn_dele->setObjectName(QString("%1").arg(i)); /* Send row with the button */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
140 btn_dele->setText(tr("Delete"));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
141 connect(btn_dele, SIGNAL(clicked()), this, SLOT(deleteMashRow_clicked()));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
142 pLayout = new QHBoxLayout(pWidget);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
143 pLayout->addWidget(btn_dele);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
144 pLayout->setContentsMargins(5, 0, 5, 0);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
145 pWidget->setLayout(pLayout);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
146 ui->mashsTable->setCellWidget(i, 12, pWidget);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
147
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
148 pWidget = new QWidget();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
149 QPushButton* btn_edit = new QPushButton();
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
150 btn_edit->setObjectName(QString("%1").arg(i)); /* Send row with the button */
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
151 btn_edit->setText(tr("Edit"));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
152 connect(btn_edit, SIGNAL(clicked()), this, SLOT(editMashRow_clicked()));
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
153 pLayout = new QHBoxLayout(pWidget);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
154 pLayout->addWidget(btn_edit);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
155 pLayout->setContentsMargins(5, 0, 5, 0);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
156 pWidget->setLayout(pLayout);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
157 ui->mashsTable->setCellWidget(i, 13, pWidget);
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
158 }
128
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
159 }
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
160
0f4eee875ea6 More file splitting
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
161
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
162 void EditRecipe::addMashRow_clicked()
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
163 {
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
164 Mashs newm;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
165
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
166 for (int i = 0; i < recipe->mashs.size(); i++) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
167 if (recipe->mashs.at(i).step_time == 0)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
168 return; // Add only one at a time.
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
169 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
170
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
171 newm.step_name = "Name me";
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
172 newm.step_temp = newm.end_temp = 67.0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
173 newm.step_time = 20;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
174 newm.ramp_time = 10;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
175 if (recipe->mashs.size()) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
176 newm.step_volume = recipe->mashs.at(recipe->mashs.size() - 1).step_volume;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
177 newm.step_wg_ratio = recipe->mashs.at(recipe->mashs.size() - 1).step_wg_ratio;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
178 newm.step_type = recipe->mashs.at(recipe->mashs.size() - 1).step_type;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
179 } else {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
180 newm.step_volume = 0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
181 newm.step_wg_ratio = 0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
182 newm.step_type = 1;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
183 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
184 newm.step_infuse_amount = newm.step_infuse_temp = 0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
185
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
186 recipe->mashs.append(newm);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
187 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
188 emit refreshAll();
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
189 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
190
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
191
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
192 void EditRecipe::deleteMashRow_clicked()
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
193 {
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
194 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
195 int row = pb->objectName().toInt();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
196 qDebug() << "Delete mash row" << row << recipe->mashs.size();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
197
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
198 if (recipe->mashs.size() < 1)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
199 return;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
200
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
201 int rc = QMessageBox::warning(this, tr("Delete mash step"), tr("Delete %1").arg(recipe->mashs.at(row).step_name),
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
202 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
203 if (rc == QMessageBox::No)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
204 return;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
205
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
206 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
207 recipe->mashs.removeAt(row);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
208 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
209 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
210 emit refreshAll();
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
211 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
212
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
213
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
214 void EditRecipe::upMashRow_clicked()
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
215 {
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
216 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
217 int row = pb->objectName().toInt();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
218 qDebug() << "Move up mash row" << row << recipe->mashs.size();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
219
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
220 if (recipe->mashs.size() < 1)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
221 return;
146
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
222
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
223 this->ignoreChanges = true;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
224 Mashs temp;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
225 temp = recipe->mashs[row - 1];
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
226 recipe->mashs[row - 1] = recipe->mashs[row];
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
227 recipe->mashs[row] = temp;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
228 this->ignoreChanges = false;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
229 is_changed();
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
230 emit refreshAll();
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
231 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
232
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
233
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
234 void EditRecipe::downMashRow_clicked()
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
235 {
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
236 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
237 int row = pb->objectName().toInt();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
238 qDebug() << "Move down mash row" << row << recipe->mashs.size();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
239
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
240 if (recipe->mashs.size() < 1)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
241 return;
146
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
242
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
243 this->ignoreChanges = true;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
244 Mashs temp;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
245 temp = recipe->mashs[row + 1];
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
246 recipe->mashs[row + 1] = recipe->mashs[row];
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
247 recipe->mashs[row] = temp;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
248 this->ignoreChanges = false;
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
249 is_changed();
aad2f9f38fc5 Added swap mash rows.
Michiel Broek <mbroek@mbse.eu>
parents: 145
diff changeset
250 emit refreshAll();
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
251 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
252
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
253
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
254 void EditRecipe::step_name_changed(QString val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
255 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
256 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
257 recipe->mashs[recipe->mashs_row].step_name = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
258 ui->mashsTable->setItem(recipe->mashs_row, 0, new QTableWidgetItem(val));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
259 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
260 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
261 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
262
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
263
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
264 void EditRecipe::step_type_changed(int val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
265 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
266 qDebug() << "step_type_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
267
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
268 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
269 recipe->mashs[recipe->mashs_row].step_type = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
270 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
271 ivolLabel->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
272 stepivolEdit->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
273 itmpLabel->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
274 stepitmpEdit->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
275 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
276 emit refreshAll();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
277 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
278
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
279
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
280 void EditRecipe::step_temp_changed(double val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
281 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
282 qDebug() << "step_temp_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
283 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
284 recipe->mashs[recipe->mashs_row].step_temp = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
285 QTableWidgetItem *item = new QTableWidgetItem(QString("%1 °C").arg(val, 2, 'f', 1, '0'));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
286 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
287 ui->mashsTable->setItem(recipe->mashs_row, 2, item);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
288 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
289 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
290 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
291
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
292
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
293 void EditRecipe::end_temp_changed(double val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
294 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
295 qDebug() << "end_temp_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
296 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
297 recipe->mashs[recipe->mashs_row].end_temp = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
298 QTableWidgetItem *item = new QTableWidgetItem(QString("%1 °C").arg(val, 2, 'f', 1, '0'));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
299 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
300 ui->mashsTable->setItem(recipe->mashs_row, 3, item);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
301 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
302 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
303 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
304
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
305
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
306 void EditRecipe::step_time_changed(double val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
307 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
308 qDebug() << "step_time_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
309 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
310 recipe->mashs[recipe->mashs_row].step_time = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
311 QTableWidgetItem *item = new QTableWidgetItem(QString("%1 min").arg(val, 1, 'f', 0, '0'));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
312 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
313 ui->mashsTable->setItem(recipe->mashs_row, 4, item);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
314 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
315 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
316 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
317
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
318
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
319 void EditRecipe::ramp_time_changed(double val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
320 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
321 qDebug() << "ramp_time_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
322 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
323 recipe->mashs[recipe->mashs_row].ramp_time = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
324 QTableWidgetItem *item = new QTableWidgetItem(QString("%1 min").arg(val, 1, 'f', 0, '0'));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
325 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
326 ui->mashsTable->setItem(recipe->mashs_row, 5, item);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
327 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
328 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
329 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
330
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
331
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
332 void EditRecipe::infuse_changed(double val)
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
333 {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
334 qDebug() << "infuse_changed" << recipe->mashs_row << val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
335 this->ignoreChanges = true;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
336 recipe->mashs[recipe->mashs_row].step_infuse_amount = val;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
337 QTableWidgetItem *item = new QTableWidgetItem(QString("%1 L").arg(val, 1, 'f', 0, '0'));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
338 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
339 ui->mashsTable->setItem(recipe->mashs_row, 6, item);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
340
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
341 /*
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
342 * Recalculate water volumes
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
343 */
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
344 double volume = 0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
345 for (int i = 0; i < recipe->mashs.size(); i++) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
346 if (recipe->mashs.at(i).step_type == 0) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
347 volume += recipe->mashs.at(i).step_infuse_amount;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
348 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
349 recipe->mashs[i].step_volume = volume;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
350 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
351 recipe->w1_amount = volume - recipe->w2_amount;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
352 recipe->wg_amount = volume;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
353 ui->w1_volEdit->setValue(recipe->w1_amount);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
354
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
355 this->ignoreChanges = false;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
356 is_changed();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
357 emit refreshAll();
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
358 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
359
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
360
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
361 void EditRecipe::editMashRow_clicked()
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
362 {
145
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
363 QSqlQuery query;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
364
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
365 QPushButton *pb = qobject_cast<QPushButton *>(QObject::sender());
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
366 recipe->mashs_row = pb->objectName().toInt();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
367 qDebug() << "Edit mash row" << recipe->mashs_row;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
368 Mashs backup = recipe->mashs.at(recipe->mashs_row);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
369
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
370 QDialog* dialog = new QDialog(this);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
371 dialog->resize(738, 230);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
372 QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
373 buttonBox->setObjectName(QString::fromUtf8("buttonBox"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
374 buttonBox->setGeometry(QRect(30, 180, 671, 32));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
375 buttonBox->setLayoutDirection(Qt::LeftToRight);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
376 buttonBox->setOrientation(Qt::Horizontal);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
377 buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
378 buttonBox->setCenterButtons(true);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
379
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
380 QLabel *nameLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
381 nameLabel->setObjectName(QString::fromUtf8("nameLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
382 nameLabel->setText(tr("Step name:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
383 nameLabel->setGeometry(QRect(10, 10, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
384 nameLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
385 stepnameEdit = new QLineEdit(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
386 stepnameEdit->setObjectName(QString::fromUtf8("stepnameEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
387 stepnameEdit->setText(recipe->mashs.at(recipe->mashs_row).step_name);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
388 stepnameEdit->setGeometry(QRect(160, 10, 511, 23));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
389
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
390 QLabel *typeLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
391 typeLabel->setObjectName(QString::fromUtf8("typeLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
392 typeLabel->setText(tr("Step type:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
393 typeLabel->setGeometry(QRect(10, 40, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
394 typeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
395 QComboBox *typeEdit = new QComboBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
396 typeEdit->setObjectName(QString::fromUtf8("typeEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
397 typeEdit->setGeometry(QRect(160, 40, 161, 23));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
398 typeEdit->addItem(tr("Infusion"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
399 typeEdit->addItem(tr("Temperature"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
400 typeEdit->addItem(tr("Decoction"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
401 typeEdit->setCurrentIndex(recipe->mashs.at(recipe->mashs_row).step_type);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
402
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
403 QLabel *tempLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
404 tempLabel->setObjectName(QString::fromUtf8("tempLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
405 tempLabel->setText(tr("Step start temp:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
406 tempLabel->setGeometry(QRect(10, 70, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
407 tempLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
408 steptempEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
409 steptempEdit->setObjectName(QString::fromUtf8("steptempEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
410 steptempEdit->setGeometry(QRect(160, 70, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
411 steptempEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
412 steptempEdit->setDecimals(1);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
413 steptempEdit->setValue(recipe->mashs.at(recipe->mashs_row).step_temp);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
414
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
415 QLabel *endLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
416 endLabel->setObjectName(QString::fromUtf8("endLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
417 endLabel->setText(tr("Step end temp:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
418 endLabel->setGeometry(QRect(360, 70, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
419 endLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
420 endtempEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
421 endtempEdit->setObjectName(QString::fromUtf8("endtempEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
422 endtempEdit->setGeometry(QRect(510, 70, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
423 endtempEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
424 endtempEdit->setDecimals(1);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
425 endtempEdit->setValue(recipe->mashs.at(recipe->mashs_row).end_temp);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
426
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
427 QLabel *timeLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
428 timeLabel->setObjectName(QString::fromUtf8("timeLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
429 timeLabel->setText(tr("Step rest time:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
430 timeLabel->setGeometry(QRect(10, 100, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
431 timeLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
432 steptimeEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
433 steptimeEdit->setObjectName(QString::fromUtf8("steptimeEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
434 steptimeEdit->setGeometry(QRect(160, 100, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
435 steptimeEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
436 steptimeEdit->setDecimals(0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
437 steptimeEdit->setValue(recipe->mashs.at(recipe->mashs_row).step_time);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
438
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
439 QLabel *rampLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
440 rampLabel->setObjectName(QString::fromUtf8("rampLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
441 rampLabel->setText(tr("Step ramp time:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
442 rampLabel->setGeometry(QRect(360, 100, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
443 rampLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
444 ramptimeEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
445 ramptimeEdit->setObjectName(QString::fromUtf8("ramptimeEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
446 ramptimeEdit->setGeometry(QRect(510, 100, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
447 ramptimeEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
448 ramptimeEdit->setDecimals(0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
449 ramptimeEdit->setValue(recipe->mashs.at(recipe->mashs_row).ramp_time);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
450
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
451 /*
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
452 * Only used for Infusion steps.
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
453 */
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
454 ivolLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
455 ivolLabel->setObjectName(QString::fromUtf8("ivolLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
456 ivolLabel->setText(tr("Infusion volume:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
457 ivolLabel->setGeometry(QRect(10, 130, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
458 ivolLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
459 ivolLabel->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
460 stepivolEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
461 stepivolEdit->setObjectName(QString::fromUtf8("stepivolEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
462 stepivolEdit->setGeometry(QRect(160, 130, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
463 stepivolEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
464 stepivolEdit->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
465 stepivolEdit->setDecimals(1);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
466 stepivolEdit->setSingleStep(0.5);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
467 stepivolEdit->setValue(recipe->mashs.at(recipe->mashs_row).step_infuse_amount);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
468
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
469 itmpLabel = new QLabel(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
470 itmpLabel->setObjectName(QString::fromUtf8("itmpLabel"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
471 itmpLabel->setText(tr("Infusion Temperature:"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
472 itmpLabel->setGeometry(QRect(360, 130, 141, 20));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
473 itmpLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
474 itmpLabel->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
475 stepitmpEdit = new QDoubleSpinBox(dialog);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
476 stepitmpEdit->setObjectName(QString::fromUtf8("stepitmpEdit"));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
477 stepitmpEdit->setGeometry(QRect(510, 130, 121, 24));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
478 stepitmpEdit->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
479 stepitmpEdit->setVisible(recipe->mashs.at(recipe->mashs_row).step_type == 0);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
480 stepitmpEdit->setDecimals(1);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
481 stepitmpEdit->setReadOnly(true);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
482 stepitmpEdit->setButtonSymbols(QAbstractSpinBox::NoButtons);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
483 stepitmpEdit->setValue(recipe->mashs.at(recipe->mashs_row).step_infuse_temp);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
484
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
485 connect(stepnameEdit, &QLineEdit::textEdited, this, &EditRecipe::step_name_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
486 connect(typeEdit, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &EditRecipe::step_type_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
487 connect(steptempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::step_temp_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
488 connect(endtempEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::end_temp_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
489 connect(steptimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::step_time_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
490 connect(ramptimeEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::ramp_time_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
491 connect(stepivolEdit, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &EditRecipe::infuse_changed);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
492 connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
493 connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
494
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
495 dialog->setModal(true);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
496 dialog->exec();
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
497 if (dialog->result() == QDialog::Rejected) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
498 qDebug() << "reject and rollback";
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
499 recipe->mashs[recipe->mashs_row] = backup;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
500 /* Rollback water volumes too */
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
501 double volume = 0;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
502 for (int i = 0; i < recipe->mashs.size(); i++) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
503 if (recipe->mashs.at(i).step_type == 0) {
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
504 volume += recipe->mashs.at(i).step_infuse_amount;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
505 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
506 recipe->mashs[i].step_volume = volume;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
507 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
508 recipe->w1_amount = volume - recipe->w2_amount;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
509 recipe->wg_amount = volume;
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
510 ui->w1_volEdit->setValue(recipe->w1_amount);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
511 }
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
512
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
513 disconnect(stepnameEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
514 disconnect(steptempEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
515 disconnect(endtempEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
516 disconnect(steptimeEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
517 disconnect(ramptimeEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
518 disconnect(stepivolEdit, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
519 disconnect(buttonBox, nullptr, nullptr, nullptr);
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
520
fd4f0de86fd9 Implemented most parts of the mash editor.
Michiel Broek <mbroek@mbse.eu>
parents: 144
diff changeset
521 emit refreshAll();
144
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
522 }
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
523
c4b107bf153a First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents: 128
diff changeset
524

mercurial