An activity where an existing recipe can be edited. More...
Inherits Foodolini::Activities::IActivity.
Public Member Functions | |
RecipeEditor () | |
A constructor that sets up the nodeview. | |
void | SetParamenters (Recipe recipe) |
Method called to set the recipe to be editted. Sets the details of the recipe in the entries. | |
void | Register (IOwner owner) |
Subscribe to the events exposed by owner, and store a reference to owner. | |
void | Unregister () |
Unsubscribe to the events exposed by owner, and loose any references to owner. | |
Protected Member Functions | |
virtual void | Build () |
virtual void | OnAddIngredient (object sender, System.EventArgs e) |
Opens a dialog where a new ingredient and the amount can be selected and added to the Recipe opon saving. | |
virtual void | OnBtnNewSaveClicked (object sender, System.EventArgs e) |
virtual void | OnCancelClick (object sender, System.EventArgs e) |
Pops the activity when Cancel is clicked. | |
virtual void | OnDeleteIngredientClick (object sender, System.EventArgs e) |
Removes the selected ingredient form the list. If no ingredients are left, the variable ingredientsAdded is set to false. CheckIfFilled() is called at the end. | |
virtual void | OnEntryChanged (object sender, System.EventArgs e) |
Event called when an entry has been changed. Calls CheckIfFilled(). | |
virtual void | OnSaveClicked (object sender, System.EventArgs e) |
If no ingredients or recipes has the same name except the current recipe, the recipe is saved in the database. If there is, a dialog warns the user about this, and askes to change the title. Button is only active when the title, the categories, the directions and Ingrediens have been set. | |
virtual void | OnSelectPictureClick (object sender, System.EventArgs e) |
Previews the Recipe image when selected in the filechooserwidget. | |
virtual void | OnTvDirectionsKeyReleaseEvent (object o, Gtk.KeyReleaseEventArgs args) |
Event called when directions have changed. Calls CheckIfFilled(). | |
Properties | |
Recipe | Recipe [get] |
Widget | Widget [get] |
Events | |
EventHandler< RecipeEventArgs > | OnRecipeEdited |
An activity where an existing recipe can be edited.
Definition at line 14 of file Foodolini.Activities.RecipeEditor.cs.
Foodolini.Activities.RecipeEditor.RecipeEditor | ( | ) |
A constructor that sets up the nodeview.
Definition at line 27 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.Build | ( | ) | [protected, virtual] |
Definition at line 106 of file Foodolini.Activities.RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnAddIngredient | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Opens a dialog where a new ingredient and the amount can be selected and added to the Recipe opon saving.
Definition at line 84 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnBtnNewSaveClicked | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Definition at line 98 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnCancelClick | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Pops the activity when Cancel is clicked.
Definition at line 121 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnDeleteIngredientClick | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Removes the selected ingredient form the list. If no ingredients are left, the variable ingredientsAdded is set to false. CheckIfFilled() is called at the end.
Definition at line 131 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnEntryChanged | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Event called when an entry has been changed. Calls CheckIfFilled().
Definition at line 146 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnSaveClicked | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
If no ingredients or recipes has the same name except the current recipe, the recipe is saved in the database. If there is, a dialog warns the user about this, and askes to change the title. Button is only active when the title, the categories, the directions and Ingrediens have been set.
Definition at line 156 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnSelectPictureClick | ( | object | sender, | |
System.EventArgs | e | |||
) | [protected, virtual] |
Previews the Recipe image when selected in the filechooserwidget.
Definition at line 276 of file RecipeEditor.cs.
virtual void Foodolini.Activities.RecipeEditor.OnTvDirectionsKeyReleaseEvent | ( | object | o, | |
Gtk.KeyReleaseEventArgs | args | |||
) | [protected, virtual] |
Event called when directions have changed. Calls CheckIfFilled().
Definition at line 290 of file RecipeEditor.cs.
void Foodolini.Activities.RecipeEditor.Register | ( | IOwner | owner | ) |
Subscribe to the events exposed by owner, and store a reference to owner.
owner | Instance of an implementation of IOwner |
Implements Foodolini.Activities.IActivity.
Definition at line 364 of file RecipeEditor.cs.
void Foodolini.Activities.RecipeEditor.SetParamenters | ( | Recipe | recipe | ) |
Method called to set the recipe to be editted. Sets the details of the recipe in the entries.
recipe | A Recipe |
Definition at line 301 of file RecipeEditor.cs.
void Foodolini.Activities.RecipeEditor.Unregister | ( | ) |
Unsubscribe to the events exposed by owner, and loose any references to owner.
Implements Foodolini.Activities.IActivity.
Definition at line 368 of file RecipeEditor.cs.
Recipe Foodolini.Activities.RecipeEditor.Recipe [get] |
Definition at line 359 of file RecipeEditor.cs.
Widget Foodolini.Activities.RecipeEditor.Widget [get] |
Implements Foodolini.Activities.IActivity.
Definition at line 374 of file RecipeEditor.cs.
EventHandler<RecipeEventArgs> Foodolini.Activities.RecipeEditor.OnRecipeEdited |
Definition at line 66 of file RecipeEditor.cs.