[qcineoob] movie releases and person biography integrated
This commit is contained in:
parent
1c7e7b9dec
commit
1432ce1ce0
7 changed files with 100 additions and 21 deletions
|
|
@ -191,13 +191,13 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.list_content.layout().addWidget(minimovie)
|
||||
self.minis.append(minimovie)
|
||||
|
||||
def displayMovie(self, movie):
|
||||
def displayMovie(self, movie, backend):
|
||||
self.ui.stackedWidget.setCurrentWidget(self.ui.info_page)
|
||||
if self.current_info_widget != None:
|
||||
self.ui.info_content.layout().removeWidget(self.current_info_widget)
|
||||
self.current_info_widget.hide()
|
||||
self.current_info_widget.deleteLater()
|
||||
wmovie = Movie(movie,self)
|
||||
wmovie = Movie(movie,backend,self)
|
||||
self.ui.info_content.layout().addWidget(wmovie)
|
||||
self.current_info_widget = wmovie
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
|
@ -234,13 +234,13 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.list_content.layout().addWidget(miniperson)
|
||||
self.minis.append(miniperson)
|
||||
|
||||
def displayPerson(self, person):
|
||||
def displayPerson(self, person, backend):
|
||||
self.ui.stackedWidget.setCurrentWidget(self.ui.info_page)
|
||||
if self.current_info_widget != None:
|
||||
self.ui.info_content.layout().removeWidget(self.current_info_widget)
|
||||
self.current_info_widget.hide()
|
||||
self.current_info_widget.deleteLater()
|
||||
wperson = Person(person,self)
|
||||
wperson = Person(person,backend,self)
|
||||
self.ui.info_content.layout().addWidget(wperson)
|
||||
self.current_info_widget = wperson
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
|
|
|||
|
|
@ -63,4 +63,4 @@ class MiniMovie(QFrame):
|
|||
QApplication.setOverrideCursor( Qt.WaitCursor )
|
||||
movie = self.backend.get_movie(self.movie.id)
|
||||
if movie:
|
||||
self.parent.doAction('Details of movie "%s"'%movie.original_title,self.parent.displayMovie,[movie])
|
||||
self.parent.doAction('Details of movie "%s"'%movie.original_title,self.parent.displayMovie,[movie,self.backend])
|
||||
|
|
|
|||
|
|
@ -69,4 +69,4 @@ class MiniPerson(QFrame):
|
|||
QApplication.setOverrideCursor( Qt.WaitCursor )
|
||||
person = self.backend.get_person(self.person.id)
|
||||
if person:
|
||||
self.parent.doAction(u'Details of person "%s"'%person.name,self.parent.displayPerson,[person])
|
||||
self.parent.doAction(u'Details of person "%s"'%person.name,self.parent.displayPerson,[person,self.backend])
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ from weboob.capabilities.base import NotAvailable
|
|||
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||
|
||||
class Movie(QFrame):
|
||||
def __init__(self, movie, parent=None):
|
||||
def __init__(self, movie, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.ui = Ui_Movie()
|
||||
|
|
@ -42,21 +42,27 @@ class Movie(QFrame):
|
|||
self.connect(self.ui.subtitleButton, SIGNAL("clicked()"), self.searchSubtitle)
|
||||
|
||||
self.movie = movie
|
||||
self.backend = backend
|
||||
self.ui.titleLabel.setText(movie.original_title)
|
||||
self.ui.durationLabel.setText(unicode(movie.duration))
|
||||
self.gotThumbnail()
|
||||
self.putReleases()
|
||||
|
||||
if movie.other_titles != NotAvailable:
|
||||
self.ui.otherTitlesPlain.setPlainText('\n'.join(movie.other_titles))
|
||||
if movie.release_date != NotAvailable:
|
||||
self.ui.releaseDateLabel.setText(movie.release_date.isoformat())
|
||||
self.ui.durationLabel.setText('%s'%movie.duration)
|
||||
self.ui.durationLabel.setText('%s min'%movie.duration)
|
||||
self.ui.pitchPlain.setPlainText('%s'%movie.pitch)
|
||||
self.ui.countryLabel.setText('%s'%movie.country)
|
||||
self.ui.noteLabel.setText('%s'%movie.note)
|
||||
|
||||
self.ui.verticalLayout.setAlignment(Qt.AlignTop)
|
||||
|
||||
def putReleases(self):
|
||||
rel = self.backend.get_movie_releases(self.movie.id)
|
||||
self.ui.allReleasesPlain.setPlainText(rel)
|
||||
|
||||
def gotThumbnail(self):
|
||||
if self.movie.thumbnail_url != NotAvailable:
|
||||
data = urllib.urlopen(self.movie.thumbnail_url).read()
|
||||
|
|
|
|||
|
|
@ -19,22 +19,24 @@
|
|||
|
||||
import urllib
|
||||
|
||||
from PyQt4.QtCore import SIGNAL
|
||||
from PyQt4.QtGui import QFrame, QImage, QPixmap
|
||||
from PyQt4.QtCore import SIGNAL, Qt
|
||||
from PyQt4.QtGui import QFrame, QImage, QPixmap, QApplication
|
||||
|
||||
from weboob.applications.qcineoob.ui.person_ui import Ui_Person
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
|
||||
class Person(QFrame):
|
||||
def __init__(self, person, parent=None):
|
||||
def __init__(self, person, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
self.parent = parent
|
||||
self.ui = Ui_Person()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
self.connect(self.ui.filmographyButton, SIGNAL("clicked()"), self.filmography)
|
||||
self.connect(self.ui.biographyButton, SIGNAL("clicked()"), self.biography)
|
||||
|
||||
self.person = person
|
||||
self.backend = backend
|
||||
self.gotThumbnail()
|
||||
self.ui.nameLabel.setText(person.name)
|
||||
|
||||
|
|
@ -62,3 +64,11 @@ class Person(QFrame):
|
|||
role_desc = ' as %s'%role
|
||||
self.parent.doAction('Filmography of "%s"%s'%(self.person.name,role_desc),
|
||||
self.parent.filmographyAction,[self.person.id,role])
|
||||
|
||||
def biography(self):
|
||||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
bio = self.backend.get_person_biography(self.person.id)
|
||||
self.ui.shortBioPlain.setPlainText(bio)
|
||||
self.ui.biographyLabel.setText('Full biography:')
|
||||
self.ui.biographyButton.hide()
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>629</width>
|
||||
<width>645</width>
|
||||
<height>552</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_10">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_12">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_11">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
|
|
@ -218,7 +218,11 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="otherTitlesPlain"/>
|
||||
<widget class="QPlainTextEdit" name="otherTitlesPlain">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -310,7 +314,11 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="pitchPlain"/>
|
||||
<widget class="QTextEdit" name="pitchPlain">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -379,6 +387,38 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_13">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>All release dates:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="allReleasesPlain">
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="frame_12">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
|
|
@ -234,10 +234,30 @@ filmography</string>
|
|||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>Short biography:</string>
|
||||
<widget class="QFrame" name="frame_5">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="biographyLabel">
|
||||
<property name="text">
|
||||
<string>Short biography:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="biographyButton">
|
||||
<property name="text">
|
||||
<string>view full
|
||||
biography</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -248,6 +268,9 @@ filmography</string>
|
|||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue