fix bcall to to new behavior of do(), and fix QtDo too, and all Qt applications...
This commit is contained in:
parent
7339258978
commit
b1f20b5489
16 changed files with 222 additions and 250 deletions
|
|
@ -66,7 +66,11 @@ class EventsWidget(QWidget):
|
|||
self.ui.typeBox.setEnabled(False)
|
||||
self.ui.typeBox.clear()
|
||||
self.ui.typeBox.addItem('All', None)
|
||||
self.process = QtDo(self.weboob, self.gotEvent)
|
||||
def finished():
|
||||
self.ui.refreshButton.setEnabled(True)
|
||||
self.ui.typeBox.setEnabled(True)
|
||||
|
||||
self.process = QtDo(self.weboob, self.gotEvent, fb=finished)
|
||||
self.process.do('iter_events')
|
||||
|
||||
def setPhoto(self, contact, item):
|
||||
|
|
@ -91,12 +95,7 @@ class EventsWidget(QWidget):
|
|||
|
||||
return False
|
||||
|
||||
def gotEvent(self, backend, event):
|
||||
if not backend:
|
||||
self.ui.refreshButton.setEnabled(True)
|
||||
self.ui.typeBox.setEnabled(True)
|
||||
return
|
||||
|
||||
def gotEvent(self, event):
|
||||
found = False
|
||||
for i in xrange(self.ui.typeBox.count()):
|
||||
s = self.ui.typeBox.itemData(i)
|
||||
|
|
@ -111,6 +110,9 @@ class EventsWidget(QWidget):
|
|||
if self.event_filter and self.event_filter != event.type:
|
||||
return
|
||||
|
||||
if not event.contact:
|
||||
return
|
||||
|
||||
contact = event.contact
|
||||
contact.backend = event.backend
|
||||
status = ''
|
||||
|
|
@ -139,13 +141,13 @@ class EventsWidget(QWidget):
|
|||
item = QTreeWidgetItem(None, [name, date, type, message])
|
||||
item.setData(0, Qt.UserRole, event)
|
||||
if contact.photos is NotLoaded:
|
||||
process = QtDo(self.weboob, lambda b, c: self.setPhoto(c, item))
|
||||
process = QtDo(self.weboob, lambda c: self.setPhoto(c, item))
|
||||
process.do('fillobj', contact, ['photos'], backends=contact.backend)
|
||||
self.photo_processes[contact.id] = process
|
||||
elif len(contact.photos) > 0:
|
||||
if not self.setPhoto(contact, item):
|
||||
photo = contact.photos.values()[0]
|
||||
process = QtDo(self.weboob, lambda b, p: self.setPhoto(contact, item))
|
||||
process = QtDo(self.weboob, lambda p: self.setPhoto(contact, item))
|
||||
process.do('fillobj', photo, ['thumbnail_data'], backends=contact.backend)
|
||||
self.photo_processes[contact.id] = process
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue