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
|
|
@ -109,15 +109,15 @@ class MainWindow(QtMainWindow):
|
|||
|
||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addVideo)
|
||||
self.process.do(self.app._do_complete, 20, (), 'search_videos', pattern, self.ui.sortbyEdit.currentIndex(), nsfw=True, backends=backend_name)
|
||||
|
||||
def addVideo(self, backend, video):
|
||||
if not backend:
|
||||
def finished():
|
||||
self.ui.searchEdit.setEnabled(True)
|
||||
self.process = None
|
||||
return
|
||||
minivideo = MiniVideo(self.weboob, backend, video)
|
||||
|
||||
self.process = QtDo(self.weboob, self.addVideo, fb=finished)
|
||||
self.process.do(self.app._do_complete, 20, (), 'search_videos', pattern, self.ui.sortbyEdit.currentIndex(), nsfw=True, backends=backend_name)
|
||||
|
||||
def addVideo(self, video):
|
||||
minivideo = MiniVideo(self.weboob, self.weboob[video.backend], video)
|
||||
self.ui.scrollAreaContent.layout().addWidget(minivideo)
|
||||
self.minivideos.append(minivideo)
|
||||
if (video.nsfw and not self.ui.nsfwCheckBox.isChecked() or
|
||||
|
|
|
|||
|
|
@ -47,10 +47,7 @@ class MiniVideo(QFrame):
|
|||
self.process_thumbnail = QtDo(self.weboob, self.gotThumbnail)
|
||||
self.process_thumbnail.do('fillobj', self.video, ['thumbnail'], backends=backend)
|
||||
|
||||
def gotThumbnail(self, backend, video):
|
||||
if not backend:
|
||||
return
|
||||
|
||||
def gotThumbnail(self, video):
|
||||
if video.thumbnail and video.thumbnail.data:
|
||||
img = QImage.fromData(video.thumbnail.data)
|
||||
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue