Tue, 31 May 2022 11:42:26 +0200
Added print and export choices popups. Updated translations.
--- a/src/EditProduct.h Tue May 31 09:14:28 2022 +0200 +++ b/src/EditProduct.h Tue May 31 11:42:26 2022 +0200 @@ -8,6 +8,7 @@ #include <QDoubleSpinBox> #include <QCheckBox> #include <QComboBox> +#include <QRadioButton> #include <QLineEdit> #include <QDialogButtonBox> #include <QList> @@ -305,8 +306,6 @@ double CarbCO2ToPressure(double CO2, double T); void calcPack(); void exportBeerXML(); - void printProduct(); - void printChecklist(); }; #endif
--- a/src/EditProductExport.cpp Tue May 31 09:14:28 2022 +0200 +++ b/src/EditProductExport.cpp Tue May 31 11:42:26 2022 +0200 @@ -262,27 +262,87 @@ } -void EditProduct::printProduct() -{ - PrinterDialog(PR_PRODUCT, -1, this); -} - - -void EditProduct::printChecklist() -{ - PrinterDialog(PR_CHECKLIST, -1, this); -} - - void EditProduct::on_exportButton_clicked() { - exportBeerXML(); + QDialog* dialog = new QDialog(this); + dialog->setWindowTitle(tr("Export choices")); + dialog->setObjectName(QString::fromUtf8("Dialog")); + dialog->resize(400, 179); + QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setGeometry(QRect(280, 20, 81, 61)); + buttonBox->setOrientation(Qt::Vertical); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + QRadioButton *beerxmlButton = new QRadioButton(dialog); + beerxmlButton->setObjectName(QString::fromUtf8("beerxmlButton")); + beerxmlButton->setGeometry(QRect(50, 20, 171, 21)); + beerxmlButton->setText(tr("Export to beerXML")); +/* QRadioButton *copy_productButton = new QRadioButton(dialog); + copy_productButton->setObjectName(QString::fromUtf8("copy_productButton")); + copy_productButton->setGeometry(QRect(50, 50, 171, 21)); + copy_productButton->setText(tr("Copy to product")); + QRadioButton *splitButton = new QRadioButton(dialog); + splitButton->setObjectName(QString::fromUtf8("splitButton")); + splitButton->setGeometry(QRect(50, 110, 171, 21)); + splitButton->setText(tr("Split this batch")); + QRadioButton *copy_recipeButton = new QRadioButton(dialog); + copy_recipeButton->setObjectName(QString::fromUtf8("copy_recipeButton")); + copy_recipeButton->setGeometry(QRect(50, 80, 171, 21)); + copy_recipeButton->setText(tr("Copy to recipe")); + QRadioButton *toforumButton = new QRadioButton(dialog); + toforumButton->setObjectName(QString::fromUtf8("toforumButton")); + toforumButton->setGeometry(QRect(50, 140, 171, 21)); + toforumButton->setText(tr("Export to forum")); */ + + QObject::connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); + QObject::connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); + + dialog->setModal(true); + dialog->exec(); + if (dialog->result() == QDialog::Accepted) { + if (beerxmlButton->isChecked()) + exportBeerXML(); + } + + disconnect(buttonBox, nullptr, nullptr, nullptr); } void EditProduct::on_printButton_clicked() { - printChecklist(); + QDialog* dialog = new QDialog(this); + dialog->setWindowTitle(tr("Printer report")); + dialog->setObjectName(QString::fromUtf8("Dialog")); + dialog->resize(400, 101); + QDialogButtonBox *buttonBox = new QDialogButtonBox(dialog); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + buttonBox->setGeometry(QRect(280, 20, 81, 61)); + buttonBox->setOrientation(Qt::Vertical); + buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); + + QRadioButton *recipeButton = new QRadioButton(dialog); + recipeButton->setObjectName(QString::fromUtf8("recipeButton")); + recipeButton->setGeometry(QRect(50, 20, 171, 21)); + recipeButton->setText(tr("Print recipe")); + QRadioButton *checklistButton = new QRadioButton(dialog); + checklistButton->setObjectName(QString::fromUtf8("checklistButton")); + checklistButton->setGeometry(QRect(50, 50, 171, 21)); + checklistButton->setText(tr("Print checklist")); + + QObject::connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept())); + QObject::connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject())); + + dialog->setModal(true); + dialog->exec(); + if (dialog->result() == QDialog::Accepted) { + if (checklistButton->isChecked()) + PrinterDialog(PR_CHECKLIST, -1, this); + if (recipeButton->isChecked()) + PrinterDialog(PR_PRODUCT, -1, this); + } + + disconnect(buttonBox, nullptr, nullptr, nullptr); }
--- a/translations/bmsapp_en.ts Tue May 31 09:14:28 2022 +0200 +++ b/translations/bmsapp_en.ts Tue May 31 11:42:26 2022 +0200 @@ -3480,6 +3480,31 @@ <translation type="unfinished"></translation> </message> <message> + <location filename="../src/EditProductExport.cpp" line="268"/> + <source>Export choices</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="280"/> + <source>Export to beerXML</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="315"/> + <source>Printer report</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="327"/> + <source>Print recipe</source> + <translation type="unfinished"></translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="331"/> + <source>Print checklist</source> + <translation type="unfinished"></translation> + </message> + <message> <location filename="../src/EditProductTab9.cpp" line="103"/> <source>Confirm brew</source> <translation type="unfinished"></translation>
--- a/translations/bmsapp_nl.ts Tue May 31 09:14:28 2022 +0200 +++ b/translations/bmsapp_nl.ts Tue May 31 11:42:26 2022 +0200 @@ -3572,6 +3572,31 @@ <translation>XML uitvoer gereed</translation> </message> <message> + <location filename="../src/EditProductExport.cpp" line="268"/> + <source>Export choices</source> + <translation>Export keuzes</translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="280"/> + <source>Export to beerXML</source> + <translation>Exporteer naar beerXML</translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="315"/> + <source>Printer report</source> + <translation>Print rapporten</translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="327"/> + <source>Print recipe</source> + <translation>Print recept</translation> + </message> + <message> + <location filename="../src/EditProductExport.cpp" line="331"/> + <source>Print checklist</source> + <translation>Print werklijst</translation> + </message> + <message> <location filename="../src/EditProductTab9.cpp" line="103"/> <source>Confirm brew</source> <translation>Bevestig brouwen</translation>