Author: duncan
Date: Mon Aug 20 14:20:15 2007
New Revision: 9831
Log:
[ 1777187 ] 'Full description' for VideoItems
Patch from Tanja Kotthaus applied
Modified:
branches/rel-1/freevo/ChangeLog
branches/rel-1/freevo/src/video/videoitem.py
Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog (original)
+++ branches/rel-1/freevo/ChangeLog Mon Aug 20 14:20:15 2007
@@ -22,7 +22,8 @@
* Updated the LCD plug-in to allow a 16x4 mode (F#1776450)
* Updated alsamixer with event args and synchronous mixer control (F#1767928)
* Updated a submenu selection when there is only one action to execute the
action (F#1774569)
- * Updated tv favourite handling and program item to provide a consistant
interface (F#1776909)
+ * Updated tv favourite handling and programme item to provide a consistant
interface (F#1776909)
+ * Updated video item to include the full description (F#1777187)
* Fixed tvmenu crashing because of the search plug-in (B#1774544)
== Release 1.7.3 (2007-08-01) ==
@@ -46,7 +47,7 @@
* Updated recordings manager to show full scrollable description (F#1759171)
* Updated skins to adjust the window heights when the button bar is active
(F#1733061)
* Updated system sensors for a configurable path (B#1731892)
- * Updated tv program menu to show full description (F#1752973)
+ * Updated tv programme menu to show full description (F#1752973)
* Updated xine video plug-in to allow bookmarks to work (F#1729024)
* Updated xine video plug-in to process stdout and stderr message (F#1729603)
* Updated xmltv's use of element tree for Python-2.5 (F#1731775)
@@ -108,7 +109,7 @@
* Added VIDEO_SEND_XINE_CMD event to send specific commands to xine
(F#1683699)
* Updated and fixed German translations (B#1672040)
* Updated and fixed video selection of audio, subtitles and chapters
(B#1677364)
- * Updated IMDB download to extract season and episode from TV programs
(F#1683101)
+ * Updated IMDB download to extract season and episode from TV programmes
(F#1683101)
* Updated ivtv record to work with SECAM-DK (F#1694182)
* Updated mplayer to allow the bottom field first and XvMC settings
(F#1694186,F#1683423)
* Updated rss feed for better URL detection (B#1675373,B#1709515)
@@ -140,7 +141,7 @@
* New Bluetooth phone support to act as a remote control (F#1622143)
* New buttonbar plug-in that displays buttons on the bottom of the screen
(F#1633140)
* New CD/DVD burn plug-in added (F#1605919)
- * New encoding server, allows re-encoding TV programs and ripping DVDs
(F#1580642,F#1578402)
+ * New encoding server, allows re-encoding TV programmes and ripping DVDs
(F#1580642,F#1578402)
* New home automation plug-in, allows controlling device in the home!
(F#1605293)
* New Linux event device support (F#1579124)
* New Music Player Daemon (mpd) plug-in (F#1623023)
Modified: branches/rel-1/freevo/src/video/videoitem.py
==============================================================================
--- branches/rel-1/freevo/src/video/videoitem.py (original)
+++ branches/rel-1/freevo/src/video/videoitem.py Mon Aug 20 14:20:15 2007
@@ -41,6 +41,7 @@
import util
import rc
import menu
+import skin
import configure
import plugin
import kaa.metadata as metadata
@@ -310,20 +311,21 @@
if self.url.startswith('dvd://') and self.url[-1] == '/':
if self.player_rating >= 20:
items = [ (self.play, _('Play DVD')),
- ( self.dvd_vcd_title_menu, _('DVD title list') ) ]
+ (self.dvd_vcd_title_menu, _('DVD title list')) ]
else:
- items = [ ( self.dvd_vcd_title_menu, _('DVD title list') ),
+ items = [ (self.dvd_vcd_title_menu, _('DVD title list')),
(self.play, _('Play default track')) ]
elif self.url == 'vcd://':
if self.player_rating >= 20:
items = [ (self.play, _('Play VCD')),
- ( self.dvd_vcd_title_menu, _('VCD title list') ) ]
+ (self.dvd_vcd_title_menu, _('VCD title list')) ]
else:
- items = [ ( self.dvd_vcd_title_menu, _('VCD title list') ),
+ items = [ (self.dvd_vcd_title_menu, _('VCD title list')),
(self.play, _('Play default track')) ]
else:
items = [ (self.play, _('Play')) ]
+ items.append((self.show_details, _('Full description')))
if len(self.possible_player) > 1:
items.append((self.play_alternate, _('Play with alternate
player')))
@@ -342,6 +344,24 @@
return items
+ def display_submenu(self, arg=None, menuw=None):
+ """
+ Open the submenu for this item
+ """
+ if not menuw:
+ return
+ # this tries to imitated freevo's internal way of creating submenus
+ menuw.make_submenu(_('Video Menu'), self.actions(), self)
+ menuw.show()
+
+
+ def show_details(self, arg=None, menuw=None):
+ """
+ Show more details
+ """
+ ShowDetails(menuw, self)
+
+
def show_variants(self, arg=None, menuw=None):
"""
show a list of variants in a menu
@@ -440,7 +460,7 @@
execute commands if defined
"""
if config.VIDEO_PRE_PLAY:
- os.system( config.VIDEO_PRE_PLAY )
+ os.system(config.VIDEO_PRE_PLAY)
"""
play the item.
"""
@@ -509,7 +529,7 @@
# No media at all was found: error
ConfirmBox(text=(_('No media found for "%s".\n')+
_('Please insert the media.')) %
- self.name, handler=self.play ).show()
+ self.name, handler=self.play).show()
return
# normal plackback of one file
@@ -523,7 +543,7 @@
self.menuw.show()
ConfirmBox(text=(_('No media found for "%s".\n')+
_('Please insert the media.')) % file,
- handler=self.play ).show()
+ handler=self.play).show()
return
elif self.media:
@@ -581,7 +601,7 @@
execute commands if defined
"""
if config.VIDEO_POST_PLAY:
- os.system( config.VIDEO_POST_PLAY )
+ os.system(config.VIDEO_POST_PLAY)
"""
stop playing
@@ -628,6 +648,7 @@
moviemenu = menu.Menu(self.name, items, umount_all = 1,
fxd_file=self.skin_fxd)
moviemenu.item_types = 'video'
+ moviemenu.is_submenu = True
self.menuw.pushmenu(moviemenu)
@@ -689,3 +710,107 @@
if isstring(self.parent):
self.parent = None
return Item.eventhandler(self, event, menuw)
+
+
+########################
+# Show Details
+
+# Create the skin_object object
+skin_object = skin.get_singleton()
+skin_object.register('tvguideinfo', ('screen', 'info', 'scrollabletext',
'plugin'))
+
+# Program Info screen
+class ShowDetails:
+ """
+ Screen to show more details
+ """
+ def __init__(self, menuw, movie):
+ if movie is None:
+ name = _('No Information Available')
+ description = ''
+ else:
+ self.movie = movie
+ name = movie.name
+ sub_title = movie['tagline']
+ desc = movie['plot']
+ # gather the infos and construct the description text
+ if sub_title:
+ # subtitle + newline + description
+ description = u'"' + sub_title + u'"\n' + desc + u'\n\n'
+ else:
+ # or just the description, if there is no subtitle
+ description = desc + u'\n\n'
+ # add some additional inofs if they are available
+ if movie['genre']:
+ description += _('Genre') + u' : '+movie['genre'] + u'\n'
+ if movie['length']:
+ description += _('Length')+ u' : '+movie['length'] + u'\n'
+ if movie['year']:
+ description += _('Year')+u' : '+movie['year'] + u'\n'
+
+
+ # that's all, we can show this to the user
+ self.name = name
+ self.scrollable_text = skin.ScrollableText(description)
+ self.visible = True
+
+ self.menuw = menuw
+ self.menuw.hide(clear=False)
+
+ # this activates the eventhandler and the context of this class
+ rc.app(self)
+
+ skin_object.draw('tvguideinfo', self)
+
+
+
+ def getattr(self, name):
+ if name == 'title':
+ return self.name
+
+ if self.movie:
+ return self.movie.getattr(name)
+
+ return u''
+
+
+ def eventhandler(self, event, menuw=None):
+ """
+ eventhandler for the programm description display
+ """
+ if event in ('MENU_SELECT', 'MENU_BACK_ONE_MENU'):
+ # leave the description display and return to the previous menu
+ self.menuw.show()
+ # we do not need to call rc.app(None) here,
+ # because that is done by menuw.show(),
+ # but we need to set the context manually,
+ # because rc.app(None) sets it always to 'menu'
+ rc.set_context(self.menuw.get_event_context())
+ return True
+ elif event == 'MENU_SUBMENU':
+ if hasattr(self.menuw.menustack[-1],'is_submenu'):
+ # the last menu has been a submenu, we just have to show it
+ self.menuw.show()
+ rc.set_context(self.menuw.get_event_context())
+ else:
+ # we have to create the submenu
+ self.movie.display_submenu(menuw=self.menuw)
+ return True
+ elif event == 'MENU_UP':
+ # scroll the description up
+ self.scrollable_text.scroll(True)
+ skin_object.draw('tvguideinfo', self)
+ return True
+ elif event == 'MENU_DOWN':
+ # scroll the description down
+ self.scrollable_text.scroll(False)
+ skin_object.draw('tvguideinfo', self)
+ return True
+ elif event == 'MENU_PLAY_ITEM':
+ self.menuw.show()
+ rc.set_context(self.menuw.get_event_context())
+ # try to watch this program
+ self.movie.play(menuw=self.menuw)
+ return True
+ else:
+ return False
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog