More security and less unexpected behaviour. #8
			
				
			
		
		
		
	| 
						 | 
					@ -75,6 +75,7 @@ void NewRecipeDialog::on_addIngredientButton_clicked(){
 | 
				
			||||||
	UnitOfMeasure u = this->units[ui->unitComboBox->currentIndex()];
 | 
						UnitOfMeasure u = this->units[ui->unitComboBox->currentIndex()];
 | 
				
			||||||
	RecipeIngredient ri(i, ui->quantitySpinBox->value(), u, ui->commentsLineEdit->text().toStdString());
 | 
						RecipeIngredient ri(i, ui->quantitySpinBox->value(), u, ui->commentsLineEdit->text().toStdString());
 | 
				
			||||||
	this->ingredientListModel.addIngredient(ri);
 | 
						this->ingredientListModel.addIngredient(ri);
 | 
				
			||||||
 | 
						ui->commentsLineEdit->clear();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NewRecipeDialog::on_italicsButton_clicked(){
 | 
					void NewRecipeDialog::on_italicsButton_clicked(){
 | 
				
			||||||
| 
						 | 
					@ -150,6 +151,7 @@ void NewRecipeDialog::on_newIngredientButton_clicked(){
 | 
				
			||||||
		Ingredient i = d.getIngredient();
 | 
							Ingredient i = d.getIngredient();
 | 
				
			||||||
		this->recipeDB->storeIngredient(i);
 | 
							this->recipeDB->storeIngredient(i);
 | 
				
			||||||
		this->populateIngredientsBox();
 | 
							this->populateIngredientsBox();
 | 
				
			||||||
 | 
							ui->ingredientNameBox->setCurrentText(QString::fromStdString(i.getName()));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue