Skip to content

Commit

Permalink
classes/updates: Notify watchers when needed
Browse files Browse the repository at this point in the history
Co-authored-by: SuslikV <vx2010@i.ua>
  • Loading branch information
ferdnyc and SuslikV committed Jan 22, 2020
1 parent a8a641c commit a51640b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/classes/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ def reset(self):
self.actionHistory.clear()
self.redoHistory.clear()

# Notify watchers of new history state
self.update_watchers()

def add_listener(self, listener, index=-1):
""" Add a new listener (which will invoke the changed(action) method each time an UpdateAction is available). """

Expand Down Expand Up @@ -343,3 +346,6 @@ def apply_last_action_to_history(self, previous_value):
if self.last_action:
self.last_action.set_old_values(previous_value)
self.actionHistory.append(self.last_action)

# Notify watchers of new history state
self.update_watchers()

0 comments on commit a51640b

Please sign in to comment.