Splitting reset into pre and post reset.

This commit is contained in:
2020-01-02 13:15:04 +01:00
parent 4bac269257
commit 00827e7b0b
2 changed files with 26 additions and 3 deletions

View File

@@ -21,13 +21,26 @@ class Model:
self.translation = None
self.sense = None
# choosing examples
self.chosen_examples = []
self.reset()
self.modal_reset()
def reset(self):
# do both resets at once
self.pre_reset()
self.post_reset()
def pre_reset(self):
# the reset before updating models
self.menu_target = None
self.modal_shown = False
def post_reset(self):
# the reset after updating the models
self.chosen_examples = []
def modal_reset(self):
self.modal = lambda: []