[qcineoob] role selection improved in filmography and casting
This commit is contained in:
parent
63c769305d
commit
251f863c0b
4 changed files with 33 additions and 38 deletions
|
|
@ -175,7 +175,7 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.backButton.setToolTip(self.action_history['action_list'][-1]['description'])
|
||||
return todo['function'](*todo['args'])
|
||||
|
||||
def castingAction(self, id, role):
|
||||
def castingAction(self, backend_name, id, role):
|
||||
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||
for mini in self.minis:
|
||||
self.ui.list_content.layout().removeWidget(mini)
|
||||
|
|
@ -186,13 +186,11 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.searchEdit.setEnabled(False)
|
||||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
|
||||
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, caps=ICapCinema)
|
||||
self.ui.stopButton.show()
|
||||
|
||||
def filmographyAction(self, id, role):
|
||||
def filmographyAction(self, backend_name, id, role):
|
||||
self.ui.stackedWidget.setCurrentWidget(self.ui.list_page)
|
||||
for mini in self.minis:
|
||||
self.ui.list_content.layout().removeWidget(mini)
|
||||
|
|
@ -203,8 +201,6 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.searchEdit.setEnabled(False)
|
||||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
|
||||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addMovie)
|
||||
self.process.do('iter_person_movies', id, role, backends=backend_name, caps=ICapCinema)
|
||||
self.ui.stopButton.show()
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ from PyQt4.QtGui import QFrame, QImage, QPixmap
|
|||
from weboob.applications.qcineoob.ui.movie_ui import Ui_Movie
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
|
||||
class Movie(QFrame):
|
||||
|
|
@ -83,8 +82,8 @@ class Movie(QFrame):
|
|||
self.ui.noteLabel.setText('%s' % movie.note)
|
||||
else:
|
||||
self.ui.noteLabel.parent().hide()
|
||||
for role in ROLE_LIST:
|
||||
self.ui.castingCombo.addItem('%ss' % role)
|
||||
for role in movie.roles.keys():
|
||||
self.ui.castingCombo.addItem('%s' % role)
|
||||
|
||||
self.ui.verticalLayout.setAlignment(Qt.AlignTop)
|
||||
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||
|
|
@ -117,10 +116,10 @@ class Movie(QFrame):
|
|||
|
||||
def casting(self):
|
||||
role = None
|
||||
tosearch = self.ui.castingCombo.currentText()
|
||||
tosearch = unicode(self.ui.castingCombo.currentText())
|
||||
role_desc = ''
|
||||
if tosearch != 'all':
|
||||
role = tosearch[:-1]
|
||||
role = tosearch
|
||||
role_desc = ' as %s' % role
|
||||
self.parent.doAction('Casting%s of movie "%s"' % (role_desc, self.movie.original_title),
|
||||
self.parent.castingAction, [self.movie.id, role])
|
||||
self.parent.castingAction, [self.backend.name, self.movie.id, role])
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ from PyQt4.QtGui import QFrame, QImage, QPixmap, QApplication
|
|||
|
||||
from weboob.applications.qcineoob.ui.person_ui import Ui_Person
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
|
||||
class Person(QFrame):
|
||||
|
|
@ -60,7 +59,7 @@ class Person(QFrame):
|
|||
else:
|
||||
self.ui.deathDateLabel.parent().hide()
|
||||
self.ui.shortBioPlain.setPlainText('%s' % person.short_biography)
|
||||
for role in ROLE_LIST:
|
||||
for role in person.roles.keys():
|
||||
self.ui.filmographyCombo.addItem(role)
|
||||
self.ui.verticalLayout_2.setAlignment(Qt.AlignTop)
|
||||
|
||||
|
|
@ -78,13 +77,13 @@ class Person(QFrame):
|
|||
role = tosearch
|
||||
role_desc = ' as %s' % role
|
||||
self.parent.doAction('Filmography of "%s"%s' % (self.person.name, role_desc),
|
||||
self.parent.filmographyAction, [self.person.id, role])
|
||||
self.parent.filmographyAction, [self.backend.name, self.person.id, role])
|
||||
|
||||
def biography(self):
|
||||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
self.backend.fill_person(self.person, 'biography')
|
||||
bio = self.person.biography
|
||||
self.ui.shortBioPlain.setPlainText(bio)
|
||||
self.ui.shortBioPlain.setPlainText(u'%s' % bio)
|
||||
self.ui.biographyLabel.setText('Full biography:')
|
||||
self.ui.biographyButton.hide()
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue