# HG changeset patch # User Michiel Broek # Date 1674659536 -3600 # Node ID 29487eac1183233c2b54271332dbc5936e8f3633 # Parent 895c5ae1dab1753c52706cef94fc109d2d504688 Fixed replace a yeast field offsets. diff -r 895c5ae1dab1 -r 29487eac1183 src/EditProductTab13.cpp --- a/src/EditProductTab13.cpp Wed Jan 25 13:11:51 2023 +0100 +++ b/src/EditProductTab13.cpp Wed Jan 25 16:12:16 2023 +0100 @@ -365,9 +365,6 @@ if (!file.setFileTime(product->images_list.at(ui->filmStrip->currentRow()).timestamp, QFileDevice::FileAccessTime)) { qWarning() << "Failed to modify access time!"; } -// if (!file.setFileTime(product->images_list.at(ui->filmStrip->currentRow()).timestamp, QFileDevice::FileBirthTime)) { -// qDebug() << "Failed to modify create time!"; -// } file.close(); QMessageBox::information(this, tr("Save File"), tr("Saved %1").arg(product->images_list.at(ui->filmStrip->currentRow()).filename)); } @@ -423,7 +420,6 @@ product->images_list[ui->filmStrip->currentRow()].pic_comment = ui->image_commentEdit->text(); QSqlQuery query; - qDebug() << "piccomment_changed 0"; query.prepare("UPDATE products_pics SET pic_comment=:pic_comment WHERE record=:record"); query.bindValue(":pic_comment", ui->image_commentEdit->text()); query.bindValue(":record", product->images_list.at(ui->filmStrip->currentRow()).record); @@ -434,7 +430,6 @@ QMessageBox::warning(this, tr("Database error"), tr("MySQL error: %1\n%2\n%3") .arg(query.lastError().nativeErrorCode()).arg(query.lastError().driverText()).arg(query.lastError().databaseText())); } - qDebug() << "piccomment_changed 3"; } diff -r 895c5ae1dab1 -r 29487eac1183 src/EditProductTab6.cpp --- a/src/EditProductTab6.cpp Wed Jan 25 13:11:51 2023 +0100 +++ b/src/EditProductTab6.cpp Wed Jan 25 16:12:16 2023 +0100 @@ -1059,6 +1059,20 @@ item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); ui->yeastsTable->setItem(product->yeasts_row, 8, item); + if (product->yeasts.at(product->yeasts_row).use != YEAST_USE_BOTTLE && product->yeasts.at(product->yeasts_row).sta1) { + QWidget *pWidget = new QWidget(); + QLabel *label = new QLabel; + label->setPixmap(QPixmap(":icons/silk/tick.png")); + QHBoxLayout *pLayout = new QHBoxLayout(pWidget); + pLayout->addWidget(label); + pLayout->setAlignment(Qt::AlignCenter); + pLayout->setContentsMargins(0, 0, 0, 0); + pWidget->setLayout(pLayout); + ui->yeastsTable->setCellWidget(product->yeasts_row, 9, pWidget); + } else { + ui->yeastsTable->removeCellWidget(product->yeasts_row, 9); + } + if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_LIQUID) item = new QTableWidgetItem(QString("%1 pack").arg(product->yeasts.at(product->yeasts_row).amount, 1, 'f', 0, '0')); else if (product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRY || product->yeasts.at(product->yeasts_row).form == YEAST_FORMS_DRIED) @@ -1066,7 +1080,7 @@ else item = new QTableWidgetItem(QString("%1 ml").arg(product->yeasts.at(product->yeasts_row).amount * 1000.0, 3, 'f', 2, '0')); item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter); - ui->yeastsTable->setItem(product->yeasts_row, 9, item); + ui->yeastsTable->setItem(product->yeasts_row, 10, item); /* * If there is no need for a starter, wipe it.