diff --git a/Kooky/Kooky.pro b/Kooky/Kooky.pro
index 58b072d..30d6162 100644
--- a/Kooky/Kooky.pro
+++ b/Kooky/Kooky.pro
@@ -25,7 +25,8 @@ SOURCES += main.cpp\
cmessageanimatedialog.cpp \
cplugininfo.cpp \
csplashscreen.cpp \
- cingredientwindow.cpp
+ cingredientwindow.cpp \
+ cingredientvalue.cpp
HEADERS += cmainwindow.h \
cimportinterface.h \
@@ -41,7 +42,8 @@ HEADERS += cmainwindow.h \
cplugininfo.h \
typedef.h \
csplashscreen.h \
- cingredientwindow.h
+ cingredientwindow.h \
+ cingredientvalue.h
FORMS += cmainwindow.ui \
coptions.ui \
@@ -49,7 +51,8 @@ FORMS += cmainwindow.ui \
cimportingredientdialog.ui \
cmessageanimatedialog.ui \
cplugininfo.ui \
- cingredientwindow.ui
+ cingredientwindow.ui \
+ cingredientvalue.ui
DESTDIR = ../bin
diff --git a/Kooky/cimportingredientdialog.ui b/Kooky/cimportingredientdialog.ui
index aeedde8..8fbe643 100644
--- a/Kooky/cimportingredientdialog.ui
+++ b/Kooky/cimportingredientdialog.ui
@@ -22,11 +22,18 @@
Qt::Horizontal
+
+ QAbstractItemView::NoEditTriggers
+
false
-
+
+
+ QAbstractItemView::NoEditTriggers
+
+
-
diff --git a/Kooky/cingredient.cpp b/Kooky/cingredient.cpp
index cd336e3..407c206 100644
--- a/Kooky/cingredient.cpp
+++ b/Kooky/cingredient.cpp
@@ -6,176 +6,176 @@ typedef struct tagGROUPNAME
{
QString szName;
QString szGroup;
- cIngredient::MEASURE measure;
+ cIngredient::UNIT unit;
cIngredient::iIngredient iIngredient;
} GROUPNAME;
static GROUPNAME g_groupname[] =
{
- { QString::fromUtf8("Bread Units"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_None, cIngredient::iIngredientBreadUnits },
- { QString::fromUtf8("Calories"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Calories, cIngredient::iIngredientCalories },
- { QString::fromUtf8("Protein"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientProtein },
- { QString::fromUtf8("Fat"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFat },
- { QString::fromUtf8("Carbohydrates"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCarbohydrates },
- { QString::fromUtf8("Alcohol"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAlcohol },
- { QString::fromUtf8("Water"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientWater },
- { QString::fromUtf8("Total Dietary Fibre"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTotalDietaryFibre },
- { QString::fromUtf8("Cholesterol"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCholesterol },
- { QString::fromUtf8("Mineral"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMineral },
- { QString::fromUtf8("Sugar"), QString::fromUtf8("Main Ingredients"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSugar },
+ { QString::fromUtf8("Bread Units"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_None, cIngredient::iIngredientBreadUnits },
+ { QString::fromUtf8("Calories"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Calories, cIngredient::iIngredientCalories },
+ { QString::fromUtf8("Protein"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientProtein },
+ { QString::fromUtf8("Fat"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientFat },
+ { QString::fromUtf8("Carbohydrates"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientCarbohydrates },
+ { QString::fromUtf8("Alcohol"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientAlcohol },
+ { QString::fromUtf8("Water"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientWater },
+ { QString::fromUtf8("Total Dietary Fibre"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientTotalDietaryFibre },
+ { QString::fromUtf8("Cholesterol"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientCholesterol },
+ { QString::fromUtf8("Mineral"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientMineral },
+ { QString::fromUtf8("Sugar"), QString::fromUtf8("Main Ingredients"), cIngredient::UNIT_Weight, cIngredient::iIngredientSugar },
- { QString::fromUtf8("Vitamin A Retinol"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminARetinol },
- { QString::fromUtf8("Vitamin D"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminD },
- { QString::fromUtf8("Vitamin E activ."), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminEactiv },
- { QString::fromUtf8("Folic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFolicacid },
- { QString::fromUtf8("Vitamin B1"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB1 },
- { QString::fromUtf8("Vitamin B2"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB2 },
- { QString::fromUtf8("Vitamin B6"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB6 },
- { QString::fromUtf8("Vitamin C"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminC },
- { QString::fromUtf8("a-Tocopherol"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientaTocopherol },
- { QString::fromUtf8("Vitamin K"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminK },
- { QString::fromUtf8("Nicotinamide"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNicotinamide },
- { QString::fromUtf8("Pantothenic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPantothenicacid },
- { QString::fromUtf8("Biotin"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBiotin },
- { QString::fromUtf8("Vitamin B12"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientVitaminB12 },
- { QString::fromUtf8("Retinolequivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientRetinolequivalent },
- { QString::fromUtf8("ß-Carotene"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientbCarotene },
- { QString::fromUtf8("Niacinequivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNiacinequivalent },
- { QString::fromUtf8("free folic acid equivalent"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientfreefolicacidequivalent },
- { QString::fromUtf8("free folic acid"), QString::fromUtf8("Vitamins"), cIngredient::MEASURE_Weight, cIngredient::iIngredientfreefolicacid },
+ { QString::fromUtf8("Vitamin A Retinol"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminARetinol },
+ { QString::fromUtf8("Vitamin D"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminD },
+ { QString::fromUtf8("Vitamin E activ."), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminEactiv },
+ { QString::fromUtf8("Folic acid"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientFolicacid },
+ { QString::fromUtf8("Vitamin B1"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminB1 },
+ { QString::fromUtf8("Vitamin B2"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminB2 },
+ { QString::fromUtf8("Vitamin B6"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminB6 },
+ { QString::fromUtf8("Vitamin C"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminC },
+ { QString::fromUtf8("a-Tocopherol"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientaTocopherol },
+ { QString::fromUtf8("Vitamin K"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminK },
+ { QString::fromUtf8("Nicotinamide"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientNicotinamide },
+ { QString::fromUtf8("Pantothenic acid"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientPantothenicacid },
+ { QString::fromUtf8("Biotin"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientBiotin },
+ { QString::fromUtf8("Vitamin B12"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientVitaminB12 },
+ { QString::fromUtf8("Retinolequivalent"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientRetinolequivalent },
+ { QString::fromUtf8("ß-Carotene"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientbCarotene },
+ { QString::fromUtf8("Niacinequivalent"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientNiacinequivalent },
+ { QString::fromUtf8("free folic acid equivalent"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientfreefolicacidequivalent },
+ { QString::fromUtf8("free folic acid"), QString::fromUtf8("Vitamins"), cIngredient::UNIT_Weight, cIngredient::iIngredientfreefolicacid },
- { QString::fromUtf8("Sodium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSodium },
- { QString::fromUtf8("Potassium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPotassium },
- { QString::fromUtf8("Magnesium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMagnesium },
- { QString::fromUtf8("Calcium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCalcium },
- { QString::fromUtf8("Iron"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIron },
- { QString::fromUtf8("Phosphorus"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPhosphorus },
- { QString::fromUtf8("Copper"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCopper },
- { QString::fromUtf8("Zinc"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientZinc },
- { QString::fromUtf8("Chloride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientChloride },
- { QString::fromUtf8("Fluoride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFluoride },
- { QString::fromUtf8("Iodide"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIodide },
- { QString::fromUtf8("Selenium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSelenium },
- { QString::fromUtf8("Manganese"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientManganese },
- { QString::fromUtf8("Sulphur"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSulphur },
+ { QString::fromUtf8("Sodium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientSodium },
+ { QString::fromUtf8("Potassium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientPotassium },
+ { QString::fromUtf8("Magnesium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientMagnesium },
+ { QString::fromUtf8("Calcium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientCalcium },
+ { QString::fromUtf8("Iron"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientIron },
+ { QString::fromUtf8("Phosphorus"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientPhosphorus },
+ { QString::fromUtf8("Copper"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientCopper },
+ { QString::fromUtf8("Zinc"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientZinc },
+ { QString::fromUtf8("Chloride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientChloride },
+ { QString::fromUtf8("Fluoride"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientFluoride },
+ { QString::fromUtf8("Iodide"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientIodide },
+ { QString::fromUtf8("Selenium"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientSelenium },
+ { QString::fromUtf8("Manganese"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientManganese },
+ { QString::fromUtf8("Sulphur"), QString::fromUtf8("Minerals and Trace Elements"), cIngredient::UNIT_Weight, cIngredient::iIngredientSulphur },
- { QString::fromUtf8("Arginine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArginine },
- { QString::fromUtf8("Cystine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCystine },
- { QString::fromUtf8("Histidine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientHistidine },
- { QString::fromUtf8("Isoleucine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientIsoleucine },
- { QString::fromUtf8("Leucine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLeucine },
- { QString::fromUtf8("Lysine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLysine },
- { QString::fromUtf8("Methionine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMethionine },
- { QString::fromUtf8("Phenylalanine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPhenylalanine },
- { QString::fromUtf8("Threonine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientThreonine },
- { QString::fromUtf8("Tryptophane"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTryptophane },
- { QString::fromUtf8("Tyrosine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTyrosine },
- { QString::fromUtf8("Valine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientValine },
- { QString::fromUtf8("Alanine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAlanine },
- { QString::fromUtf8("Aspartic"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAspartid },
- { QString::fromUtf8("Aspartic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientAsparticacid },
- { QString::fromUtf8("Glutamic"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlutamid },
- { QString::fromUtf8("Glutamic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlutamicacid },
- { QString::fromUtf8("Glycine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycine },
- { QString::fromUtf8("Proline"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientProline },
- { QString::fromUtf8("Serine"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSerine },
- { QString::fromUtf8("other essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotheressent_aminoacids },
- { QString::fromUtf8("essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientessent_aminoacids },
- { QString::fromUtf8("other nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothernonessent_aminoacids },
- { QString::fromUtf8("nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientnonessent_aminoacids },
+ { QString::fromUtf8("Arginine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientArginine },
+ { QString::fromUtf8("Cystine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientCystine },
+ { QString::fromUtf8("Histidine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientHistidine },
+ { QString::fromUtf8("Isoleucine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientIsoleucine },
+ { QString::fromUtf8("Leucine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLeucine },
+ { QString::fromUtf8("Lysine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLysine },
+ { QString::fromUtf8("Methionine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientMethionine },
+ { QString::fromUtf8("Phenylalanine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientPhenylalanine },
+ { QString::fromUtf8("Threonine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientThreonine },
+ { QString::fromUtf8("Tryptophane"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientTryptophane },
+ { QString::fromUtf8("Tyrosine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientTyrosine },
+ { QString::fromUtf8("Valine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientValine },
+ { QString::fromUtf8("Alanine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientAlanine },
+ { QString::fromUtf8("Aspartic"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientAspartid },
+ { QString::fromUtf8("Aspartic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientAsparticacid },
+ { QString::fromUtf8("Glutamic"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlutamid },
+ { QString::fromUtf8("Glutamic acid"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlutamicacid },
+ { QString::fromUtf8("Glycine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlycine },
+ { QString::fromUtf8("Proline"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientProline },
+ { QString::fromUtf8("Serine"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientSerine },
+ { QString::fromUtf8("other essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientotheressent_aminoacids },
+ { QString::fromUtf8("essent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientessent_aminoacids },
+ { QString::fromUtf8("other nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientothernonessent_aminoacids },
+ { QString::fromUtf8("nonessent. amino acids"), QString::fromUtf8("Aminos Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientnonessent_aminoacids },
- { QString::fromUtf8("Saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSaturatedfattyacids },
- { QString::fromUtf8("Monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMonounsaturatedfattyacids },
- { QString::fromUtf8("Polyunsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolyunsaturatedfattyacids },
- { QString::fromUtf8("Butyric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientButyricacid },
- { QString::fromUtf8("Caproic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCaproicacid },
- { QString::fromUtf8("Caprylic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCaprylicacid },
- { QString::fromUtf8("Capric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCapricacid },
- { QString::fromUtf8("Lauric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLauricacid },
- { QString::fromUtf8("Myristic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMyristicacid },
- { QString::fromUtf8("C15:O fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC15_O_fattyacid },
- { QString::fromUtf8("Palmitic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPalmiticacid },
- { QString::fromUtf8("Margaric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMargaricacid },
- { QString::fromUtf8("Stearic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientStearicacid },
- { QString::fromUtf8("Arachic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArachicacid },
- { QString::fromUtf8("Behenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBehenicacid },
- { QString::fromUtf8("Lignoceric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLignocericacid },
- { QString::fromUtf8("Palmitoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPalmitoleicacid },
- { QString::fromUtf8("Oleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOleicacid },
- { QString::fromUtf8("Eicosenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosenicacid },
- { QString::fromUtf8("C22:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_1_fattyacid },
- { QString::fromUtf8("C14:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC14_1_fattyacid },
- { QString::fromUtf8("C24:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC24_1_fattyacid },
- { QString::fromUtf8("Linoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLinoleicacid },
- { QString::fromUtf8("Linolenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLinolenicacid },
- { QString::fromUtf8("Arachidonic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientArachidonicacid },
- { QString::fromUtf8("C18:4 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC18_4_fattyacid },
- { QString::fromUtf8("C20:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC20_5_N_3fattyacid },
- { QString::fromUtf8("C22:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_5_N_3fattyacid },
- { QString::fromUtf8("C22:6 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC22_6_N_3fattyacid },
- { QString::fromUtf8("C16:2 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientC16_2_fattyacid },
- { QString::fromUtf8("other saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothersaturatedfattyacids },
- { QString::fromUtf8("other monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermonounsaturatedfattyacids },
- { QString::fromUtf8("Nonadecatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNonadecatrienicacid },
- { QString::fromUtf8("Eicosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosadienicacid },
- { QString::fromUtf8("Eicosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientEicosatrienicacid },
- { QString::fromUtf8("Docosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosadienicacid },
- { QString::fromUtf8("Docosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosatrienicacid },
- { QString::fromUtf8("Docosatetraenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDocosatetraenicacid },
- { QString::fromUtf8("other polyunsat. fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherpolyunsat_fattyacids },
- { QString::fromUtf8("other short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothershort_chainfattyacids },
- { QString::fromUtf8("short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientshort_chainfattyacids },
- { QString::fromUtf8("other medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermedium_chainfattyacids },
- { QString::fromUtf8("medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientmedium_chainfattyacids },
- { QString::fromUtf8("other long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherlong_chainfattyacids },
- { QString::fromUtf8("long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientlong_chainfattyacids },
- { QString::fromUtf8("Glycerol and Lipoides"), QString::fromUtf8("Fatty Acids"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycerolandLipoides },
+ { QString::fromUtf8("Saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientSaturatedfattyacids },
+ { QString::fromUtf8("Monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientMonounsaturatedfattyacids },
+ { QString::fromUtf8("Polyunsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientPolyunsaturatedfattyacids },
+ { QString::fromUtf8("Butyric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientButyricacid },
+ { QString::fromUtf8("Caproic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientCaproicacid },
+ { QString::fromUtf8("Caprylic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientCaprylicacid },
+ { QString::fromUtf8("Capric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientCapricacid },
+ { QString::fromUtf8("Lauric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLauricacid },
+ { QString::fromUtf8("Myristic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientMyristicacid },
+ { QString::fromUtf8("C15:O fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC15_O_fattyacid },
+ { QString::fromUtf8("Palmitic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientPalmiticacid },
+ { QString::fromUtf8("Margaric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientMargaricacid },
+ { QString::fromUtf8("Stearic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientStearicacid },
+ { QString::fromUtf8("Arachic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientArachicacid },
+ { QString::fromUtf8("Behenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientBehenicacid },
+ { QString::fromUtf8("Lignoceric acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLignocericacid },
+ { QString::fromUtf8("Palmitoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientPalmitoleicacid },
+ { QString::fromUtf8("Oleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientOleicacid },
+ { QString::fromUtf8("Eicosenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientEicosenicacid },
+ { QString::fromUtf8("C22:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC22_1_fattyacid },
+ { QString::fromUtf8("C14:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC14_1_fattyacid },
+ { QString::fromUtf8("C24:1 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC24_1_fattyacid },
+ { QString::fromUtf8("Linoleic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLinoleicacid },
+ { QString::fromUtf8("Linolenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientLinolenicacid },
+ { QString::fromUtf8("Arachidonic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientArachidonicacid },
+ { QString::fromUtf8("C18:4 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC18_4_fattyacid },
+ { QString::fromUtf8("C20:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC20_5_N_3fattyacid },
+ { QString::fromUtf8("C22:5 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC22_5_N_3fattyacid },
+ { QString::fromUtf8("C22:6 N-3 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC22_6_N_3fattyacid },
+ { QString::fromUtf8("C16:2 fatty acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientC16_2_fattyacid },
+ { QString::fromUtf8("other saturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientothersaturatedfattyacids },
+ { QString::fromUtf8("other monounsaturated fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientothermonounsaturatedfattyacids },
+ { QString::fromUtf8("Nonadecatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientNonadecatrienicacid },
+ { QString::fromUtf8("Eicosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientEicosadienicacid },
+ { QString::fromUtf8("Eicosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientEicosatrienicacid },
+ { QString::fromUtf8("Docosadienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientDocosadienicacid },
+ { QString::fromUtf8("Docosatrienic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientDocosatrienicacid },
+ { QString::fromUtf8("Docosatetraenic acid"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientDocosatetraenicacid },
+ { QString::fromUtf8("other polyunsat. fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherpolyunsat_fattyacids },
+ { QString::fromUtf8("other short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientothershort_chainfattyacids },
+ { QString::fromUtf8("short-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientshort_chainfattyacids },
+ { QString::fromUtf8("other medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientothermedium_chainfattyacids },
+ { QString::fromUtf8("medium-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientmedium_chainfattyacids },
+ { QString::fromUtf8("other long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherlong_chainfattyacids },
+ { QString::fromUtf8("long-chain fatty acids"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientlong_chainfattyacids },
+ { QString::fromUtf8("Glycerol and Lipoides"), QString::fromUtf8("Fatty Acids"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlycerolandLipoides },
- { QString::fromUtf8("Sorbitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSorbitol },
- { QString::fromUtf8("Glucose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlucose },
- { QString::fromUtf8("Fructose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFructose },
- { QString::fromUtf8("Sucrose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSucrose },
- { QString::fromUtf8("Lactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLactose },
- { QString::fromUtf8("Starch"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientStarch },
- { QString::fromUtf8("Maltose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMaltose },
- { QString::fromUtf8("Galactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGalactose },
- { QString::fromUtf8("Glycogene"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientGlycogene },
- { QString::fromUtf8("Pentosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPentosan },
- { QString::fromUtf8("Hexosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientHexosan },
- { QString::fromUtf8("Cellulose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientCellulose },
- { QString::fromUtf8("Polyuronic acid"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolyuronicacid },
- { QString::fromUtf8("Mannitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMannitol },
- { QString::fromUtf8("Xylitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientXylitol },
- { QString::fromUtf8("other sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothersugaralcohols },
- { QString::fromUtf8("Total sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientTotalsugaralcohols },
- { QString::fromUtf8("other monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientothermonosaccharides },
- { QString::fromUtf8("Monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMonosaccharides },
- { QString::fromUtf8("other disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherdisaccharides },
- { QString::fromUtf8("Disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDisaccharides },
- { QString::fromUtf8("Oligosaccharides resorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOligosaccharidesresorb },
- { QString::fromUtf8("Oligosaccharides nonresorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientOligosaccharidesnonresorb },
- { QString::fromUtf8("other polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherpolysaccharides },
- { QString::fromUtf8("Polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPolysaccharides },
+ { QString::fromUtf8("Sorbitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientSorbitol },
+ { QString::fromUtf8("Glucose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlucose },
+ { QString::fromUtf8("Fructose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientFructose },
+ { QString::fromUtf8("Sucrose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientSucrose },
+ { QString::fromUtf8("Lactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientLactose },
+ { QString::fromUtf8("Starch"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientStarch },
+ { QString::fromUtf8("Maltose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientMaltose },
+ { QString::fromUtf8("Galactose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientGalactose },
+ { QString::fromUtf8("Glycogene"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientGlycogene },
+ { QString::fromUtf8("Pentosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientPentosan },
+ { QString::fromUtf8("Hexosan"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientHexosan },
+ { QString::fromUtf8("Cellulose"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientCellulose },
+ { QString::fromUtf8("Polyuronic acid"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientPolyuronicacid },
+ { QString::fromUtf8("Mannitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientMannitol },
+ { QString::fromUtf8("Xylitol"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientXylitol },
+ { QString::fromUtf8("other sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientothersugaralcohols },
+ { QString::fromUtf8("Total sugar alcohols"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientTotalsugaralcohols },
+ { QString::fromUtf8("other monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientothermonosaccharides },
+ { QString::fromUtf8("Monosaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientMonosaccharides },
+ { QString::fromUtf8("other disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherdisaccharides },
+ { QString::fromUtf8("Disaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientDisaccharides },
+ { QString::fromUtf8("Oligosaccharides resorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientOligosaccharidesresorb },
+ { QString::fromUtf8("Oligosaccharides nonresorb."), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientOligosaccharidesnonresorb },
+ { QString::fromUtf8("other polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherpolysaccharides },
+ { QString::fromUtf8("Polysaccharides"), QString::fromUtf8("Special Carbohydrates"), cIngredient::UNIT_Weight, cIngredient::iIngredientPolysaccharides },
- { QString::fromUtf8("Dietary fibre water soluble"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDietaryfibrewatersoluble },
- { QString::fromUtf8("Dietary fibre water insoluble"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientDietaryfibrewaterinsoluble },
- { QString::fromUtf8("Lignin"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientLignin },
- { QString::fromUtf8("Purine bases nitrogen"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPurinebasesnitrogen },
- { QString::fromUtf8("Sodium chloride"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientSodiumchloride },
- { QString::fromUtf8("Waste"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientWaste },
- { QString::fromUtf8("other proteins"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherproteins },
- { QString::fromUtf8("animal protein"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientanimalprotein },
- { QString::fromUtf8("plant protein"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientplantprotein },
- { QString::fromUtf8("Uric acid"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientUricacid },
- { QString::fromUtf8("other organic acids"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientotherorganicacids },
- { QString::fromUtf8("Mol-diff. cations-anions"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMol_diff_cations_anions },
- { QString::fromUtf8("Nitrogen factor"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientNitrogenfactor },
- { QString::fromUtf8("Fatty acid part"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFattyacidpart },
- { QString::fromUtf8("Minerals part"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientMineralspart },
- { QString::fromUtf8("P/S Ratio"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientPS_Ratio },
- { QString::fromUtf8("Biological value"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientBiologicalvalue },
- { QString::fromUtf8("Fructose free bread units"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientFructosefreebreadunits },
- { QString::fromUtf8("average consumption"), QString::fromUtf8("Others"), cIngredient::MEASURE_Weight, cIngredient::iIngredientaverageconsumption },
+ { QString::fromUtf8("Dietary fibre water soluble"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientDietaryfibrewatersoluble },
+ { QString::fromUtf8("Dietary fibre water insoluble"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientDietaryfibrewaterinsoluble },
+ { QString::fromUtf8("Lignin"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientLignin },
+ { QString::fromUtf8("Purine bases nitrogen"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientPurinebasesnitrogen },
+ { QString::fromUtf8("Sodium chloride"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientSodiumchloride },
+ { QString::fromUtf8("Waste"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientWaste },
+ { QString::fromUtf8("other proteins"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherproteins },
+ { QString::fromUtf8("animal protein"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientanimalprotein },
+ { QString::fromUtf8("plant protein"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientplantprotein },
+ { QString::fromUtf8("Uric acid"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientUricacid },
+ { QString::fromUtf8("other organic acids"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientotherorganicacids },
+ { QString::fromUtf8("Mol-diff. cations-anions"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientMol_diff_cations_anions },
+ { QString::fromUtf8("Nitrogen factor"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientNitrogenfactor },
+ { QString::fromUtf8("Fatty acid part"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientFattyacidpart },
+ { QString::fromUtf8("Minerals part"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientMineralspart },
+ { QString::fromUtf8("P/S Ratio"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientPS_Ratio },
+ { QString::fromUtf8("Biological value"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientBiologicalvalue },
+ { QString::fromUtf8("Fructose free bread units"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientFructosefreebreadunits },
+ { QString::fromUtf8("average consumption"), QString::fromUtf8("Others"), cIngredient::UNIT_Weight, cIngredient::iIngredientaverageconsumption },
};
cIngredient::cIngredient() :
@@ -293,27 +293,27 @@ QString cIngredient::valueFormatted(cIngredient::iIngredient i)
{
qreal dValue = m_dValue[i];
QString str;
- QString measure("g");
+ QString unit("g");
qint16 factor;
- switch(g_groupname[i].measure)
+ switch(g_groupname[i].unit)
{
- case MEASURE_Calories:
+ case UNIT_Calories:
str = QString("%1 kCal").arg(dValue);
break;
- case MEASURE_Joule:
+ case UNIT_Joule:
str = QString("%1 kJoule").arg(dValue);
break;
- case MEASURE_Fluid:
+ case UNIT_Fluid:
str = QString("%1 l").arg(dValue);
break;
- case MEASURE_None:
+ case UNIT_None:
str = QString("%1").arg(dValue);
break;
- case MEASURE_Peace:
+ case UNIT_Peace:
str = QString("%1 pcs").arg(dValue);
break;
- case MEASURE_Weight:
+ case UNIT_Weight:
factor = 1;
if(dValue == 0)
str = QString("%1 g").arg(dValue);
@@ -353,14 +353,14 @@ QString cIngredient::valueFormatted(cIngredient::iIngredient i)
return(str);
}
-cIngredient::MEASURE cIngredient::measure(cIngredient::iIngredient i)
+cIngredient::UNIT cIngredient::unit(cIngredient::iIngredient i)
{
for(int z = 0;z < (int)sizeof(g_groupname)/(int)sizeof(GROUPNAME);z++)
{
if(g_groupname[z].iIngredient == i)
- return(g_groupname[z].measure);
+ return(g_groupname[z].unit);
}
- return(cIngredient::MEASURE::MEASURE_None);
+ return(cIngredient::UNIT::UNIT_None);
}
void cIngredient::setValue(cIngredient::iIngredient i, qreal dValue)
diff --git a/Kooky/cingredient.h b/Kooky/cingredient.h
index 03c18e2..d7e7515 100644
--- a/Kooky/cingredient.h
+++ b/Kooky/cingredient.h
@@ -202,15 +202,15 @@ public:
iIngredientMax,
};
- enum MEASURE
+ enum UNIT
{
- MEASURE_None = 0,
- MEASURE_Weight = 1,
- MEASURE_Volume = 2,
- MEASURE_Fluid = 3,
- MEASURE_Peace = 4,
- MEASURE_Calories = 5,
- MEASURE_Joule = 6,
+ UNIT_None = 0,
+ UNIT_Weight = 1,
+ UNIT_Volume = 2,
+ UNIT_Fluid = 3,
+ UNIT_Peace = 4,
+ UNIT_Calories = 5,
+ UNIT_Joule = 6,
};
cIngredient();
@@ -219,7 +219,7 @@ public:
void setValue(cIngredient::iIngredient i, qreal dValue);
qreal value(cIngredient::iIngredient i);
QString valueFormatted(cIngredient::iIngredient i);
- MEASURE measure(cIngredient::iIngredient i);
+ UNIT unit(cIngredient::iIngredient i);
/*!
\brief
@@ -265,6 +265,27 @@ public:
m_dValue[z] = D.m_dValue[z];
}
+ bool operator==(const cIngredient& D)
+ {
+ if(m_szIngredientName != D.m_szIngredientName)
+ return(false);
+
+ if(m_iID != D.m_iID)
+ return(false);
+
+ for(int z = 0;z < iIngredientMax;z++)
+ {
+ if(m_dValue[z] != D.m_dValue[z])
+ return(false);
+ }
+ return(true);
+ }
+
+ bool operator!=(const cIngredient& D)
+ {
+ return(!(*this == D));
+ }
+
private:
QString m_szIngredientName;
QString m_szIngredientGroup;
diff --git a/Kooky/cingredientvalue.cpp b/Kooky/cingredientvalue.cpp
new file mode 100644
index 0000000..01a9314
--- /dev/null
+++ b/Kooky/cingredientvalue.cpp
@@ -0,0 +1,89 @@
+#include "cingredientvalue.h"
+#include "ui_cingredientvalue.h"
+
+
+cIngredientValue::cIngredientValue(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::cIngredientValue)
+{
+ ui->setupUi(this);
+}
+
+cIngredientValue::~cIngredientValue()
+{
+ delete ui;
+}
+
+void cIngredientValue::setValues(const QString& szName, qreal value, cIngredient::UNIT unit)
+{
+ ui->m_lpIngredient->setText(szName);
+
+ switch(unit)
+ {
+ case cIngredient::UNIT_Calories:
+ ui->m_lpIngredientUnit->addItem("kCal", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->setCurrentIndex(0);
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ case cIngredient::UNIT_Fluid:
+ ui->m_lpIngredientUnit->addItem("l", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->setCurrentIndex(0);
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ case cIngredient::UNIT_Joule:
+ ui->m_lpIngredientUnit->addItem("kJoule", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->setCurrentIndex(0);
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ case cIngredient::UNIT_None:
+ ui->m_lpIngredientValue->setValue(value);
+ ui->m_lpIngredientUnit->setEnabled(false);
+ break;
+ case cIngredient::UNIT_Peace:
+ ui->m_lpIngredientUnit->addItem("pcs", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->setCurrentIndex(0);
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ case cIngredient::UNIT_Volume:
+ ui->m_lpIngredientUnit->addItem("qm", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->setCurrentIndex(0);
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ case cIngredient::UNIT_Weight:
+ m_index = 1;
+
+ if(value != 0)
+ {
+ while(value < 1)
+ {
+ value *= 1000;
+ m_index++;
+ }
+ }
+
+ ui->m_lpIngredientUnit->addItem("kg", QVariant((qreal)1000));
+ ui->m_lpIngredientUnit->addItem("g", QVariant((qreal)1));
+ ui->m_lpIngredientUnit->addItem("mg", QVariant((qreal)1/1000));
+ ui->m_lpIngredientUnit->addItem("µg", QVariant((qreal)1/1000000));
+ ui->m_lpIngredientUnit->addItem("ng", QVariant((qreal)1/1000000000));
+ ui->m_lpIngredientUnit->addItem("pg", QVariant((qreal)1/1000000000000));
+
+ ui->m_lpIngredientUnit->setCurrentIndex(m_index);
+
+ ui->m_lpIngredientValue->setValue(value);
+ break;
+ default:
+ ui->m_lpIngredientValue->setValue(value);
+ ui->m_lpIngredientUnit->setEnabled(false);
+ break;
+ }
+}
+
+qreal cIngredientValue::value()
+{
+ qreal factor = ui->m_lpIngredientUnit->currentData().toReal();
+ if(!ui->m_lpIngredientUnit->isEnabled())
+ factor = 1;
+ qreal value = ui->m_lpIngredientValue->value();
+ return(value*factor);
+}
diff --git a/Kooky/cingredientvalue.h b/Kooky/cingredientvalue.h
new file mode 100644
index 0000000..137571c
--- /dev/null
+++ b/Kooky/cingredientvalue.h
@@ -0,0 +1,29 @@
+#ifndef CINGREDIENTVALUE_H
+#define CINGREDIENTVALUE_H
+
+
+#include "cingredient.h"
+
+#include
+
+
+namespace Ui {
+class cIngredientValue;
+}
+
+class cIngredientValue : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit cIngredientValue(QWidget *parent = 0);
+ ~cIngredientValue();
+
+ void setValues(const QString& szName, qreal value, cIngredient::UNIT unit);
+ qreal value();
+private:
+ Ui::cIngredientValue* ui;
+ qint32 m_index;
+};
+
+#endif // CINGREDIENTVALUE_H
diff --git a/Kooky/cingredientvalue.ui b/Kooky/cingredientvalue.ui
new file mode 100644
index 0000000..7d673ac
--- /dev/null
+++ b/Kooky/cingredientvalue.ui
@@ -0,0 +1,91 @@
+
+
+ cIngredientValue
+
+
+
+ 0
+ 0
+ 237
+ 69
+
+
+
+ Dialog
+
+
+
-
+
+
-
+
+
+ TextLabel
+
+
+
+ -
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ 5
+
+
+ 99999.000000000000000
+
+
+
+ -
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
+
+
+
+
+
+ buttonBox
+ accepted()
+ cIngredientValue
+ accept()
+
+
+ 248
+ 254
+
+
+ 157
+ 274
+
+
+
+
+ buttonBox
+ rejected()
+ cIngredientValue
+ reject()
+
+
+ 316
+ 260
+
+
+ 286
+ 274
+
+
+
+
+
diff --git a/Kooky/cingredientwindow.cpp b/Kooky/cingredientwindow.cpp
index d4d4b69..fd9eff6 100644
--- a/Kooky/cingredientwindow.cpp
+++ b/Kooky/cingredientwindow.cpp
@@ -1,6 +1,8 @@
#include "cingredientwindow.h"
#include "ui_cingredientwindow.h"
+#include "cingredientvalue.h"
+
#include
@@ -9,9 +11,12 @@ cIngredientWindow::cIngredientWindow(QWidget *parent) :
ui(new Ui::cIngredientWindow)
{
ui->setupUi(this);
+ ui->m_lpIngredientValues->setMinimumWidth(1);
m_lpIngredientValuesModel = new QStandardItemModel(0, 2);
ui->m_lpIngredientValues->setModel(m_lpIngredientValuesModel);
+
+ connect(ui->m_lpIngredientValues, &QTreeView::doubleClicked, this, &cIngredientWindow::ingredientEdit);
}
cIngredientWindow::~cIngredientWindow()
@@ -28,7 +33,7 @@ void cIngredientWindow::setIngredient(qint32 iIngredient, cPlugin* lpPlugin)
m_ingredient = m_ingredientSaved;
- setWindowTitle(m_ingredientSaved.ingredientName());
+ setWindowTitle(QString(" %1").arg(m_ingredientSaved.ingredientName()));
ui->m_lpIngredientName->setText(m_ingredientSaved.ingredientName());
QStringList groups = m_ingredientSaved.groups();
@@ -50,7 +55,53 @@ void cIngredientWindow::setIngredient(qint32 iIngredient, cPlugin* lpPlugin)
QStandardItem* lpValue = new QStandardItem(m_ingredientSaved.valueFormatted((cIngredient::iIngredient)z));
lpValue->setTextAlignment(Qt::AlignRight);
lpRoot[groupID]->appendRow(QList() << lpNew << lpValue);
+ lpNew->setData(QVariant(z));
+ lpValue->setData(QVariant(z));
}
ui->m_lpIngredientValues->expandAll();
ui->m_lpIngredientValues->resizeColumnToContents(0);
+ ui->m_lpIngredientValues->resizeColumnToContents(1);
+}
+
+qint32 cIngredientWindow::ingredientID(void)
+{
+ return(m_iIngredient);
+}
+
+void cIngredientWindow::ingredientEdit(const QModelIndex &modelIndex)
+{
+ QStandardItem* lpCurrentItem = m_lpIngredientValuesModel->itemFromIndex(modelIndex);
+ if(!lpCurrentItem->parent())
+ return;
+
+ cIngredient::iIngredient iIngredient = (cIngredient::iIngredient)lpCurrentItem->data().toInt();
+ cIngredient::UNIT unit = m_ingredient.unit(iIngredient);
+ QString szIngredient = QString("%1/%2").arg(cIngredient::group(iIngredient)).arg(cIngredient::name(iIngredient));
+ qreal value = m_ingredient.value(iIngredient);
+ cIngredientValue ingredientValue(this);
+ ingredientValue.setValues(szIngredient, value, unit);
+
+ if(ingredientValue.exec() == QDialog::Rejected)
+ return;
+
+ value = ingredientValue.value();
+ m_ingredient.setValue(iIngredient, value);
+
+ bool bChanged = isChanged(); // may not be later as it seems to be buggy ...
+
+ QStandardItem* lpParent = lpCurrentItem->parent();
+ QStandardItem* lpValue = lpParent->child(modelIndex.row(), 1);
+ lpValue->setText(m_ingredient.valueFormatted(iIngredient));
+
+ if(bChanged)
+ setWindowTitle(QString(" %1*").arg(m_ingredientSaved.ingredientName()));
+ else
+ setWindowTitle(QString(" %1").arg(m_ingredientSaved.ingredientName()));
+}
+
+bool cIngredientWindow::isChanged()
+{
+ if(m_ingredient != m_ingredientSaved)
+ return(true);
+ return(false);
}
diff --git a/Kooky/cingredientwindow.h b/Kooky/cingredientwindow.h
index 067da77..192bd10 100644
--- a/Kooky/cingredientwindow.h
+++ b/Kooky/cingredientwindow.h
@@ -22,7 +22,13 @@ public:
explicit cIngredientWindow(QWidget *parent = 0);
~cIngredientWindow();
- void setIngredient(qint32 iIngredient, cPlugin* lpPlugin);
+ void setIngredient(qint32 iIngredient, cPlugin* lpPlugin);
+ qint32 ingredientID(void);
+
+ bool isChanged();
+private slots:
+ void ingredientEdit(const QModelIndex& modelIndex);
+
private:
Ui::cIngredientWindow* ui;
diff --git a/Kooky/cingredientwindow.ui b/Kooky/cingredientwindow.ui
index 188a116..4a6b0f7 100644
--- a/Kooky/cingredientwindow.ui
+++ b/Kooky/cingredientwindow.ui
@@ -6,10 +6,16 @@
0
0
- 791
- 712
+ 641
+ 635
+
+
+ 0
+ 0
+
+
Ingredient
@@ -39,11 +45,21 @@
-
-
-
- false
-
-
+
+
-
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ false
+
+
+ false
+
+
+
+
diff --git a/Kooky/cmainwindow.cpp b/Kooky/cmainwindow.cpp
index 6a576f2..794d5c9 100644
--- a/Kooky/cmainwindow.cpp
+++ b/Kooky/cmainwindow.cpp
@@ -316,9 +316,11 @@ void cMainWindow::loadIngredients()
m_lpIngredientsListModel->appendRow(lpGroupItem);
}
QStandardItem* lpNew = new QStandardItem(ingredients.at(z).szIngredient);
- lpNew->setData(ingredients.at(z).iIngredient);
QStandardItem* lpCalories = new QStandardItem(QString("%1 kCal").arg(ingredients.at(z).dCalories));
QStandardItem* lpCarbos = new QStandardItem(QString("%1 g").arg(ingredients.at(z).dCarbohydrates, 0, 'f', 1));
+ lpNew->setData(ingredients.at(z).iIngredient);
+ lpCalories->setData(ingredients.at(z).iIngredient);
+ lpCarbos->setData(ingredients.at(z).iIngredient);
lpCalories->setTextAlignment(Qt::AlignRight);
lpCarbos->setTextAlignment(Qt::AlignRight);
lpGroupItem->appendRow(QList() << lpNew << lpCalories << lpCarbos);
@@ -483,10 +485,21 @@ void cMainWindow::ingredientsListEditTriggered()
if(!lpParent)
return;
+ QList windowsList = ui->m_lpMDIArea->subWindowList();
+ for(int z = 0;z < windowsList.count();z++)
+ {
+ cIngredientWindow* lpWidget = (cIngredientWindow*)windowsList.at(z)->widget();
+ if(lpWidget->ingredientID() == lpItem->data().toInt())
+ {
+ ui->m_lpMDIArea->setActiveSubWindow(windowsList.at(z));
+ return;
+ }
+ }
+
cIngredientWindow* lpIngredientWindow = new cIngredientWindow(this);
+ lpIngredientWindow->setIngredient(lpItem->data().toInt(), m_lpDB);
QMdiSubWindow* lpSubWindow = ui->m_lpMDIArea->addSubWindow(lpIngredientWindow);
lpSubWindow->setAttribute(Qt::WA_DeleteOnClose);
- lpIngredientWindow->setIngredient(lpItem->data().toInt(), m_lpDB);
lpIngredientWindow->show();
}
}
diff --git a/Kooky/typedef.h b/Kooky/typedef.h
index 28bd8f0..cafc652 100644
--- a/Kooky/typedef.h
+++ b/Kooky/typedef.h
@@ -11,8 +11,8 @@ typedef struct tagINGREDIENT
qint32 iIngredient;
QString szGroup;
QString szIngredient;
- double dCalories;
- double dCarbohydrates;
+ qreal dCalories;
+ qreal dCarbohydrates;
} INGREDIENT, *LPINGREDIENT;
typedef QList INGREDIENT_LIST;
diff --git a/dMySQL/cmysqlplugin.cpp b/dMySQL/cmysqlplugin.cpp
index 3d6f446..0fd5b1c 100644
--- a/dMySQL/cmysqlplugin.cpp
+++ b/dMySQL/cmysqlplugin.cpp
@@ -334,8 +334,8 @@ INGREDIENT_LIST cMySQLPlugin::ingredients()
i.iIngredient = query.value(0).toInt();
i.szIngredient = query.value(1).toString();
i.szGroup = query.value(2).toString();
- i.dCalories = query.value(3).toDouble();
- i.dCarbohydrates = query.value(4).toDouble();
+ i.dCalories = query.value(3).toReal();
+ i.dCarbohydrates = query.value(4).toReal();
list.append(i);
}
diff --git a/dSQLite/csqliteplugin.cpp b/dSQLite/csqliteplugin.cpp
index aeee51e..47b602f 100644
--- a/dSQLite/csqliteplugin.cpp
+++ b/dSQLite/csqliteplugin.cpp
@@ -322,8 +322,8 @@ INGREDIENT_LIST cSQLitePlugin::ingredients()
i.iIngredient = query.value(0).toInt();
i.szIngredient = query.value(1).toString();
i.szGroup = query.value(2).toString();
- i.dCalories = query.value(3).toDouble();
- i.dCarbohydrates = query.value(4).toDouble();
+ i.dCalories = query.value(3).toReal();
+ i.dCarbohydrates = query.value(4).toReal();
list.append(i);
}
diff --git a/iErnaehrung/cernaehrungplugin.cpp b/iErnaehrung/cernaehrungplugin.cpp
index eb99766..f5aca82 100644
--- a/iErnaehrung/cernaehrungplugin.cpp
+++ b/iErnaehrung/cernaehrungplugin.cpp
@@ -248,7 +248,7 @@ QStringList cErnaehrungPlugin::search(const QString& szSearch, const QString& sz
return(m_szIngredients);
}
-double toValue(const QString& sz)
+qreal toValue(const QString& sz)
{
QString szTmp;
szTmp = sz.mid(sz.indexOf("\">")+2);