src/InventoryHops.cpp

changeset 155
f671c599f65b
parent 90
2396457a8167
child 290
93820a8ffbff
--- a/src/InventoryHops.cpp	Sat Apr 23 13:18:47 2022 +0200
+++ b/src/InventoryHops.cpp	Sat Apr 23 14:06:41 2022 +0200
@@ -18,6 +18,7 @@
 #include "EditHop.h"
 #include "MainWindow.h"
 #include "config.h"
+#include "global.h"
 
 
 InventoryHops::InventoryHops(QWidget *parent) : QDialog(parent)
@@ -100,8 +101,6 @@
 
     QSqlQuery query("SELECT * FROM inventory_hops ORDER BY origin,name");
     const QStringList labels({tr("Origin"), tr("Name"), tr("Type"), tr("Form"), tr("Alpha"), tr("Beta"), tr("Cohumulone"), tr("HSI"), tr("Harvest"), tr("Stock"), tr("Edit")});
-    const QStringList types({tr("Bittering"), tr("Aroma"), tr("Both")});
-    const QStringList form({tr("Pellet"), tr("Plug"), tr("Leaf"), tr("Leaf Wet"), tr("Cryo")});
 
     /* origin supplier name type graintype color yield inventory Edit */
     this->tableHops->setColumnCount(11);
@@ -127,8 +126,8 @@
     for (int ridx = 0 ; ridx < query.size() ; ridx++ ) {
 	this->tableHops->setItem(ridx, 0, new QTableWidgetItem(query.value(12).toString()));	/* Origin */
 	this->tableHops->setItem(ridx, 1, new QTableWidgetItem(query.value(1).toString()));	/* Name	*/
-	this->tableHops->setItem(ridx, 2, new QTableWidgetItem(types[query.value(9).toInt()]));	/* Type */
-	this->tableHops->setItem(ridx, 3, new QTableWidgetItem(form[query.value(10).toInt()]));	/* Form */
+	this->tableHops->setItem(ridx, 2, new QTableWidgetItem(hop_types[query.value(9).toInt()]));	/* Type */
+	this->tableHops->setItem(ridx, 3, new QTableWidgetItem(hop_forms[query.value(10).toInt()]));	/* Form */
 	w = QString("%1 %").arg(query.value(2).toDouble(), 2, 'f', 1, '0' );	/* Alpha% */
 	QTableWidgetItem *item = new QTableWidgetItem(w);
         item->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);

mercurial