2018-03-04 08:05:20 +00:00
|
|
|
#ifndef NEWRECIPEDIALOG_H
|
|
|
|
#define NEWRECIPEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2018-03-10 07:51:17 +00:00
|
|
|
#include <QTextCharFormat>
|
|
|
|
|
|
|
|
#include "model/database/recipedatabase.h"
|
2018-03-10 09:42:22 +00:00
|
|
|
#include "model/recipe/ingredients/ingredientlistmodel.h"
|
2018-03-04 08:05:20 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class NewRecipeDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class NewRecipeDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit NewRecipeDialog(QWidget *parent = 0);
|
2018-03-10 07:51:17 +00:00
|
|
|
NewRecipeDialog(RecipeDatabase *db, QWidget *parent = 0);
|
2018-03-04 08:05:20 +00:00
|
|
|
~NewRecipeDialog();
|
|
|
|
|
2018-03-10 07:51:17 +00:00
|
|
|
private slots:
|
2018-03-10 09:42:22 +00:00
|
|
|
void on_addIngredientButton_clicked();
|
|
|
|
|
|
|
|
void on_italicsButton_clicked();
|
|
|
|
|
|
|
|
void on_boldButton_clicked();
|
2018-03-10 07:51:17 +00:00
|
|
|
|
2018-03-04 08:05:20 +00:00
|
|
|
private:
|
|
|
|
Ui::NewRecipeDialog *ui;
|
2018-03-10 07:51:17 +00:00
|
|
|
RecipeDatabase *recipeDB;
|
|
|
|
vector<Ingredient> ingredients;
|
|
|
|
vector<UnitOfMeasure> units;
|
2018-03-10 09:42:22 +00:00
|
|
|
IngredientListModel ingredientListModel;
|
2018-03-10 07:51:17 +00:00
|
|
|
|
|
|
|
//Helper functions to fill fields.
|
|
|
|
void populateIngredientsBox();
|
|
|
|
void populateUnitsBox();
|
2018-03-04 08:05:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NEWRECIPEDIALOG_H
|