Tue, 19 Apr 2022 11:17:16 +0200
First setup of the mash tab with the table.
128 | 1 | /** |
2 | * EditRecipe.cpp is part of bmsapp. | |
3 | * | |
4 | * tab 6, mash. | |
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 | ||
21 | void EditRecipe::refreshMashs() | |
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; |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
27 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
28 | qDebug() << "refreshYeasts" << recipe->yeasts.size(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
29 | 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
|
30 | |
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 | * 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
|
33 | * 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
|
34 | */ |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
35 | this->ignoreChanges = true; |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
36 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
37 | 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
|
38 | 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
|
39 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
40 | ui->mashsTable->setColumnCount(14); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
41 | 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
|
42 | 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
|
43 | 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
|
44 | 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
|
45 | 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
|
46 | 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
|
47 | 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
|
48 | 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
|
49 | 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
|
50 | 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
|
51 | 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
|
52 | 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
|
53 | 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
|
54 | 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
|
55 | ui->mashsTable->setHorizontalHeaderLabels(labels); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
56 | ui->mashsTable->verticalHeader()->hide(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
57 | 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
|
58 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
59 | 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
|
60 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
61 | 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
|
62 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
63 | 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
|
64 | 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
|
65 | 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
|
66 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
67 | 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
|
68 | 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
|
69 | 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
|
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).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
|
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, 3, 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 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
|
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, 4, 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).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
|
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, 5, 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 | 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
|
84 | 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
|
85 | 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
|
86 | 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
|
87 | 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
|
88 | 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
|
89 | 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
|
90 | } else { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
91 | ui->mashsTable->removeCellWidget(i, 6); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
92 | ui->mashsTable->removeCellWidget(i, 7); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
93 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
94 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
95 | 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
|
96 | 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
|
97 | 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
|
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/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
|
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, 9, 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 | pWidget = new QWidget(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
104 | QPushButton* btn_up = new QPushButton(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
105 | btn_up->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
|
106 | btn_up->setText(tr("U")); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
107 | connect(btn_up, SIGNAL(clicked()), this, SLOT(upMashRow_clicked())); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
108 | pLayout = new QHBoxLayout(pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
109 | pLayout->addWidget(btn_up); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
110 | 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
|
111 | pWidget->setLayout(pLayout); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
112 | ui->mashsTable->setCellWidget(i, 10, pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
113 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
114 | pWidget = new QWidget(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
115 | QPushButton* btn_down = new QPushButton(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
116 | btn_down->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
|
117 | btn_down->setText(tr("D")); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
118 | connect(btn_down, SIGNAL(clicked()), this, SLOT(downMashRow_clicked())); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
119 | pLayout = new QHBoxLayout(pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
120 | pLayout->addWidget(btn_down); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
121 | 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
|
122 | pWidget->setLayout(pLayout); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
123 | ui->mashsTable->setCellWidget(i, 11, pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
124 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
125 | pWidget = new QWidget(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
126 | QPushButton* btn_dele = new QPushButton(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
127 | 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
|
128 | btn_dele->setText(tr("Delete")); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
129 | 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
|
130 | pLayout = new QHBoxLayout(pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
131 | pLayout->addWidget(btn_dele); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
132 | 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
|
133 | pWidget->setLayout(pLayout); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
134 | 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
|
135 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
136 | pWidget = new QWidget(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
137 | QPushButton* btn_edit = new QPushButton(); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
138 | 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
|
139 | btn_edit->setText(tr("Edit")); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
140 | 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
|
141 | pLayout = new QHBoxLayout(pWidget); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
142 | pLayout->addWidget(btn_edit); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
143 | 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
|
144 | pWidget->setLayout(pLayout); |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
145 | 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
|
146 | } |
128 | 147 | } |
148 | ||
149 | ||
144
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
150 | void EditRecipe::addMashRow_clicked() |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
151 | { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
152 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
153 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
154 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
155 | void EditRecipe::deleteMashRow_clicked() |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
156 | { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
157 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
158 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
159 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
160 | void EditRecipe::upMashRow_clicked() |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
161 | { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
162 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
163 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
164 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
165 | void EditRecipe::downMashRow_clicked() |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
166 | { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
167 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
168 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
169 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
170 | void EditRecipe::editMashRow_clicked() |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
171 | { |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
172 | } |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
173 | |
c4b107bf153a
First setup of the mash tab with the table.
Michiel Broek <mbroek@mbse.eu>
parents:
128
diff
changeset
|
174 |