From 17797eeb5fdcbda352b078fb8850ed6354c68a1d Mon Sep 17 00:00:00 2001 From: andrewlalis Date: Tue, 22 May 2018 22:01:37 +0200 Subject: [PATCH] Removed food groups and ingredients from open recipe dialog. --- gui/openrecipedialog.cpp | 18 ------- gui/openrecipedialog.h | 7 --- gui/openrecipedialog.ui | 103 +-------------------------------------- 3 files changed, 2 insertions(+), 126 deletions(-) diff --git a/gui/openrecipedialog.cpp b/gui/openrecipedialog.cpp index 8f936da..6e3d474 100644 --- a/gui/openrecipedialog.cpp +++ b/gui/openrecipedialog.cpp @@ -8,13 +8,8 @@ OpenRecipeDialog::OpenRecipeDialog(QWidget *parent) : ui->setupUi(this); ui->recipeTableView->setModel(&this->recipeTableModel); - ui->ingredientsListView->setModel(&this->ingredientsModel); ui->tagsListView->setModel(&this->tagsModel); - QObject::connect(ui->ingredientsListView->selectionModel(), - SIGNAL(selectionChanged(QItemSelection, QItemSelection)), - this, - SLOT(onIngredientsListViewSelectionChanged(QItemSelection))); QObject::connect(ui->tagsListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, @@ -23,9 +18,7 @@ OpenRecipeDialog::OpenRecipeDialog(QWidget *parent) : OpenRecipeDialog::OpenRecipeDialog(RecipeDatabase *recipeDB, QWidget *parent) : OpenRecipeDialog(parent){ this->recipeDB = recipeDB; - this->populateIngredientsList(); this->populateTagsList(); - this->populateFoodGroupsList(); this->populateRecipesTable(this->recipeDB->retrieveAllRecipes()); } @@ -45,21 +38,10 @@ void OpenRecipeDialog::populateRecipesTable(vector recipes){ ui->recipeTableView->show(); } -void OpenRecipeDialog::populateIngredientsList(){ - this->ingredientsModel.setIngredients(this->recipeDB->retrieveAllIngredients()); -} - void OpenRecipeDialog::populateTagsList(){ this->tagsModel.setTags(this->recipeDB->retrieveAllTags()); } -void OpenRecipeDialog::populateFoodGroupsList(){ - for (string s : this->recipeDB->retrieveAllFoodGroups()){ - ui->foodGroupsListWidget->addItem(QString::fromStdString(s)); - } - //ui->foodGroupsListWidget->show(); -} - void OpenRecipeDialog::on_deleteRecipeButton_clicked(){ QItemSelectionModel *selectModel = ui->recipeTableView->selectionModel(); if (!selectModel->hasSelection()){ diff --git a/gui/openrecipedialog.h b/gui/openrecipedialog.h index c6cf23c..593cd2c 100644 --- a/gui/openrecipedialog.h +++ b/gui/openrecipedialog.h @@ -30,14 +30,10 @@ class OpenRecipeDialog : public QDialog void on_recipeTableView_doubleClicked(const QModelIndex &index); - void onIngredientsListViewSelectionChanged(const QItemSelection &selection); - void onTagsListViewSelectionChanged(const QItemSelection &selection); void on_nameEdit_textChanged(const QString &arg1); - void on_foodGroupsListWidget_itemSelectionChanged(); - void on_clearSearchButton_clicked(); void on_exitButton_clicked(); @@ -48,13 +44,10 @@ class OpenRecipeDialog : public QDialog RecipeTableModel recipeTableModel; Recipe selectedRecipe; - IngredientListModel ingredientsModel; TagListModel tagsModel; void populateRecipesTable(vector recipes); - void populateIngredientsList(); void populateTagsList(); - void populateFoodGroupsList(); }; #endif // OPENRECIPEDIALOG_H diff --git a/gui/openrecipedialog.ui b/gui/openrecipedialog.ui index 89ae5ea..7a1deef 100644 --- a/gui/openrecipedialog.ui +++ b/gui/openrecipedialog.ui @@ -48,7 +48,7 @@ 0 - + @@ -63,7 +63,7 @@ QTabWidget::Rounded - 2 + 0 @@ -119,105 +119,6 @@ - - - - :/images/images/ingredients.png:/images/images/ingredients.png - - - - - - Ingredients - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - QFrame::NoFrame - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::ScrollPerPixel - - - false - - - true - - - - - - - - - :/images/images/foodPyramid.png:/images/images/foodPyramid.png - - - - - - Food Groups - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QFrame::NoFrame - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::ScrollPerPixel - - - true - - - - -