Fixed replace a yeast field offsets.

Wed, 25 Jan 2023 16:12:16 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 25 Jan 2023 16:12:16 +0100
changeset 476
29487eac1183
parent 475
895c5ae1dab1
child 477
27e179759bf2

Fixed replace a yeast field offsets.

src/EditProductTab13.cpp file | annotate | diff | comparison | revisions
src/EditProductTab6.cpp file | annotate | diff | comparison | revisions
--- 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";
 }
 
 
--- 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.

mercurial