diff --git a/RecipeDB.pro b/RecipeDB.pro index 4727193..9372036 100644 --- a/RecipeDB.pro +++ b/RecipeDB.pro @@ -79,4 +79,6 @@ DISTFILES += \ .gitignore RESOURCES += \ + res.qrc \ + images.qrc \ images.qrc diff --git a/fonts/NotoSans-Light.ttf b/fonts/NotoSans-Light.ttf new file mode 100644 index 0000000..d80909f Binary files /dev/null and b/fonts/NotoSans-Light.ttf differ diff --git a/fonts/NotoSans-LightItalic.ttf b/fonts/NotoSans-LightItalic.ttf new file mode 100644 index 0000000..fe3cb93 Binary files /dev/null and b/fonts/NotoSans-LightItalic.ttf differ diff --git a/main.cpp b/main.cpp index cdd2938..6a00644 100644 --- a/main.cpp +++ b/main.cpp @@ -1,38 +1,13 @@ #include "gui/mainwindow.h" #include "gui/newrecipedialog.h" + #include +#include #include "model/database/database.h" #include "model/database/recipedatabase.h" #include "utils/fileutils.h" -void test(RecipeDatabase *recipeDB); - -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; -} - -int main(int argc, char *argv[]) -{ - RecipeDatabase recipeDB(QString(FileUtils::appDataPath+"recipes.db").toStdString()); - - QApplication a(argc, argv); - MainWindow w(&recipeDB); - w.loadFromRecipe(checkForFirstRun(&recipeDB)); - w.show(); - - a.exec(); - recipeDB.closeConnection(); - - return 0; -} - void test(RecipeDatabase *recipeDB){ vector ri; ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c", UnitOfMeasure::VOLUME, 1.0), "")); @@ -54,3 +29,32 @@ void test(RecipeDatabase *recipeDB){ 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; +} + +void loadAndSetFonts(){ + QFontDatabase:: +} + +int main(int argc, char *argv[]) +{ + RecipeDatabase recipeDB(QString(FileUtils::appDataPath+"recipes.db").toStdString()); + + QApplication a(argc, argv); + MainWindow w(&recipeDB); + w.loadFromRecipe(checkForFirstRun(&recipeDB)); + w.show(); + + a.exec(); + recipeDB.closeConnection(); + + return 0; +} diff --git a/images.qrc b/res.qrc similarity index 100% rename from images.qrc rename to res.qrc