[qcineoob] add 'view' and 'view in new tab' buttons for all search results

This commit is contained in:
Julien Veyssier 2014-11-23 18:42:19 +01:00 committed by Romain Bignon
commit b99576e9dd
8 changed files with 166 additions and 2 deletions

View file

@ -18,6 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from PyQt4.QtGui import QFrame
from PyQt4.QtCore import Qt, SIGNAL
from weboob.applications.qcineoob.ui.minisubtitle_ui import Ui_MiniSubtitle
from weboob.capabilities.base import empty
@ -38,6 +39,20 @@ class MiniSubtitle(QFrame):
self.ui.nbcdLabel.setText(u'%s' % subtitle.nb_cd)
self.ui.backendLabel.setText(backend.name)
self.connect(self.ui.newTabButton, SIGNAL("clicked()"), self.newTabPressed)
self.connect(self.ui.viewButton, SIGNAL("clicked()"), self.viewPressed)
def viewPressed(self):
subtitle = self.backend.get_subtitle(self.subtitle.id)
if subtitle:
self.parent.doAction('Details of subtitle "%s"' %
subtitle.name, self.parent.displaySubtitle, [subtitle, self.backend])
def newTabPressed(self):
subtitle = self.backend.get_subtitle(self.subtitle.id)
self.parent.parent.newTab(u'Details of subtitle "%s"' %
subtitle.name, self.backend, subtitle=subtitle)
def enterEvent(self, event):
self.setFrameShadow(self.Sunken)
QFrame.enterEvent(self, event)