[qcineoob] casting almost done
This commit is contained in:
parent
e2ac58ae4f
commit
a7be6ee6f4
6 changed files with 81 additions and 19 deletions
|
|
@ -91,6 +91,21 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.backButton.setDisabled(True)
|
||||
return todo['function'](*todo['args'])
|
||||
|
||||
def castingAction(self, id, role):
|
||||
self.ui.stackedWidget.setCurrentWidget(self.ui.person_list_page)
|
||||
for miniperson in self.minipersons:
|
||||
self.ui.person_list_content.layout().removeWidget(miniperson)
|
||||
miniperson.hide()
|
||||
miniperson.deleteLater()
|
||||
|
||||
self.minipersons = []
|
||||
self.ui.searchEdit.setEnabled(False)
|
||||
|
||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addPerson)
|
||||
self.process.do('iter_movie_persons', id, role, backends=backend_name)
|
||||
|
||||
def search(self):
|
||||
tosearch = self.ui.typeCombo.currentText()
|
||||
if tosearch == 'person':
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ class MiniMovie(QFrame):
|
|||
self.ui.shortDescLabel.setText(movie.short_description)
|
||||
self.ui.backendLabel.setText(backend.name)
|
||||
|
||||
self.process_thumbnail = QtDo(self.weboob, self.gotThumbnail)
|
||||
self.process_thumbnail.do('fillobj', self.movie, ['thumbnail_url'], backends=backend)
|
||||
#self.process_thumbnail = QtDo(self.weboob, self.gotThumbnail)
|
||||
#self.process_thumbnail.do('fillobj', self.movie, ['thumbnail_url'], backends=backend)
|
||||
|
||||
def gotThumbnail(self, backend, movie):
|
||||
if self.movie.thumbnail_url != NotAvailable:
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ class MiniPerson(QFrame):
|
|||
self.weboob = weboob
|
||||
self.backend = backend
|
||||
self.person = person
|
||||
self.ui.nameLabel.setText(person.name)
|
||||
self.ui.shortDescLabel.setText(person.short_description)
|
||||
self.ui.nameLabel.setText('%s'%person.name)
|
||||
self.ui.shortDescLabel.setText('%s'%person.short_description)
|
||||
self.ui.backendLabel.setText(backend.name)
|
||||
|
||||
self.process_thumbnail = QtDo(self.weboob, self.gotThumbnail)
|
||||
self.process_thumbnail.do('fillobj', self.person, ['thumbnail_url'], backends=backend)
|
||||
#self.process_thumbnail = QtDo(self.weboob, self.gotThumbnail)
|
||||
#self.process_thumbnail.do('fillobj', self.person, ['thumbnail_url'], backends=backend)
|
||||
|
||||
def gotThumbnail(self, backend, person):
|
||||
if self.person.thumbnail_url != NotAvailable:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import urllib
|
||||
|
||||
from PyQt4.QtCore import QUrl,Qt
|
||||
from PyQt4.QtCore import QUrl,Qt,SIGNAL
|
||||
from PyQt4.QtGui import QFrame, QImage, QPixmap
|
||||
|
||||
from weboob.applications.qcineoob.ui.movie_ui import Ui_Movie
|
||||
|
|
@ -32,6 +32,8 @@ class Movie(QFrame):
|
|||
self.ui = Ui_Movie()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
self.connect(self.ui.castingButton, SIGNAL("clicked()"), self.casting)
|
||||
|
||||
self.movie = movie
|
||||
self.ui.titleLabel.setText(movie.original_title)
|
||||
self.ui.durationLabel.setText(unicode(movie.duration))
|
||||
|
|
@ -54,3 +56,10 @@ class Movie(QFrame):
|
|||
img = QImage.fromData(data)
|
||||
self.ui.imageLabel.setPixmap(QPixmap.fromImage(img))
|
||||
|
||||
def casting(self):
|
||||
role = None
|
||||
tosearch = self.ui.castingCombo.currentText()
|
||||
if tosearch != 'all':
|
||||
role = tosearch[:-1]
|
||||
self.parent.doAction(self.parent.castingAction,[self.movie.id,role])
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<width>700</width>
|
||||
<height>463</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -87,7 +87,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<width>660</width>
|
||||
<height>313</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -109,8 +109,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>313</height>
|
||||
<width>63</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8"/>
|
||||
|
|
@ -131,8 +131,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>313</height>
|
||||
<width>63</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5"/>
|
||||
|
|
@ -153,8 +153,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>313</height>
|
||||
<width>63</width>
|
||||
<height>18</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4"/>
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<width>700</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>428</width>
|
||||
<height>490</height>
|
||||
<width>434</width>
|
||||
<height>552</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="imageLabel">
|
||||
<property name="text">
|
||||
|
|
@ -54,6 +54,44 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_10">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QPushButton" name="castingButton">
|
||||
<property name="text">
|
||||
<string>view casting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="castingCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>all</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>actors</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>directors</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue