288 { |
288 { |
289 QTableWidgetItem *item; |
289 QTableWidgetItem *item; |
290 |
290 |
291 qDebug() << "hop_time_changed()" << recipe->hops_row << val; |
291 qDebug() << "hop_time_changed()" << recipe->hops_row << val; |
292 |
292 |
293 recipe->hops[recipe->hops_row].h_time = val; |
|
294 if (recipe->hops.at(recipe->hops_row).h_useat == 2 || recipe->hops.at(recipe->hops_row).h_useat == 4) { // Boil or whirlpool |
293 if (recipe->hops.at(recipe->hops_row).h_useat == 2 || recipe->hops.at(recipe->hops_row).h_useat == 4) { // Boil or whirlpool |
295 item = new QTableWidgetItem(QString("%1 min.").arg(val, 1, 'f', 0, '0')); |
294 item = new QTableWidgetItem(QString("%1 min.").arg(val, 1, 'f', 0, '0')); |
|
295 recipe->hops[recipe->hops_row].h_time = val; |
296 } else if (recipe->hops.at(recipe->hops_row).h_useat == 5) { // Dry-hop |
296 } else if (recipe->hops.at(recipe->hops_row).h_useat == 5) { // Dry-hop |
297 item = new QTableWidgetItem(QString("%1 days.").arg(val / 1440, 1, 'f', 0, '0')); |
297 item = new QTableWidgetItem(QString("%1 days.").arg(val, 1, 'f', 0, '0')); |
|
298 recipe->hops[recipe->hops_row].h_time = val * 1440; |
298 } else { |
299 } else { |
299 item = new QTableWidgetItem(QString("")); |
300 item = new QTableWidgetItem(QString("")); |
|
301 recipe->hops[recipe->hops_row].h_time = val; |
300 } |
302 } |
301 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
303 item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); |
302 ui->hopsTable->setItem(recipe->hops_row, 6, item); |
304 ui->hopsTable->setItem(recipe->hops_row, 6, item); |
303 |
305 |
304 double ibu = Utils::toIBU(recipe->hops.at(recipe->hops_row).h_useat, recipe->hops.at(recipe->hops_row).h_form, recipe->preboil_sg, |
306 double ibu = Utils::toIBU(recipe->hops.at(recipe->hops_row).h_useat, recipe->hops.at(recipe->hops_row).h_form, recipe->preboil_sg, |