home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 May / maximum-cd-2010-05.iso / DiscContents / boxee-0.9.20.10711.exe / scripts / Lyrics / resources / lib / credits.py < prev    next >
Encoding:
Python Source  |  2009-07-20  |  2.6 KB  |  68 lines

  1. """
  2. Credits modules
  3.  
  4. Nuka1195
  5. """
  6.  
  7. import sys
  8. import xbmcgui
  9.  
  10. from resources.lib.utilities import *
  11.  
  12. _ = sys.modules[ "__main__" ].__language__
  13. __scriptname__ = sys.modules[ "__main__" ].__scriptname__
  14. __version__ = sys.modules[ "__main__" ].__version__
  15. __svn_url__ = sys.modules[ "__main__" ].__svn_url__
  16. __svn_revision__ = sys.modules[ "__main__" ].__svn_revision__
  17.  
  18.  
  19. class GUI( xbmcgui.WindowXMLDialog ):
  20.     def __init__( self, *args, **kwargs ):
  21.         xbmcgui.WindowXMLDialog.__init__( self )
  22.  
  23.     def onInit( self ):
  24.         self._show_credits()
  25.  
  26.     def _show_credits( self ):
  27.         try:
  28.             xbmcgui.lock()
  29.             #team credits
  30.             self.getControl( 20 ).setLabel( __scriptname__ )
  31.             self.getControl( 30 ).setLabel( "%s: %s-%s" % ( _( 1006 ), __version__, __svn_revision__, ) )
  32.             self.getControl( 40 ).addLabel( __svn_url__ )
  33.             self.getControl( 901 ).setLabel( _( 901 ) )
  34.             self.getControl( 101 ).reset()
  35.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l1__, sys.modules[ "__main__" ].__credits_r1__ )
  36.             self.getControl( 101 ).addItem( list_item )
  37.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l2__, sys.modules[ "__main__" ].__credits_r2__ )
  38.             self.getControl( 101 ).addItem( list_item )
  39.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l3__, sys.modules[ "__main__" ].__credits_r3__ )
  40.             self.getControl( 101 ).addItem( list_item )
  41.             # Additional credits
  42.             self.getControl( 902 ).setLabel( _( 902 ) )
  43.             self.getControl( 102 ).reset()
  44.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l1__, sys.modules[ "__main__" ].__add_credits_r1__ )
  45.             self.getControl( 102 ).addItem( list_item )
  46.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l2__, sys.modules[ "__main__" ].__add_credits_r2__ )
  47.             self.getControl( 102 ).addItem( list_item )
  48.             list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l3__, sys.modules[ "__main__" ].__add_credits_r3__ )
  49.             self.getControl( 102 ).addItem( list_item )
  50.             # Skin credits
  51.             self.getControl( 903 ).setLabel( _( 903 ) )
  52.         except:
  53.             pass
  54.         xbmcgui.unlock()
  55.  
  56.     def _close_dialog( self ):
  57.         self.close()
  58.  
  59.     def onClick( self, controlId ):
  60.         pass
  61.  
  62.     def onFocus( self, controlId ):
  63.         pass
  64.  
  65.     def onAction( self, action ):
  66.         if ( action in ACTION_CANCEL_DIALOG ):
  67.             self._close_dialog()
  68.