def connect(self): for name in self.wrappers.keys() if self._value else []: if has_event(self._value, name): slot = AdapterAwareSlot(self._value, partial(self._property_changed, name), name) slot.connect() self.register_slot(slot)
def set_device(self, device): if self._device != device: self._device = device self._on_device_parameters_changed.subject = self._device self._on_bank_names_changed.subject = self._device if has_event(self._device, 'bank_parameters_changed') else None self._items = self._create_items() self.notify_items() self.notify_selected_item()
def _connect(self, parent_object, name): if has_event(parent_object, name): slot = AdapterAwareSlot(parent_object, lambda *a: self._update_list(), name) slot.connect() self.register_slot(slot)