103 printer->newPage(); |
103 printer->newPage(); |
104 printHeader(&painter); |
104 printHeader(&painter); |
105 y = 120; |
105 y = 120; |
106 } |
106 } |
107 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
107 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
108 painter.drawText( 20, y+4, 80, 20, Qt::AlignLeft, fermentable_types[query.value(0).toInt()]); |
108 painter.drawText( 20, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("FermentableType", g_fermentable_types[query.value(0).toInt()])); |
109 painter.drawText(100, y+4, 100, 20, Qt::AlignLeft, query.value(2).toString()); |
109 painter.drawText(100, y+4, 100, 20, Qt::AlignLeft, query.value(2).toString()); |
110 painter.drawText(200, y+4, 260, 20, Qt::AlignLeft, query.value(1).toString()); |
110 painter.drawText(200, y+4, 260, 20, Qt::AlignLeft, query.value(1).toString()); |
111 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3); |
111 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3); |
112 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w); |
112 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w); |
113 w = QString("%1 €").arg(query.value(4).toDouble(), 8, 'f', 2); |
113 w = QString("%1 €").arg(query.value(4).toDouble(), 8, 'f', 2); |
152 y = 120; |
152 y = 120; |
153 } |
153 } |
154 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
154 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
155 painter.drawText( 20, y+4, 120, 20, Qt::AlignLeft, query.value(2).toString()); |
155 painter.drawText( 20, y+4, 120, 20, Qt::AlignLeft, query.value(2).toString()); |
156 painter.drawText(140, y+4, 240, 20, Qt::AlignLeft, query.value(0).toString()); |
156 painter.drawText(140, y+4, 240, 20, Qt::AlignLeft, query.value(0).toString()); |
157 painter.drawText(380, y+4, 80, 20, Qt::AlignLeft, hop_forms[query.value(1).toInt()]); |
157 painter.drawText(380, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("HopForm", g_hop_forms[query.value(1).toInt()])); |
158 if (query.value(3).toDouble() < 0.6) |
158 if (query.value(3).toDouble() < 0.6) |
159 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
159 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
160 else |
160 else |
161 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3); |
161 w = QString("%1 kg").arg(query.value(3).toDouble(), 10, 'f', 3); |
162 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w); |
162 painter.drawText(460, y+4, 115, 20, Qt::AlignRight, w); |
249 printer->newPage(); |
249 printer->newPage(); |
250 printHeader(&painter); |
250 printHeader(&painter); |
251 y = 120; |
251 y = 120; |
252 } |
252 } |
253 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
253 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
254 painter.drawText( 20, y+4, 120, 20, Qt::AlignLeft, misc_types[query.value(1).toInt()]); |
254 painter.drawText( 20, y+4, 120, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[query.value(1).toInt()])); |
255 painter.drawText(140, y+4, 320, 20, Qt::AlignLeft, query.value(0).toString()); |
255 painter.drawText(140, y+4, 320, 20, Qt::AlignLeft, query.value(0).toString()); |
256 if (query.value(2).toInt()) |
256 if (query.value(2).toInt()) |
257 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
257 w = QString("%1 gr").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
258 else |
258 else |
259 w = QString("%1 ml").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
259 w = QString("%1 ml").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1); |
299 query.first(); |
299 query.first(); |
300 for (int i = 0; i < query.size(); i++) { |
300 for (int i = 0; i < query.size(); i++) { |
301 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
301 painter.fillRect( 20, y, 715, 20, (i % 2) ? c_line1:c_line2); |
302 painter.drawText( 20, y+4, 180, 20, Qt::AlignLeft, query.value(0).toString()); |
302 painter.drawText( 20, y+4, 180, 20, Qt::AlignLeft, query.value(0).toString()); |
303 painter.drawText(200, y+4, 230, 20, Qt::AlignLeft, query.value(5).toString()); |
303 painter.drawText(200, y+4, 230, 20, Qt::AlignLeft, query.value(5).toString()); |
304 painter.drawText(430, y+4, 80, 20, Qt::AlignCenter, yeast_types[query.value(1).toInt()]); |
304 painter.drawText(430, y+4, 80, 20, Qt::AlignCenter, QCoreApplication::translate("YeastType", g_yeast_types[query.value(1).toInt()])); |
305 painter.drawText(510, y+4, 80, 20, Qt::AlignCenter, yeast_forms[query.value(2).toInt()]); |
305 painter.drawText(510, y+4, 80, 20, Qt::AlignCenter, QCoreApplication::translate("YeastForm", g_yeast_forms[query.value(2).toInt()])); |
306 |
306 |
307 if (query.value(2).toInt() == 0) |
307 if (query.value(2).toInt() == 0) |
308 w = QString("%1 %2").arg(query.value(3).toDouble(), 10, 'f', 1).arg(y_unit[query.value(2).toInt()]); |
308 w = QString("%1 %2").arg(query.value(3).toDouble(), 10, 'f', 1).arg(y_unit[query.value(2).toInt()]); |
309 else |
309 else |
310 w = QString("%1 %2").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1).arg(y_unit[query.value(2).toInt()]); |
310 w = QString("%1 %2").arg(query.value(3).toDouble() * 1000.0, 10, 'f', 1).arg(y_unit[query.value(2).toInt()]); |
326 painter.drawText( 20, y+4, 715, 20, Qt::AlignCenter, tr("Recipe overview")); |
326 painter.drawText( 20, y+4, 715, 20, Qt::AlignCenter, tr("Recipe overview")); |
327 y += 20; |
327 y += 20; |
328 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
328 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
329 painter.fillRect( 20, y, 330, 20, c_line1); |
329 painter.fillRect( 20, y, 330, 20, c_line1); |
330 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Brew type")); |
330 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Brew type")); |
331 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, recipe_types[recipe->type]); |
331 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, QCoreApplication::translate("Recipe_type", g_recipe_types[recipe->type])); |
332 painter.fillRect(405, y, 330, 20, c_line1); |
332 painter.fillRect(405, y, 330, 20, c_line1); |
333 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Efficiency")); |
333 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Efficiency")); |
334 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 %").arg(recipe->efficiency, 1, 'f', 1)); |
334 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 %").arg(recipe->efficiency, 1, 'f', 1)); |
335 y += 20; |
335 y += 20; |
336 painter.fillRect( 20, y, 330, 20, c_line1); |
336 painter.fillRect( 20, y, 330, 20, c_line1); |
390 for (int i = 0; i < recipe->fermentables.size(); i++) { |
390 for (int i = 0; i < recipe->fermentables.size(); i++) { |
391 double cost = recipe->fermentables.at(i).amount * recipe->fermentables.at(i).cost; |
391 double cost = recipe->fermentables.at(i).amount * recipe->fermentables.at(i).cost; |
392 cost_fermentables += cost; |
392 cost_fermentables += cost; |
393 |
393 |
394 if (recipe->fermentables.at(i).type == 0) |
394 if (recipe->fermentables.at(i).type == 0) |
395 soort = fermentable_graintypes[recipe->fermentables.at(i).graintype]; |
395 soort = QCoreApplication::translate("FermentableGraintype", g_fermentable_graintypes[recipe->fermentables.at(i).graintype]); |
396 else |
396 else |
397 soort = fermentable_types[recipe->fermentables.at(i).type]; |
397 soort = QCoreApplication::translate("FermentableType", g_fermentable_types[recipe->fermentables.at(i).type]); |
398 |
398 |
399 if (recipe->fermentables.at(i).amount > 100) |
399 if (recipe->fermentables.at(i).amount > 100) |
400 amount = QString("%1 kg").arg(recipe->fermentables.at(i).amount, 1, 'f', 1); |
400 amount = QString("%1 kg").arg(recipe->fermentables.at(i).amount, 1, 'f', 1); |
401 else if (recipe->fermentables.at(i).amount > 10) |
401 else if (recipe->fermentables.at(i).amount > 10) |
402 amount = QString("%1 kg").arg(recipe->fermentables.at(i).amount, 1, 'f', 2); |
402 amount = QString("%1 kg").arg(recipe->fermentables.at(i).amount, 1, 'f', 2); |
409 QString(", %1 EBC (").arg(recipe->fermentables.at(i).color, 1, 'f', 0) + |
409 QString(", %1 EBC (").arg(recipe->fermentables.at(i).color, 1, 'f', 0) + |
410 recipe->fermentables.at(i).supplier + ")"); |
410 recipe->fermentables.at(i).supplier + ")"); |
411 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->fermentables.at(i).percentage, 1, 'f', 1)); |
411 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->fermentables.at(i).percentage, 1, 'f', 1)); |
412 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->fermentables.at(i).yield, 1, 'f', 1)); |
412 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->fermentables.at(i).yield, 1, 'f', 1)); |
413 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, soort); |
413 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, soort); |
414 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, fermentable_added[recipe->fermentables.at(i).added]); |
414 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("FermentableAdded", g_fermentable_added[recipe->fermentables.at(i).added])); |
415 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
415 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
416 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
416 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
417 y += 20; |
417 y += 20; |
418 } |
418 } |
419 painter.fillRect(670, y, 60, 20, c_line1); |
419 painter.fillRect(670, y, 60, 20, c_line1); |
440 double ibu = Utils::toIBU(recipe->hops.at(i).useat, recipe->hops.at(i).form, recipe->preboil_sg, recipe->batch_size, |
440 double ibu = Utils::toIBU(recipe->hops.at(i).useat, recipe->hops.at(i).form, recipe->preboil_sg, recipe->batch_size, |
441 recipe->hops.at(i).amount, recipe->hops.at(i).time, recipe->hops.at(i).alpha, |
441 recipe->hops.at(i).amount, recipe->hops.at(i).time, recipe->hops.at(i).alpha, |
442 recipe->ibu_method, 0, recipe->hops.at(i).time, 0, recipe->boil_time); |
442 recipe->ibu_method, 0, recipe->hops.at(i).time, 0, recipe->boil_time); |
443 |
443 |
444 if (recipe->hops.at(i).useat == 2 || recipe->hops.at(i).useat == 4) // Boil or Whirlpool |
444 if (recipe->hops.at(i).useat == 2 || recipe->hops.at(i).useat == 4) // Boil or Whirlpool |
445 use = hop_useat[recipe->hops.at(i).useat] + QString(" %1 min").arg(recipe->hops.at(i).time); |
445 use = QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]) + QString(" %1 min").arg(recipe->hops.at(i).time); |
446 else if (recipe->hops.at(i).useat == 5) // Dryhop |
446 else if (recipe->hops.at(i).useat == 5) // Dryhop |
447 use = hop_useat[recipe->hops.at(i).useat] + QString(" %1 days").arg(recipe->hops.at(i).time / 1440); |
447 use = QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]) + QString(" %1 days").arg(recipe->hops.at(i).time / 1440); |
448 else |
448 else |
449 use = hop_useat[recipe->hops.at(i).useat]; |
449 use = QCoreApplication::translate("HopUse", g_hop_useat[recipe->hops.at(i).useat]); |
450 |
450 |
451 if (recipe->hops.at(i).amount > 1) |
451 if (recipe->hops.at(i).amount > 1) |
452 amount = QString("%1 kg").arg(recipe->hops.at(i).amount, 1, 'f', 3); |
452 amount = QString("%1 kg").arg(recipe->hops.at(i).amount, 1, 'f', 3); |
453 else |
453 else |
454 amount = QString("%1 gr").arg(recipe->hops.at(i).amount * 1000, 1, 'f', 1); |
454 amount = QString("%1 gr").arg(recipe->hops.at(i).amount * 1000, 1, 'f', 1); |
455 |
455 |
456 painter.fillRect( 20, y, 715, 20, h_line); |
456 painter.fillRect( 20, y, 715, 20, h_line); |
457 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, recipe->hops.at(i).name + " (" + recipe->hops.at(i).origin + ")"); |
457 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, recipe->hops.at(i).name + " (" + recipe->hops.at(i).origin + ")"); |
458 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->hops.at(i).alpha, 1, 'f', 1)); |
458 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->hops.at(i).alpha, 1, 'f', 1)); |
459 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1").arg(ibu, 1, 'f', 1)); |
459 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1").arg(ibu, 1, 'f', 1)); |
460 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, hop_forms[recipe->hops.at(i).form]); |
460 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("HopForm", g_hop_forms[recipe->hops.at(i).form])); |
461 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
461 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
462 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
462 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
463 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
463 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
464 y += 20; |
464 y += 20; |
465 } |
465 } |
493 painter.fillRect( 20, y, 715, 20, y_line); |
493 painter.fillRect( 20, y, 715, 20, y_line); |
494 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, recipe->yeasts.at(i).laboratory + " " + |
494 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, recipe->yeasts.at(i).laboratory + " " + |
495 recipe->yeasts.at(i).product_id + " (" + |
495 recipe->yeasts.at(i).product_id + " (" + |
496 recipe->yeasts.at(i).name + ")"); |
496 recipe->yeasts.at(i).name + ")"); |
497 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->yeasts.at(i).attenuation, 1, 'f', 1)); |
497 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(recipe->yeasts.at(i).attenuation, 1, 'f', 1)); |
498 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, yeast_forms[recipe->yeasts.at(i).form]); |
498 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("YeastForm", g_yeast_forms[recipe->yeasts.at(i).form])); |
499 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, yeast_use[recipe->yeasts.at(i).use]); |
499 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("YeastUse", g_yeast_use[recipe->yeasts.at(i).use])); |
500 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
500 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
501 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
501 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
502 y += 20; |
502 y += 20; |
503 } |
503 } |
504 painter.fillRect(670, y, 60, 20, c_line1); |
504 painter.fillRect(670, y, 60, 20, c_line1); |
526 for (int i = 0; i < recipe->miscs.size(); i++) { |
526 for (int i = 0; i < recipe->miscs.size(); i++) { |
527 double cost = recipe->miscs.at(i).amount * recipe->miscs.at(i).cost; |
527 double cost = recipe->miscs.at(i).amount * recipe->miscs.at(i).cost; |
528 cost_miscs += cost; |
528 cost_miscs += cost; |
529 |
529 |
530 if (recipe->miscs.at(i).use_use == 2) |
530 if (recipe->miscs.at(i).use_use == 2) |
531 use = misc_uses[recipe->miscs.at(i).use_use] + QString(" %1 min").arg(recipe->miscs.at(i).time); |
531 use = QCoreApplication::translate("MiscUse", g_misc_uses[recipe->miscs.at(i).use_use]) + QString(" %1 min").arg(recipe->miscs.at(i).time); |
532 else |
532 else |
533 use = misc_uses[recipe->miscs.at(i).use_use]; |
533 use = QCoreApplication::translate("MiscUse", g_misc_uses[recipe->miscs.at(i).use_use]); |
534 |
534 |
535 if (recipe->miscs.at(i).type == 4) // Water agent |
535 if (recipe->miscs.at(i).type == 4) // Water agent |
536 painter.fillRect( 20, y, 715, 20, mw_line); |
536 painter.fillRect( 20, y, 715, 20, mw_line); |
537 else if (recipe->miscs.at(i).type == 3) // Fining |
537 else if (recipe->miscs.at(i).type == 3) // Fining |
538 painter.fillRect( 20, y, 715, 20, mf_line); |
538 painter.fillRect( 20, y, 715, 20, mf_line); |
539 else if (recipe->miscs.at(i).type < 3 || recipe->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
539 else if (recipe->miscs.at(i).type < 3 || recipe->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
540 painter.fillRect( 20, y, 715, 20, ms_line); |
540 painter.fillRect( 20, y, 715, 20, ms_line); |
541 else |
541 else |
542 painter.fillRect( 20, y, 715, 20, mo_line); |
542 painter.fillRect( 20, y, 715, 20, mo_line); |
543 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).name); |
543 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, recipe->miscs.at(i).name); |
544 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[recipe->miscs.at(i).type]); |
544 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[recipe->miscs.at(i).type])); |
545 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
545 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
546 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
546 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
547 QString("%1 %2").arg(recipe->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(recipe->miscs.at(i).amount_is_weight ? "gr":"ml")); |
547 QString("%1 %2").arg(recipe->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(recipe->miscs.at(i).amount_is_weight ? "gr":"ml")); |
548 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
548 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
549 y += 20; |
549 y += 20; |
574 y += 20; |
574 y += 20; |
575 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
575 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
576 for (int i = 0; i < recipe->mashs.size(); i++) { |
576 for (int i = 0; i < recipe->mashs.size(); i++) { |
577 painter.fillRect( 20, y, 715, 20, line); |
577 painter.fillRect( 20, y, 715, 20, line); |
578 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, recipe->mashs.at(i).step_name); |
578 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, recipe->mashs.at(i).step_name); |
579 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[recipe->mashs.at(i).step_type]); |
579 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("StepType", g_step_types[recipe->mashs.at(i).step_type])); |
580 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_temp, 1, 'f', 1)); |
580 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_temp, 1, 'f', 1)); |
581 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).end_temp, 1, 'f', 1)); |
581 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).end_temp, 1, 'f', 1)); |
582 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_time, 1, 'f', 0)); |
582 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_time, 1, 'f', 0)); |
583 painter.drawText(455, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).ramp_time, 1, 'f', 0)); |
583 painter.drawText(455, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).ramp_time, 1, 'f', 0)); |
584 painter.drawText(520, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_wg_ratio, 1, 'f', 2)); |
584 painter.drawText(520, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(recipe->mashs.at(i).step_wg_ratio, 1, 'f', 2)); |
702 painter.drawText( 20, y+4, 715, 20, Qt::AlignCenter, tr("Product overview")); |
702 painter.drawText( 20, y+4, 715, 20, Qt::AlignCenter, tr("Product overview")); |
703 y += 20; |
703 y += 20; |
704 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
704 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
705 painter.fillRect( 20, y, 330, 20, c_line1); |
705 painter.fillRect( 20, y, 330, 20, c_line1); |
706 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Brew type")); |
706 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Brew type")); |
707 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, recipe_types[product->type]); |
707 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, QCoreApplication::translate("RecipeType", g_recipe_types[product->type])); |
708 painter.fillRect(405, y, 330, 20, c_line1); |
708 painter.fillRect(405, y, 330, 20, c_line1); |
709 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Efficiency")); |
709 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Efficiency")); |
710 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 %").arg(product->efficiency, 1, 'f', 1)); |
710 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 %").arg(product->efficiency, 1, 'f', 1)); |
711 y += 20; |
711 y += 20; |
712 painter.fillRect( 20, y, 330, 20, c_line1); |
712 painter.fillRect( 20, y, 330, 20, c_line1); |
755 painter.fillRect( 20, y, 330, 20, c_line1); |
755 painter.fillRect( 20, y, 330, 20, c_line1); |
756 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Beer style")); |
756 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Beer style")); |
757 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, product->st_name); |
757 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, product->st_name); |
758 painter.fillRect(405, y, 330, 20, c_line1); |
758 painter.fillRect(405, y, 330, 20, c_line1); |
759 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Stage")); |
759 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Stage")); |
760 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, prod_stages[product->stage]); |
760 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QCoreApplication::translate("ProdStages", g_prod_stages[product->stage])); |
761 if (product->divide_parts) { |
761 if (product->divide_parts) { |
762 y += 20; |
762 y += 20; |
763 painter.fillRect( 20, y, 330, 20, c_line1); |
763 painter.fillRect( 20, y, 330, 20, c_line1); |
764 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Split batch")); |
764 painter.drawText( 20, y+4, 150, 20, Qt::AlignLeft, tr("Split batch")); |
765 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, prod_split[product->divide_type]); |
765 painter.drawText(170, y+4, 180, 20, Qt::AlignLeft, QCoreApplication::translate("Splitter", g_prod_split[product->divide_type])); |
766 painter.fillRect(405, y, 330, 20, c_line1); |
766 painter.fillRect(405, y, 330, 20, c_line1); |
767 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Batch number")); |
767 painter.drawText(405, y+4, 150, 20, Qt::AlignLeft, tr("Batch number")); |
768 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 of %2").arg(product->divide_part + 1).arg(product->divide_parts + 1)); |
768 painter.drawText(555, y+4, 180, 20, Qt::AlignLeft, QString("%1 of %2").arg(product->divide_part + 1).arg(product->divide_parts + 1)); |
769 } |
769 } |
770 y += 40; |
770 y += 40; |
787 for (int i = 0; i < product->fermentables.size(); i++) { |
787 for (int i = 0; i < product->fermentables.size(); i++) { |
788 double cost = product->fermentables.at(i).amount * product->fermentables.at(i).cost; |
788 double cost = product->fermentables.at(i).amount * product->fermentables.at(i).cost; |
789 cost_fermentables += cost; |
789 cost_fermentables += cost; |
790 |
790 |
791 if (product->fermentables.at(i).type == 0) |
791 if (product->fermentables.at(i).type == 0) |
792 soort = fermentable_graintypes[product->fermentables.at(i).graintype]; |
792 soort = QCoreApplication::translate("FermentableGraintype", g_fermentable_graintypes[product->fermentables.at(i).graintype]); |
793 else |
793 else |
794 soort = fermentable_types[product->fermentables.at(i).type]; |
794 soort = QCoreApplication::translate("FermentableType", g_fermentable_types[product->fermentables.at(i).type]); |
795 |
795 |
796 if (product->fermentables.at(i).amount > 100) |
796 if (product->fermentables.at(i).amount > 100) |
797 amount = QString("%1 kg").arg(product->fermentables.at(i).amount, 1, 'f', 1); |
797 amount = QString("%1 kg").arg(product->fermentables.at(i).amount, 1, 'f', 1); |
798 else if (product->fermentables.at(i).amount > 10) |
798 else if (product->fermentables.at(i).amount > 10) |
799 amount = QString("%1 kg").arg(product->fermentables.at(i).amount, 1, 'f', 2); |
799 amount = QString("%1 kg").arg(product->fermentables.at(i).amount, 1, 'f', 2); |
809 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->fermentables.at(i).percentage, 1, 'f', 1)); |
809 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->fermentables.at(i).percentage, 1, 'f', 1)); |
810 else |
810 else |
811 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, ""); |
811 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, ""); |
812 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->fermentables.at(i).yield, 1, 'f', 1)); |
812 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->fermentables.at(i).yield, 1, 'f', 1)); |
813 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, soort); |
813 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, soort); |
814 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, fermentable_added[product->fermentables.at(i).added]); |
814 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("FermentableAdded", g_fermentable_added[product->fermentables.at(i).added])); |
815 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
815 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
816 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
816 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
817 y += 20; |
817 y += 20; |
818 } |
818 } |
819 painter.fillRect(670, y, 60, 20, c_line1); |
819 painter.fillRect(670, y, 60, 20, c_line1); |
840 double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size, |
840 double ibu = Utils::toIBU(product->hops.at(i).useat, product->hops.at(i).form, product->preboil_sg, product->batch_size, |
841 product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, |
841 product->hops.at(i).amount, product->hops.at(i).time, product->hops.at(i).alpha, |
842 product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time); |
842 product->ibu_method, product->brew_whirlpool9, product->brew_whirlpool7, product->brew_whirlpool6, product->boil_time); |
843 |
843 |
844 if (product->hops.at(i).useat == 2 || product->hops.at(i).useat == 4) // Boil or Whirlpool |
844 if (product->hops.at(i).useat == 2 || product->hops.at(i).useat == 4) // Boil or Whirlpool |
845 use = hop_useat[product->hops.at(i).useat] + QString(" %1 min").arg(product->hops.at(i).time); |
845 use = QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + QString(" %1 min").arg(product->hops.at(i).time); |
846 else if (product->hops.at(i).useat == 5) // Dryhop |
846 else if (product->hops.at(i).useat == 5) // Dryhop |
847 use = hop_useat[product->hops.at(i).useat] + QString(" %1 days").arg(product->hops.at(i).time / 1440); |
847 use = QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]) + QString(" %1 days").arg(product->hops.at(i).time / 1440); |
848 else |
848 else |
849 use = hop_useat[product->hops.at(i).useat]; |
849 use = QCoreApplication::translate("HopUse", g_hop_useat[product->hops.at(i).useat]); |
850 |
850 |
851 if (product->hops.at(i).amount > 1) |
851 if (product->hops.at(i).amount > 1) |
852 amount = QString("%1 kg").arg(product->hops.at(i).amount, 1, 'f', 3); |
852 amount = QString("%1 kg").arg(product->hops.at(i).amount, 1, 'f', 3); |
853 else |
853 else |
854 amount = QString("%1 gr").arg(product->hops.at(i).amount * 1000, 1, 'f', 1); |
854 amount = QString("%1 gr").arg(product->hops.at(i).amount * 1000, 1, 'f', 1); |
855 |
855 |
856 painter.fillRect( 20, y, 715, 20, h_line); |
856 painter.fillRect( 20, y, 715, 20, h_line); |
857 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, product->hops.at(i).name + " (" + product->hops.at(i).origin + ")"); |
857 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, product->hops.at(i).name + " (" + product->hops.at(i).origin + ")"); |
858 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->hops.at(i).alpha, 1, 'f', 1)); |
858 painter.drawText(285, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->hops.at(i).alpha, 1, 'f', 1)); |
859 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1").arg(ibu, 1, 'f', 1)); |
859 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1").arg(ibu, 1, 'f', 1)); |
860 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, hop_forms[product->hops.at(i).form]); |
860 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("HopForm", g_hop_forms[product->hops.at(i).form])); |
861 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
861 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
862 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
862 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
863 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
863 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
864 y += 20; |
864 y += 20; |
865 } |
865 } |
893 painter.fillRect( 20, y, 715, 20, y_line); |
893 painter.fillRect( 20, y, 715, 20, y_line); |
894 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, product->yeasts.at(i).laboratory + " " + |
894 painter.drawText( 20, y+4, 260, 20, Qt::AlignLeft, product->yeasts.at(i).laboratory + " " + |
895 product->yeasts.at(i).product_id + " (" + |
895 product->yeasts.at(i).product_id + " (" + |
896 product->yeasts.at(i).name + ")"); |
896 product->yeasts.at(i).name + ")"); |
897 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->yeasts.at(i).attenuation, 1, 'f', 1)); |
897 painter.drawText(360, y+4, 70, 20, Qt::AlignRight, QString("%1%").arg(product->yeasts.at(i).attenuation, 1, 'f', 1)); |
898 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, yeast_forms[product->yeasts.at(i).form]); |
898 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("YeastForm", g_yeast_forms[product->yeasts.at(i).form])); |
899 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, yeast_use[product->yeasts.at(i).use]); |
899 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("YeastUse", g_yeast_use[product->yeasts.at(i).use])); |
900 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
900 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, amount); |
901 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
901 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
902 y += 20; |
902 y += 20; |
903 } |
903 } |
904 if (product->starter_enable && product->prop_volume[0]) { |
904 if (product->starter_enable && product->prop_volume[0]) { |
942 for (int i = 0; i < product->miscs.size(); i++) { |
942 for (int i = 0; i < product->miscs.size(); i++) { |
943 double cost = product->miscs.at(i).amount * product->miscs.at(i).cost; |
943 double cost = product->miscs.at(i).amount * product->miscs.at(i).cost; |
944 cost_miscs += cost; |
944 cost_miscs += cost; |
945 |
945 |
946 if (product->miscs.at(i).use_use == 2) |
946 if (product->miscs.at(i).use_use == 2) |
947 use = misc_uses[product->miscs.at(i).use_use] + QString(" %1 min").arg(product->miscs.at(i).time); |
947 use = QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]) + QString(" %1 min").arg(product->miscs.at(i).time); |
948 else |
948 else |
949 use = misc_uses[product->miscs.at(i).use_use]; |
949 use = QCoreApplication::translate("MiscUse", g_misc_uses[product->miscs.at(i).use_use]); |
950 |
950 |
951 if (product->miscs.at(i).type == 4) // Water agent |
951 if (product->miscs.at(i).type == 4) // Water agent |
952 painter.fillRect( 20, y, 715, 20, mw_line); |
952 painter.fillRect( 20, y, 715, 20, mw_line); |
953 else if (product->miscs.at(i).type == 3) // Fining |
953 else if (product->miscs.at(i).type == 3) // Fining |
954 painter.fillRect( 20, y, 715, 20, mf_line); |
954 painter.fillRect( 20, y, 715, 20, mf_line); |
955 else if (product->miscs.at(i).type < 3 || product->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
955 else if (product->miscs.at(i).type < 3 || product->miscs.at(i).type == 5) // Spice, Herb, Flavour, Yeast nutrient |
956 painter.fillRect( 20, y, 715, 20, ms_line); |
956 painter.fillRect( 20, y, 715, 20, ms_line); |
957 else |
957 else |
958 painter.fillRect( 20, y, 715, 20, mo_line); |
958 painter.fillRect( 20, y, 715, 20, mo_line); |
959 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).name); |
959 painter.drawText( 20, y+4, 410, 20, Qt::AlignLeft, product->miscs.at(i).name); |
960 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, misc_types[product->miscs.at(i).type]); |
960 painter.drawText(435, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("MiscType", g_misc_types[product->miscs.at(i).type])); |
961 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
961 painter.drawText(520, y+4, 80, 20, Qt::AlignLeft, use); |
962 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
962 painter.drawText(605, y+4, 60, 20, Qt::AlignRight, |
963 QString("%1 %2").arg(product->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(product->miscs.at(i).amount_is_weight ? "gr":"ml")); |
963 QString("%1 %2").arg(product->miscs.at(i).amount * 1000.0, 1, 'f', 1).arg(product->miscs.at(i).amount_is_weight ? "gr":"ml")); |
964 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
964 painter.drawText(670, y+4, 60, 20, Qt::AlignRight, QString("%1 €").arg(cost, 1, 'f', 3)); |
965 y += 20; |
965 y += 20; |
990 y += 20; |
990 y += 20; |
991 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
991 painter.setFont(QFont("Helvetica", 9, QFont::Normal)); |
992 for (int i = 0; i < product->mashs.size(); i++) { |
992 for (int i = 0; i < product->mashs.size(); i++) { |
993 painter.fillRect( 20, y, 715, 20, line); |
993 painter.fillRect( 20, y, 715, 20, line); |
994 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
994 painter.drawText( 20, y+4, 160, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
995 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, step_types[product->mashs.at(i).step_type]); |
995 painter.drawText(180, y+4, 80, 20, Qt::AlignLeft, QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type])); |
996 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_temp, 1, 'f', 1)); |
996 painter.drawText(260, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_temp, 1, 'f', 1)); |
997 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
997 painter.drawText(325, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
998 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
998 painter.drawText(390, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
999 painter.drawText(455, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).ramp_time, 1, 'f', 0)); |
999 painter.drawText(455, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).ramp_time, 1, 'f', 0)); |
1000 painter.drawText(520, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_wg_ratio, 1, 'f', 2)); |
1000 painter.drawText(520, y+4, 60, 20, Qt::AlignRight, QString("%1").arg(product->mashs.at(i).step_wg_ratio, 1, 'f', 2)); |
1147 y += 20; |
1147 y += 20; |
1148 for (int i = 0; i < product->mashs.size(); i++) { |
1148 for (int i = 0; i < product->mashs.size(); i++) { |
1149 painter.fillRect( 20, y, 715, 20, c_line1); |
1149 painter.fillRect( 20, y, 715, 20, c_line1); |
1150 painter.drawText( 20, y+4, 20, 20, Qt::AlignCenter, QString("%1").arg(i + 1)); |
1150 painter.drawText( 20, y+4, 20, 20, Qt::AlignCenter, QString("%1").arg(i + 1)); |
1151 painter.drawText( 40, y+4, 250, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
1151 painter.drawText( 40, y+4, 250, 20, Qt::AlignLeft, product->mashs.at(i).step_name); |
1152 painter.drawText(290, y+4, 120, 20, Qt::AlignLeft, step_types[product->mashs.at(i).step_type]); |
1152 painter.drawText(290, y+4, 120, 20, Qt::AlignLeft, QCoreApplication::translate("StepType", g_step_types[product->mashs.at(i).step_type])); |
1153 painter.drawText(400, y+4, 110, 20, Qt::AlignLeft, QString("%1 - %2°C"). |
1153 painter.drawText(400, y+4, 110, 20, Qt::AlignLeft, QString("%1 - %2°C"). |
1154 arg(product->mashs.at(i).step_temp, 1, 'f', 1).arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
1154 arg(product->mashs.at(i).step_temp, 1, 'f', 1).arg(product->mashs.at(i).end_temp, 1, 'f', 1)); |
1155 painter.drawText(510, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
1155 painter.drawText(510, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_time, 1, 'f', 0)); |
1156 painter.drawText(585, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_sg, 1, 'f', 3)); |
1156 painter.drawText(585, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_sg, 1, 'f', 3)); |
1157 painter.drawText(660, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_ph, 1, 'f', 1)); |
1157 painter.drawText(660, y+4, 75, 20, Qt::AlignLeft, QString("%1").arg(product->mashs.at(i).step_ph, 1, 'f', 1)); |
2130 bool PrinterDialog::checkSplit(QPainter *painter, qreal *y, int moment) |
2130 bool PrinterDialog::checkSplit(QPainter *painter, qreal *y, int moment) |
2131 { |
2131 { |
2132 if (product->divide_type && product->divide_type == moment) { |
2132 if (product->divide_type && product->divide_type == moment) { |
2133 *y += 20; |
2133 *y += 20; |
2134 painter->setFont(QFont("Helvetica", 14, QFont::Bold)); |
2134 painter->setFont(QFont("Helvetica", 14, QFont::Bold)); |
2135 painter->drawText(20, *y, 715, 20, Qt::AlignCenter, QString(tr("%1 split the batch here!")).arg(prod_split[product->divide_type])); |
2135 painter->drawText(20, *y, 715, 20, Qt::AlignCenter, |
|
2136 QString(tr("%1 split the batch here!")).arg(QCoreApplication::translate("Splitter", g_prod_split[product->divide_type]))); |
2136 painter->setFont(QFont("Arial", 10, QFont::Normal)); |
2137 painter->setFont(QFont("Arial", 10, QFont::Normal)); |
2137 *y += 26; |
2138 *y += 26; |
2138 return true; |
2139 return true; |
2139 } |
2140 } |
2140 return false; |
2141 return false; |