There is a database named RavenDB. KrowLog starts with a K, which is a) distinctive and b) has an association to KDE.
28 lines
693 B
Python
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)
|