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__
 
def add_listener
 Add a new listener (which will invoke the changed(action) method each time an UpdateAction is available). More...
 
def add_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
 Apply the last action to the history. More...
 
def delete
 Delete an item from the UpdateManager with an UpdateAction (this action will then be distributed to all listeners) More...
 
def dispatch_action
 Distribute changes to all listeners (by calling their changed() method) More...
 
def get_reverse_action
 Convert an UpdateAction into the opposite type (i.e. More...
 
def insert
 Insert a new UpdateAction into the UpdateManager (this action will then be distributed to all listeners) More...
 
def load
 Load all project data via an UpdateAction into the UpdateManager (this action will then be distributed to all listeners) More...
 
def load_history
 Load history from project. More...
 
def redo
 Redo the last UpdateAction (and notify all listeners and watchers) More...
 
def reset
 Reset the UpdateManager, and clear all UpdateActions and History. More...
 
def save_history
 Save history to project. More...
 
def undo
 Undo the last UpdateAction (and notify all listeners and watchers) More...
 
def update
 Update the UpdateManager with an UpdateAction (this action will then be distributed to all listeners) More...
 
def update_watchers
 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 121 of file updates.py.

Constructor & Destructor Documentation

def updates.UpdateManager.__init__ (   self)

Definition at line 123 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 182 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 196 of file updates.py.

def updates.UpdateManager.apply_last_action_to_history (   self,
  previous_value 
)

Apply the last action to the history.

Definition at line 332 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 322 of file updates.py.

def updates.UpdateManager.dispatch_action (   self,
  action 
)

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

Definition at line 278 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 219 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 302 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 293 of file updates.py.

def updates.UpdateManager.load_history (   self,
  project 
)

Load history from project.

Definition at line 134 of file updates.py.

def updates.UpdateManager.redo (   self)

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

Definition at line 261 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 176 of file updates.py.

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

Save history to project.

Definition at line 158 of file updates.py.

def updates.UpdateManager.undo (   self)

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

Definition at line 248 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 312 of file updates.py.

def updates.UpdateManager.update_watchers (   self)

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

Definition at line 205 of file updates.py.

Member Data Documentation

updates.UpdateManager.actionHistory

Definition at line 126 of file updates.py.

updates.UpdateManager.currentStatus

Definition at line 128 of file updates.py.

updates.UpdateManager.ignore_history

Definition at line 129 of file updates.py.

updates.UpdateManager.last_action

Definition at line 130 of file updates.py.

updates.UpdateManager.redoHistory

Definition at line 127 of file updates.py.

updates.UpdateManager.statusWatchers

Definition at line 124 of file updates.py.

updates.UpdateManager.updateListeners

Definition at line 125 of file updates.py.


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