Moved mirage2 to use newer GTK template structure patterns
This commit is contained in:
29
src/libs/controllers/emit_dispatcher.py
Normal file
29
src/libs/controllers/emit_dispatcher.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
from ..dto.base_event import BaseEvent
|
||||
|
||||
|
||||
|
||||
class EmitDispatcher:
|
||||
"""
|
||||
EmitDispatcher is used for allowing controllers to pass/hook in
|
||||
their message system to children that need to signal events.
|
||||
Note how we are not handling return info from the 'message' methods
|
||||
whereas a controller would or could do so.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(EmitDispatcher, self).__init__()
|
||||
|
||||
|
||||
def emit(self, event: BaseEvent):
|
||||
self.message(event)
|
||||
|
||||
def emit_to(self, controller: str, event: BaseEvent):
|
||||
self.message_to(controller, event)
|
||||
|
||||
def emit_to_selected(self, names: list[str], event: BaseEvent):
|
||||
self.message_to_selected(names, event)
|
||||
Reference in New Issue
Block a user