start adding edit_step
This commit is contained in:
@@ -11,7 +11,7 @@ from . import NumberView, CircleView, TimerView
|
||||
from .button_interface import ButtonInterface
|
||||
from .buttons_manager import ButtonsManager
|
||||
|
||||
from .recipes import RecipeSelection, RecipeManager, EditRecipe, Recipe
|
||||
from .recipes import RecipeSelection, RecipeManager, EditRecipe, Recipe, EditStep
|
||||
|
||||
class MainView(tk.Frame, ButtonInterface):
|
||||
def __init__(self, parent,
|
||||
@@ -92,10 +92,21 @@ class MainView(tk.Frame, ButtonInterface):
|
||||
def enter_edit_recipe(self, recipe: Recipe = None):
|
||||
self.curr_mode = DISPLAY_MODES.EDIT_RECIPE
|
||||
self.buttons.current_view = EditRecipe(self,
|
||||
self.im_size, self.center,
|
||||
recipe=recipe,
|
||||
recipe_manager=self.recipes_manager,
|
||||
deactivate_command=self.enter_recipe_selection)
|
||||
self.im_size, self.center,
|
||||
recipe=recipe,
|
||||
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):
|
||||
self.curr_mode = DISPLAY_MODES.EDIT_STEP
|
||||
self.buttons.current_view = EditStep(self,
|
||||
self.im_size, self.center,
|
||||
recipe=recipe,
|
||||
step_index=step_idx,
|
||||
recipe_manager=self.recipes_manager,
|
||||
deactivate_command=lambda: self.enter_edit_recipe(recipe))
|
||||
self.refresh(0.0)
|
||||
|
||||
################ VIEW MANAGEMENT ################
|
||||
|
||||
Reference in New Issue
Block a user