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 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 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 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
 
 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 115 of file updates.py.

Constructor & Destructor Documentation

def updates.UpdateManager.__init__ (   self)

Definition at line 117 of file updates.py.

Member Function Documentation

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 132 of file updates.py.

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 146 of file updates.py.

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 263 of file updates.py.

def updates.UpdateManager.dispatch_action (   self,
  action 
)

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

Definition at line 223 of file updates.py.

def updates.UpdateManager.get_reverse_action (   self,
  action 
)

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

'insert' becomes an 'delete')

Definition at line 169 of file updates.py.

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 247 of file updates.py.

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 238 of file updates.py.

def updates.UpdateManager.redo (   self)

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

Definition at line 206 of file updates.py.

def updates.UpdateManager.reset (   self)

Reset the UpdateManager, and clear all UpdateActions and History.

This does not clear listeners and watchers.

Definition at line 126 of file updates.py.

def updates.UpdateManager.undo (   self)

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

Definition at line 195 of file updates.py.

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 255 of file updates.py.

def updates.UpdateManager.update_watchers (   self)

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

Definition at line 155 of file updates.py.

Member Data Documentation

updates.UpdateManager.actionHistory

Definition at line 120 of file updates.py.

updates.UpdateManager.currentStatus

Definition at line 122 of file updates.py.

updates.UpdateManager.redoHistory

Definition at line 121 of file updates.py.

updates.UpdateManager.statusWatchers

Definition at line 118 of file updates.py.

updates.UpdateManager.updateListeners

Definition at line 119 of file updates.py.


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