RodTracker.ui.loggerwidget
TBD
- class LoggerWidget(*args, **kwargs)[source]
Bases:
QListWidgetA custom widget to maintain
ActionLoggerobjects and displayActionobjects in the GUI.This class maintains the
ActionLoggerobjects that are used in the program. It also manages the location for any temporary files that are program session specific. This widget displays the logged actions in the GUI. Use an instance of this class to create new loggers for other objects of the GUI that perform actions that can be logged or reverted.- Parameters:
*args (iterable) – Positional arguments for the
QListWidgetsuperclass.**kwargs (dict) – Keyword arguments for the
QListWidgetsuperclass.
Slots
- add_action(new_action: Action) None[source]
Adds a new action to the list being displayed in the GUI.
- get_new_logger(parent_id: str) ActionLogger[source]
Creates a new
ActionLogger, registers its signals for displaying the actions logged by it and returns it.- Parameters:
parent_id (str) – A unique name that indicates the object from which actions will be logged in the
ActionLogger.- Returns:
ActionLogger
- remove_action(undo_action: Action) None[source]
Removes an Action from the displayed list and deletes it.
- property repeatable_changes: List[Action]
Collects the repeatable changes from all loggers and returns them collectively.
An ordered list of all currently redoable/repeatable actions that were logged by the
ActionLoggerobjects maintained by thisLoggerWidgetinstance. Do NOT try to insert performed actions in here directly. This property only derives its contents from theActionLoggerobjects.- Returns:
List[Action]
- temp_manager: TemporaryDirectory
- property unsaved_changes: List[Action]
Collects the unsaved changes from all loggers and returns them collectively.
An ordered list of all actions that were logged by the
ActionLoggerobjects maintained by thisLoggerWidgetinstance. Do NOT try to insert performed actions in here directly. This property only derives its contents from theActionLoggerobjects.- Returns:
List[Action]