src/EditProductTab12.cpp

Mon, 06 Jun 2022 17:15:27 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 06 Jun 2022 17:15:27 +0200
changeset 260
42b88d85fefc
parent 225
448e4187cada
permissions
-rw-r--r--

Fix default divide_size field in products. Update miscs table column 6 and 7 tooltips and display of the buttons after sort. After a new misc product is selected, update the current row index because the row may be moved. Fix some display misc values in the checklist, they were not multiplied by 1000. Fix display of some bars if the value was 24.

/**
 * 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