diff --git a/RecipeDB.pro b/RecipeDB.pro index eac8ff6..f61213b 100644 --- a/RecipeDB.pro +++ b/RecipeDB.pro @@ -50,7 +50,6 @@ HEADERS += model/recipe/instruction.h \ model/recipe/tags/taglistmodel.h \ gui/newDialogs/newingredientdialog.h \ gui/newDialogs/newtagdialog.h \ - gui/newDialogs/newunitdialog.h \ utils/aspectratiopixmaplabel.h \ utils/stringutils.h \ gui/openrecipedialog.h \ @@ -64,7 +63,6 @@ FORMS += gui/mainwindow.ui \ gui/newrecipedialog.ui \ gui/newDialogs/newingredientdialog.ui \ gui/newDialogs/newtagdialog.ui \ - gui/newDialogs/newunitdialog.ui \ gui/openrecipedialog.ui \ gui/mainwindow.ui \ gui/newDialogs/newfoodgroupdialog.ui diff --git a/gui/newDialogs/newunitdialog.h b/gui/newDialogs/newunitdialog.h deleted file mode 100644 index 7221134..0000000 --- a/gui/newDialogs/newunitdialog.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef NEWUNITDIALOG_H -#define NEWUNITDIALOG_H - -#include - -#include "model/recipe/ingredients/unitofmeasure.h" - -namespace Ui { -class NewUnitDialog; -} - -class NewUnitDialog : public QDialog -{ - Q_OBJECT - - public: - explicit NewUnitDialog(QWidget *parent = 0); - ~NewUnitDialog(); - - UnitOfMeasure getUnit(); - private: - Ui::NewUnitDialog *ui; - - int getSelectedType(); -}; - -#endif // NEWUNITDIALOG_H diff --git a/gui/newDialogs/newunitdialog.ui b/gui/newDialogs/newunitdialog.ui deleted file mode 100644 index fd3ada6..0000000 --- a/gui/newDialogs/newunitdialog.ui +++ /dev/null @@ -1,228 +0,0 @@ - - - NewUnitDialog - - - - 0 - 0 - 195 - 340 - - - - New Unit - - - - :/images/images/icon.png:/images/images/icon.png - - - - - - true - - - - - - - - - - 12 - 50 - false - false - - - - Unit Name - - - Qt::AlignCenter - - - - - - - - - - - 12 - 50 - false - false - - - - Plural Name - - - Qt::AlignCenter - - - - - - - - - - - 12 - 50 - false - false - - - - Abbreviation - - - Qt::AlignCenter - - - - - - - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 12 - 50 - false - false - - - - Type: - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - 12 - 50 - false - false - - - - Metric Coefficient - - - Qt::AlignCenter - - - - - - - 1000.000000000000000 - - - 1.000000000000000 - - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - buttonBox - accepted() - NewUnitDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - NewUnitDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/main.cpp b/main.cpp index bed054e..80b9310 100644 --- a/main.cpp +++ b/main.cpp @@ -8,34 +8,11 @@ #include "model/database/recipedatabase.h" #include "utils/fileutils.h" -void test(RecipeDatabase *recipeDB){ - vector ri; - ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c", UnitOfMeasure::VOLUME, 1.0), "")); - ri.push_back(RecipeIngredient("baking powder", "additives", 1.0f, UnitOfMeasure("teaspoon", "teaspoons", "tsp", UnitOfMeasure::VOLUME, 1.0), "")); - - Recipe rec("Example", - "Andrew Lalis", - ri, - Instruction("Placeholder Text"), - QImage(), - vector({RecipeTag("testing"), - RecipeTag("fake")}), - QDate::currentDate(), - QTime(0, 30), - QTime(0, 25), - 10.0f); - - bool success = recipeDB->storeRecipe(rec); - printf("Storage successful: %d\n", success); - -} - Recipe checkForFirstRun(RecipeDatabase *recipeDB){ Recipe r = recipeDB->retrieveRandomRecipe(); if (r.isEmpty()){//There are no recipes in the database. //Add some basic units to the units, and some basic ingredients. - recipeDB->addBasicUnits(); - recipeDB->addBasicIngredients(); + } return r; } diff --git a/model/recipe/recipe.cpp b/model/recipe/recipe.cpp index f0e04d2..f73c05f 100644 --- a/model/recipe/recipe.cpp +++ b/model/recipe/recipe.cpp @@ -29,16 +29,6 @@ vector Recipe::getIngredients() const{ return this->ingredients; } -vector Recipe::getFoodGroups() const{ - vector foodGroups; - for (Ingredient i : this->ingredients){ - if (find(foodGroups.begin(), foodGroups.end(), i.getFoodGroup()) == foodGroups.end()){ - foodGroups.push_back(i.getFoodGroup()); - } - } - return foodGroups; -} - Instruction Recipe::getInstruction() const{ return this->instruction; }