src/EditProductTab12.cpp

Fri, 20 May 2022 20:43:33 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Fri, 20 May 2022 20:43:33 +0200
changeset 225
448e4187cada
parent 175
f1ed3a2a94e9
permissions
-rw-r--r--

Implemented the tasting tab. On the generic tab, show the ingredients check or the read only prompt on the same place depending on the product stage. Fixed the yeasts ingredients in stock check. Reordered the tab order of all edit fields. It looks like this module is ready and needs testing.

/**
 * EditProduct.cpp is part of bmsapp.
 *
 * Tab 12, taste notes.
 *
 * bmsapp is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * bmsapp is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

void EditProduct::taste_date_changed(QDate val)
{
    product->taste_date = ui->taste_dateEdit->nullDate();
    is_changed();
    setStage();
}


void EditProduct::taste_date_button()
{
    ui->taste_dateEdit->setDate(QDate::currentDate());
}


void EditProduct::taste_date_ack()
{
    int rc = QMessageBox::warning(this, tr("Confirm tasting"), tr("Confirm that the beer tasting is done and the results are filled in."),
                            QMessageBox::Yes | QMessageBox::No, QMessageBox::No);

    if (rc == QMessageBox::No)
        return;

    product->stage = PROD_STAGE_READY;
    setStage();
    is_changed();
}


void EditProduct::taste_rate_changed(double val)
{
    product->taste_rate = val;
    is_changed();
    setStage();
}


void EditProduct::taste_color_changed(QString val)
{
    product->taste_color = val;
    is_changed();
    setStage();
}


void EditProduct::taste_transparency_changed(QString val)
{
    product->taste_transparency = val;
    is_changed();
    setStage();
}


void EditProduct::taste_head_changed(QString val)
{
    product->taste_head = val;
    is_changed();
    setStage();
}


void EditProduct::taste_aroma_changed(QString val)
{
    product->taste_aroma = val;
    is_changed();
    setStage();
}


void EditProduct::taste_taste_changed(QString val)
{
    product->taste_taste = val;
    is_changed();
    setStage();
}


void EditProduct::taste_mouthfeel_changed(QString val)
{
    product->taste_mouthfeel = val;
    is_changed();
    setStage();
}


void EditProduct::taste_aftertaste_changed(QString val)
{
    product->taste_aftertaste = val;
    is_changed();
    setStage();
}


void EditProduct::taste_notes_changed()
{
    /* The text cannot be passed in a simple way :) */
    product->taste_notes = ui->taste_notesEdit->toPlainText();
    is_changed();
    setStage();
}

mercurial