src/PrinterDialog.cpp

changeset 341
1b1e2d4c1a3e
parent 340
b9af88bfe972
child 364
1efe29f64551
equal deleted inserted replaced
340:b9af88bfe972 341:1b1e2d4c1a3e
66 const QColor line( 175, 175, 255, 255); // also y_line 66 const QColor line( 175, 175, 255, 255); // also y_line
67 const QColor w_line( 120, 255, 250, 255); 67 const QColor w_line( 120, 255, 250, 255);
68 68
69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")}); 69 const QStringList y_unit({tr("pkg"), tr("gr"), tr("ml"), tr("ml"), tr("ml"), tr("ml"), tr("gr")});
70 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" }); 70 const QStringList color_method({ "Morey", "Mosher", "Daniels", "Halberstadt", "Naudts" });
71 const QStringList cooling_method({"-", tr("Emersion chiller"), tr("Counterflow chiller"), tr("Au bain marie"), tr("Natural") });
72 71
73 painter.begin(printer); 72 painter.begin(printer);
74 qreal y = 0; 73 qreal y = 0;
75 74
76 if (p_job == PR_SUPPLIES) { 75 if (p_job == PR_SUPPLIES) {
1280 painter.drawText(450, y+4, 200, 20, Qt::AlignLeft, QString("%1 IBU").arg(product->brew_fermenter_ibu, 1, 'f', 0)); 1279 painter.drawText(450, y+4, 200, 20, Qt::AlignLeft, QString("%1 IBU").arg(product->brew_fermenter_ibu, 1, 'f', 0));
1281 painter.drawText(650, y+4, 85, 20, Qt::AlignLeft, strDiff(product->est_ibu, product->brew_fermenter_ibu, 0, " IBU")); 1280 painter.drawText(650, y+4, 85, 20, Qt::AlignLeft, strDiff(product->est_ibu, product->brew_fermenter_ibu, 0, " IBU"));
1282 y += 25; 1281 y += 25;
1283 painter.fillRect( 20, y, 430, 20, c_line1); 1282 painter.fillRect( 20, y, 430, 20, c_line1);
1284 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Cooling method")); 1283 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Cooling method"));
1285 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, cooling_method[product->brew_cooling_method]); 1284 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, QCoreApplication::translate("ChillerType", g_chiller_types[product->brew_cooling_method]));
1286 y += 20; 1285 y += 20;
1287 painter.fillRect( 20, y, 430, 20, c_line1); 1286 painter.fillRect( 20, y, 430, 20, c_line1);
1288 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Cooling temperature")); 1287 painter.drawText( 20, y+4, 230, 20, Qt::AlignLeft, tr("Cooling temperature"));
1289 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, QString("%1°C").arg(product->brew_cooling_to, 1, 'f', 1)); 1288 painter.drawText(250, y+4, 200, 20, Qt::AlignLeft, QString("%1°C").arg(product->brew_cooling_to, 1, 'f', 1));
1290 y += 20; 1289 y += 20;
1720 int lines = 0; 1719 int lines = 0;
1721 if (product->boil_time == 0) { 1720 if (product->boil_time == 0) {
1722 lines = 3; 1721 lines = 3;
1723 } else { 1722 } else {
1724 lines = 5; 1723 lines = 5;
1725 if (product->brew_cooling_method == 1) 1724 if (product->brew_cooling_method == CHILLER_TYPE_EMERSION)
1726 lines++; 1725 lines++;
1727 for (int i = 0; i < product->fermentables.size(); i++) { 1726 for (int i = 0; i < product->fermentables.size(); i++) {
1728 if (product->fermentables.at(i).added == FERMENTABLE_ADDED_BOIL) 1727 if (product->fermentables.at(i).added == FERMENTABLE_ADDED_BOIL)
1729 lines++; 1728 lines++;
1730 } 1729 }
1754 if (product->fermentables.at(j).added == FERMENTABLE_ADDED_BOIL) 1753 if (product->fermentables.at(j).added == FERMENTABLE_ADDED_BOIL)
1755 checkLine(&painter, &y, QString(tr("%1 kg `%2` at 10 minutes before end of boil")) 1754 checkLine(&painter, &y, QString(tr("%1 kg `%2` at 10 minutes before end of boil"))
1756 .arg(product->fermentables.at(j).amount * factor, 1, 'f', 3) 1755 .arg(product->fermentables.at(j).amount * factor, 1, 'f', 3)
1757 .arg(product->fermentables.at(j).name)); 1756 .arg(product->fermentables.at(j).name));
1758 } 1757 }
1759 if (product->brew_cooling_method == 1) 1758 if (product->brew_cooling_method == CHILLER_TYPE_EMERSION)
1760 checkLine(&painter, &y, QString(tr("Place emersion chiller at 10 minutes before end of boil"))); 1759 checkLine(&painter, &y, QString(tr("Place emersion chiller at 10 minutes before end of boil")));
1761 } 1760 }
1762 for (int j = 0; j < product->hops.size(); j++) { 1761 for (int j = 0; j < product->hops.size(); j++) {
1763 if ((product->hops.at(j).useat == HOP_USEAT_BOIL || product->hops.at(j).useat == HOP_USEAT_AROMA) && product->hops.at(j).time == i) { 1762 if ((product->hops.at(j).useat == HOP_USEAT_BOIL || product->hops.at(j).useat == HOP_USEAT_AROMA) && product->hops.at(j).time == i) {
1764 if (i == 0) 1763 if (i == 0)

mercurial