Added fonts, still need to implement.
This commit is contained in:
parent
c84370be11
commit
7696a4ff88
|
@ -79,4 +79,6 @@ DISTFILES += \
|
|||
.gitignore
|
||||
|
||||
RESOURCES += \
|
||||
res.qrc \
|
||||
images.qrc \
|
||||
images.qrc
|
||||
|
|
Binary file not shown.
Binary file not shown.
58
main.cpp
58
main.cpp
|
@ -1,38 +1,13 @@
|
|||
#include "gui/mainwindow.h"
|
||||
#include "gui/newrecipedialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QFontDatabase>
|
||||
|
||||
#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<RecipeIngredient> 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue