src/InventoryMiscs.cpp

changeset 155
f671c599f65b
parent 90
2396457a8167
child 290
93820a8ffbff
--- a/src/InventoryMiscs.cpp	Sat Apr 23 13:18:47 2022 +0200
+++ b/src/InventoryMiscs.cpp	Sat Apr 23 14:06:41 2022 +0200
@@ -18,6 +18,7 @@
 #include "EditMisc.h"
 #include "MainWindow.h"
 #include "config.h"
+#include "global.h"
 
 
 InventoryMiscs::InventoryMiscs(QWidget *parent) : QDialog(parent)
@@ -99,8 +100,6 @@
 
     QSqlQuery query("SELECT * FROM inventory_miscs ORDER BY name");
     const QStringList labels({tr("Name"), tr("Type"), tr("Use"), tr("Time"), tr("Stock"), tr("Edit")});
-    const QStringList types({tr("Spice"), tr("Herb"), tr("Flavor"), tr("Fining"), tr("Water agent"), tr("Yeast nutrient"), tr("Other")});
-    const QStringList use({tr("Starter"), tr("Mash"), tr("Boil"), tr("Primary"), tr("Secondary"), tr("Bottling")});
 
     /* origin supplier name type graintype color yield inventory Edit */
     this->tableMiscs->setColumnCount(6);
@@ -120,8 +119,8 @@
     query.first();
     for (int ridx = 0 ; ridx < query.size() ; ridx++ ) {
 	this->tableMiscs->setItem(ridx, 0, new QTableWidgetItem(query.value(1).toString()));	/* Name */
-	this->tableMiscs->setItem(ridx, 1, new QTableWidgetItem(types[query.value(2).toInt()]));	/* Type */
-	this->tableMiscs->setItem(ridx, 2, new QTableWidgetItem(use[query.value(3).toInt()]));	/* Use */
+	this->tableMiscs->setItem(ridx, 1, new QTableWidgetItem(misc_types[query.value(2).toInt()]));	/* Type */
+	this->tableMiscs->setItem(ridx, 2, new QTableWidgetItem(misc_uses[query.value(3).toInt()]));	/* Use */
 
 	w = QString("");	/* Use time */
 	if (query.value(4).toInt() > 0) {

mercurial