Files
krowlog/src/plugins/domain/rmenu.py
Andreas Huber a640b35c87 rename ravenlog to krowlog
There is a database named RavenDB.
KrowLog starts with a K, which is a) distinctive and b) has an association to KDE.
2022-02-12 10:48:38 +01:00

28 lines
693 B
Python

from typing import Callable
from src.plugins.domain.raction import RAction
class RMenu():
def __init__(self, label: str, icon_from_theme: str = ""):
super(RMenu, self).__init__()
self.label = label
self.actions = []
self.listeners = []
self.icon_from_theme = icon_from_theme;
def add_action(self, action: RAction):
self.actions.append(action)
self._notify()
def clear(self):
self.actions.clear()
self._notify()
def _notify(self):
for listener in self.listeners:
listener()
def add_change_listener(self, listener: Callable[[], None]):
self.listeners.append(listener)