# HG changeset patch # User Michiel Broek # Date 1653990146 -7200 # Node ID 84dc3c1c2d0273ba49964e1d8bbe16670ffc0b00 # Parent 3eabce82353b40d66a39da7cf033689064213719 Added print and export choices popups. Updated translations. diff -r 3eabce82353b -r 84dc3c1c2d02 src/EditProduct.h --- 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 #include #include +#include #include #include #include @@ -305,8 +306,6 @@ double CarbCO2ToPressure(double CO2, double T); void calcPack(); void exportBeerXML(); - void printProduct(); - void printChecklist(); }; #endif diff -r 3eabce82353b -r 84dc3c1c2d02 src/EditProductExport.cpp --- 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); } diff -r 3eabce82353b -r 84dc3c1c2d02 translations/bmsapp_en.ts --- 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 @@ + + Export choices + + + + + Export to beerXML + + + + + Printer report + + + + + Print recipe + + + + + Print checklist + + + Confirm brew diff -r 3eabce82353b -r 84dc3c1c2d02 translations/bmsapp_nl.ts --- 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 @@ XML uitvoer gereed + + Export choices + Export keuzes + + + + Export to beerXML + Exporteer naar beerXML + + + + Printer report + Print rapporten + + + + Print recipe + Print recept + + + + Print checklist + Print werklijst + + Confirm brew Bevestig brouwen