Release 1.0 Ready! #11

Merged
andrewlalis merged 6 commits from development into master 2018-04-01 07:31:09 +00:00
5 changed files with 33 additions and 27 deletions
Showing only changes of commit 7696a4ff88 - Show all commits

View File

@ -79,4 +79,6 @@ DISTFILES += \
.gitignore .gitignore
RESOURCES += \ RESOURCES += \
res.qrc \
images.qrc \
images.qrc images.qrc

BIN
fonts/NotoSans-Light.ttf Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,38 +1,13 @@
#include "gui/mainwindow.h" #include "gui/mainwindow.h"
#include "gui/newrecipedialog.h" #include "gui/newrecipedialog.h"
#include <QApplication> #include <QApplication>
#include <QFontDatabase>
#include "model/database/database.h" #include "model/database/database.h"
#include "model/database/recipedatabase.h" #include "model/database/recipedatabase.h"
#include "utils/fileutils.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){ void test(RecipeDatabase *recipeDB){
vector<RecipeIngredient> ri; vector<RecipeIngredient> ri;
ri.push_back(RecipeIngredient("flour", "grains", 3.0f, UnitOfMeasure("cup", "cups", "c", UnitOfMeasure::VOLUME, 1.0), "")); 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); 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;
}

View File