def __init__(self, menu, object_path, bus=None): if bus is None: bus = dbus.SessionBus() Object.__init__(self, bus, object_path) self.status = 'normal' self.menu = menu self.revision = 0
def __init__(self, notifier, **kw): global _status_item_menu_count self.notifier = notifier bus = kw.get('bus') if bus is None: bus = kw['bus'] = dbus.SessionBus() self.name = '%s-%s-%s' % (self.IFACE, os.getpid(), kw.get('num', 1)) self.dbus_name = BusName(self.name, bus=bus, do_not_queue=True) self.app_id = kw.get('app_id') or QApplication.instance().applicationName() or 'unknown_application' self.category = kw.get('category') or 'ApplicationStatus' self.title = kw.get('title') or self.app_id Object.__init__(self, bus, '/' + self.IFACE.split('.')[-1]) _status_item_menu_count += 1 self.dbus_menu = DBusMenu('/StatusItemMenu/%d' % _status_item_menu_count, bus=bus, parent=kw.get('parent'))
def __init__(self, notifier, **kw): self.notifier = notifier bus = kw.get('bus') if bus is None: bus = dbus.SessionBus() self.name = '%s-%s-%s' % (self.IFACE, os.getpid(), kw.get('num', 1)) self.dbus_name = BusName(self.name, bus=bus, do_not_queue=True) self.app_id = kw.get('app_id', QApplication.instance().applicationName()) or 'unknown_application' self.category = kw.get('category', 'ApplicationStatus') self.title = kw.get('title', self.app_id) self.icon_serialization = qicon_to_sni_image_list(notifier.icon()) Object.__init__(self, bus, '/' + self.IFACE.split('.')[-1]) for name, val in vars(self.__class__).iteritems(): if getattr(val, '_dbus_is_signal', False): getattr(notifier, name).connect(getattr(self, name))