def __init__(self, parent, *args, **kwargs): """""" AddonCore.__init__(self) self.name = _("Clipboard") self.event_id = None self.clipboard_monitor = Clipboard(parent) self.parent = parent self.config = conf
class Addon(AddonCore): """""" def __init__(self, parent, *args, **kwargs): """""" AddonCore.__init__(self) self.name = _("Clipboard") self.event_id = None self.clipboard_monitor = Clipboard(parent) self.parent = parent self.config = conf def set_menu_item(self): self.action = self.parent.menu.addAction(_("Clipboard watcher"), self.on_toggle) #can toggle self.action.setCheckable(True) if self.config.get_clipboard_active(): self.action.setChecked(True) self.clipboard_monitor.enable() def get_preferences(self): """""" return Preferences() def on_toggle(self): if self.action.isChecked(): #se activo self.config.set_clipboard_active("True") self.clipboard_monitor.enable() else: self.config.set_clipboard_active("False") self.clipboard_monitor.disable()
def __init__(self, parent, *args, **kwargs): """""" AddonCore.__init__(self, parent) self.name = _("Clipboard") self.clipboard_monitor = Clipboard()