add edit name

This commit is contained in:
Jannes Magnusson
2025-10-23 20:27:50 +02:00
parent 1e62bd77d1
commit 90257a62a0
6 changed files with 75 additions and 40 deletions

View File

@@ -88,25 +88,25 @@ class MainView(tk.Frame, ButtonInterface):
edit_recipe_command=self.enter_edit_recipe,
deactivate_command=self.enter_main_mode)
self.refresh(0.0)
def enter_edit_recipe(self, recipe: Recipe = None):
def enter_edit_recipe(self, recipe_id: int = None):
self.curr_mode = DISPLAY_MODES.EDIT_RECIPE
self.buttons.current_view = EditRecipe(self,
self.im_size, self.center,
recipe=recipe,
recipe_id=recipe_id,
recipe_manager=self.recipes_manager,
edit_step_command=self.enter_edit_step,
deactivate_command=self.enter_recipe_selection)
self.refresh(0.0)
def enter_edit_step(self, recipe: Recipe, step_idx: int):
def enter_edit_step(self, recipe_id: int, step_idx: int):
self.curr_mode = DISPLAY_MODES.EDIT_STEP
self.buttons.current_view = EditStep(self,
self.im_size, self.center,
recipe=recipe,
recipe_id=recipe_id,
step_index=step_idx,
recipe_manager=self.recipes_manager,
deactivate_command=lambda: self.enter_edit_recipe(recipe))
deactivate_command=lambda: self.enter_edit_recipe(recipe_id))
self.refresh(0.0)
################ VIEW MANAGEMENT ################