Splitting reset into pre and post reset.
This commit is contained in:
@@ -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: []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user