OpenShot Video Editor  2.0.0
Public Member Functions | Public Attributes | List of all members
updates.UpdateManager Class Reference

This class is used to track and distribute changes to listeners. More...

Public Member Functions

def __init__ (self)
 
def add_listener (self, listener, index=-1)
 Add a new listener (which will invoke the changed(action) method each time an UpdateAction is available). More...
 
def add_watcher (self, watcher)
 Add a new watcher (which will invoke the updateStatusChanged() method each time a 'redo' or 'undo' action is available). More...
 
def apply_last_action_to_history (self, previous_value)
 Apply the last action to the history. More...
 
def delete (self, key)
 Delete an item from the UpdateManager with an UpdateAction (this action will then be distributed to all listeners) More...
 
def dispatch_action (self, action)
 Distribute changes to all listeners (by calling their changed() method) More...
 
def get_reverse_action (self, action)
 Convert an UpdateAction into the opposite type (i.e. More...
 
def insert (self, key, values)
 Insert a new UpdateAction into the UpdateManager (this action will then be distributed to all listeners) More...
 
def load (self, values)
 Load all project data via an UpdateAction into the UpdateManager (this action will then be distributed to all listeners) More...
 
def load_history (self, project)
 Load history from project. More...
 
def redo (self)
 Redo the last UpdateAction (and notify all listeners and watchers) More...
 
def reset (self)
 Reset the UpdateManager, and clear all UpdateActions and History. More...
 
def save_history (self, project, history_length)
 Save history to project. More...
 
def undo (self)
 Undo the last UpdateAction (and notify all listeners and watchers) More...
 
def update (self, key, values, partial_update=False)
 Update the UpdateManager with an UpdateAction (this action will then be distributed to all listeners) More...
 
def update_watchers (self)
 Notify all watchers if any 'undo' or 'redo' actions are available. More...
 

Public Attributes

 actionHistory
 
 currentStatus
 
 ignore_history
 
 last_action
 
 redoHistory
 
 statusWatchers
 
 updateListeners
 

Detailed Description

This class is used to track and distribute changes to listeners.

Typically, only 1 instance of this class is needed, and many different listeners are connected with the add_listener() method.

Definition at line 117 of file updates.py.

Constructor & Destructor Documentation

◆ __init__()

def updates.UpdateManager.__init__ (   self)

Definition at line 119 of file updates.py.

Member Function Documentation

◆ add_listener()

def updates.UpdateManager.add_listener (   self,
  listener,
  index = -1 
)

Add a new listener (which will invoke the changed(action) method each time an UpdateAction is available).

Definition at line 176 of file updates.py.

◆ add_watcher()

def updates.UpdateManager.add_watcher (   self,
  watcher 
)

Add a new watcher (which will invoke the updateStatusChanged() method each time a 'redo' or 'undo' action is available).

Definition at line 190 of file updates.py.

◆ apply_last_action_to_history()

def updates.UpdateManager.apply_last_action_to_history (   self,
  previous_value 
)

Apply the last action to the history.

Definition at line 328 of file updates.py.

◆ delete()

def updates.UpdateManager.delete (   self,
  key 
)

Delete an item from the UpdateManager with an UpdateAction (this action will then be distributed to all listeners)

Definition at line 318 of file updates.py.

◆ dispatch_action()

def updates.UpdateManager.dispatch_action (   self,
  action 
)

Distribute changes to all listeners (by calling their changed() method)

Definition at line 272 of file updates.py.

◆ get_reverse_action()

def updates.UpdateManager.get_reverse_action (   self,
  action 
)

Convert an UpdateAction into the opposite type (i.e.

'insert' becomes an 'delete')

Definition at line 213 of file updates.py.

◆ insert()

def updates.UpdateManager.insert (   self,
  key,
  values 
)

Insert a new UpdateAction into the UpdateManager (this action will then be distributed to all listeners)

Definition at line 298 of file updates.py.

◆ load()

def updates.UpdateManager.load (   self,
  values 
)

Load all project data via an UpdateAction into the UpdateManager (this action will then be distributed to all listeners)

Definition at line 287 of file updates.py.

◆ load_history()

def updates.UpdateManager.load_history (   self,
  project 
)

Load history from project.

Definition at line 130 of file updates.py.

◆ redo()

def updates.UpdateManager.redo (   self)

Redo the last UpdateAction (and notify all listeners and watchers)

Definition at line 255 of file updates.py.

◆ reset()

def updates.UpdateManager.reset (   self)

Reset the UpdateManager, and clear all UpdateActions and History.

This does not clear listeners and watchers.

Definition at line 170 of file updates.py.

◆ save_history()

def updates.UpdateManager.save_history (   self,
  project,
  history_length 
)

Save history to project.

Definition at line 152 of file updates.py.

◆ undo()

def updates.UpdateManager.undo (   self)

Undo the last UpdateAction (and notify all listeners and watchers)

Definition at line 242 of file updates.py.

◆ update()

def updates.UpdateManager.update (   self,
  key,
  values,
  partial_update = False 
)

Update the UpdateManager with an UpdateAction (this action will then be distributed to all listeners)

Definition at line 308 of file updates.py.

◆ update_watchers()

def updates.UpdateManager.update_watchers (   self)

Notify all watchers if any 'undo' or 'redo' actions are available.

Definition at line 199 of file updates.py.

Member Data Documentation

◆ actionHistory

updates.UpdateManager.actionHistory

Definition at line 122 of file updates.py.

◆ currentStatus

updates.UpdateManager.currentStatus

Definition at line 124 of file updates.py.

◆ ignore_history

updates.UpdateManager.ignore_history

Definition at line 125 of file updates.py.

◆ last_action

updates.UpdateManager.last_action

Definition at line 126 of file updates.py.

◆ redoHistory

updates.UpdateManager.redoHistory

Definition at line 123 of file updates.py.

◆ statusWatchers

updates.UpdateManager.statusWatchers

Definition at line 120 of file updates.py.

◆ updateListeners

updates.UpdateManager.updateListeners

Definition at line 121 of file updates.py.


The documentation for this class was generated from the following file: