2018-03-11 07:57:57 +00:00
|
|
|
#ifndef OPENRECIPEDIALOG_H
|
|
|
|
#define OPENRECIPEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2018-03-29 14:09:58 +00:00
|
|
|
#include <QMessageBox>
|
2018-03-30 14:20:09 +00:00
|
|
|
#include <QItemSelection>
|
2018-03-11 07:57:57 +00:00
|
|
|
|
2018-03-11 11:53:30 +00:00
|
|
|
#include "model/database/recipedatabase.h"
|
|
|
|
#include "model/recipe/recipetablemodel.h"
|
2018-03-30 12:33:48 +00:00
|
|
|
#include "model/recipe/ingredients/ingredientlistmodel.h"
|
|
|
|
#include "model/recipe/tags/taglistmodel.h"
|
2018-03-11 11:53:30 +00:00
|
|
|
|
2018-03-11 07:57:57 +00:00
|
|
|
namespace Ui {
|
|
|
|
class OpenRecipeDialog;
|
|
|
|
}
|
|
|
|
|
|
|
|
class OpenRecipeDialog : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit OpenRecipeDialog(QWidget *parent = 0);
|
2018-03-11 11:53:30 +00:00
|
|
|
OpenRecipeDialog(RecipeDatabase *recipeDB, QWidget *parent = 0);
|
2018-03-11 07:57:57 +00:00
|
|
|
~OpenRecipeDialog();
|
|
|
|
|
2018-03-29 14:09:58 +00:00
|
|
|
Recipe getSelectedRecipe();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void on_deleteRecipeButton_clicked();
|
|
|
|
|
|
|
|
void on_recipeTableView_doubleClicked(const QModelIndex &index);
|
|
|
|
|
2018-03-30 20:50:02 +00:00
|
|
|
void onTagsListViewSelectionChanged(const QItemSelection &selection);
|
|
|
|
|
|
|
|
void on_nameEdit_textChanged(const QString &arg1);
|
|
|
|
|
2018-03-31 10:53:31 +00:00
|
|
|
void on_clearSearchButton_clicked();
|
|
|
|
|
2018-03-31 12:01:57 +00:00
|
|
|
void on_exitButton_clicked();
|
|
|
|
|
2018-03-11 07:57:57 +00:00
|
|
|
private:
|
|
|
|
Ui::OpenRecipeDialog *ui;
|
2018-03-11 11:53:30 +00:00
|
|
|
RecipeDatabase *recipeDB;
|
|
|
|
RecipeTableModel recipeTableModel;
|
2018-03-29 14:09:58 +00:00
|
|
|
Recipe selectedRecipe;
|
2018-03-11 11:53:30 +00:00
|
|
|
|
2018-03-30 12:33:48 +00:00
|
|
|
TagListModel tagsModel;
|
|
|
|
|
2018-03-30 18:57:14 +00:00
|
|
|
void populateRecipesTable(vector<Recipe> recipes);
|
2018-03-30 12:33:48 +00:00
|
|
|
void populateTagsList();
|
2018-03-11 07:57:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OPENRECIPEDIALOG_H
|