Update of /cvsroot/freevo/freevo/src/plugins/idlebar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5819/src/plugins/idlebar
Modified Files: __init__.py Log Message: make idlebar have a background image Index: __init__.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/plugins/idlebar/__init__.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** __init__.py 19 Feb 2004 04:57:57 -0000 1.14 --- __init__.py 14 Mar 2004 11:42:35 -0000 1.15 *************** *** 19,22 **** --- 19,25 ---- # ----------------------------------------------------------------------- # $Log$ + # Revision 1.15 2004/03/14 11:42:35 dischi + # make idlebar have a background image + # # Revision 1.14 2004/02/19 04:57:57 gsbarbieri # Support Web Interface i18n. *************** *** 74,78 **** # ----------------------------------------------------------------------- # Freevo - A Home Theater PC framework ! # Copyright (C) 2002 Krister Lagerstrom, et al. # Please see the file freevo/Docs/CREDITS for a complete list of authors. # --- 77,81 ---- # ----------------------------------------------------------------------- # Freevo - A Home Theater PC framework ! # Copyright (C) 2002 Krister Lagerstrom, et al. # Please see the file freevo/Docs/CREDITS for a complete list of authors. # *************** *** 110,113 **** --- 113,117 ---- import util.pymetar as pymetar + from pygame import image,transform class PluginInterface(plugin.DaemonPlugin): *************** *** 124,138 **** plugin.register(self, 'idlebar') self.visible = True ! # Getting current LOCALE try: locale.resetlocale() except: pass ! def draw(self, (type, object), osd): """ draw a background and all idlebar plugins """ ! osd.drawroundbox(0, 0, osd.width + 2 * osd.x, osd.y + 60, (0x80000000L, 0, 0, 0)) if not self.plugins: self.plugins = plugin.get('idlebar') --- 128,161 ---- plugin.register(self, 'idlebar') self.visible = True ! self.bar = None ! self.barfile = '' ! ! # Getting current LOCALE try: locale.resetlocale() except: pass ! ! def draw(self, (type, object), osd): """ draw a background and all idlebar plugins """ ! w = osd.width + 2 * osd.x ! h = osd.y + 60 ! ! f = skin.get_image('idlebar') ! ! if self.barfile != f: ! self.barfile = f ! try: ! self.bar = transform.scale(image.load(f).convert_alpha(), (w,h)) ! except: ! self.bar = None ! ! # draw the cached barimage ! if self.bar: ! osd.drawimage(self.bar, (0, 0, w, h) ) ! if not self.plugins: self.plugins = plugin.get('idlebar') *************** *** 144,148 **** self.free_space = x ! def eventhandler(self, event, menuw=None): """ --- 167,171 ---- self.free_space = x ! def eventhandler(self, event, menuw=None): """ *************** *** 153,157 **** skin.get_singleton().redraw() return False ! def poll(self): """ --- 176,180 ---- skin.get_singleton().redraw() return False ! def poll(self): """ *************** *** 159,163 **** """ skin.get_singleton().redraw() ! --- 182,186 ---- """ skin.get_singleton().redraw() ! *************** *** 167,172 **** To activate the idle bar, put the following in your local_conf.py: plugin.activate('idlebar') ! You can then add various plugins. Plugins inside the idlebar are ! sorted based on the level (except the clock, it's always on the right side). Use "freevo plugins -l" to see all available plugins, and "freevo plugins -i idlebar.<plugin>" for a specific plugin. --- 190,195 ---- To activate the idle bar, put the following in your local_conf.py: plugin.activate('idlebar') ! You can then add various plugins. Plugins inside the idlebar are ! sorted based on the level (except the clock, it's always on the right side). Use "freevo plugins -l" to see all available plugins, and "freevo plugins -i idlebar.<plugin>" for a specific plugin. *************** *** 175,179 **** plugin.Plugin.__init__(self) self._type = 'idlebar' ! def draw(self, (type, object), x, osd): return --- 198,202 ---- plugin.Plugin.__init__(self) self._type = 'idlebar' ! def draw(self, (type, object), x, osd): return *************** *** 197,201 **** format ='%a %I:%M %P' self.timeformat = format ! def draw(self, (type, object), x, osd): clock = time.strftime(self.timeformat) --- 220,224 ---- format ='%a %I:%M %P' self.timeformat = format ! def draw(self, (type, object), x, osd): clock = time.strftime(self.timeformat) *************** *** 203,207 **** pad_x = 10 idlebar_height = 60 ! w = font.stringsize( clock ) h = font.font.height --- 226,230 ---- pad_x = 10 idlebar_height = 60 ! w = font.stringsize( clock ) h = font.font.height *************** *** 214,218 **** self.clock_left_position = osd.x + osd.width - w - pad_x return 0 ! class cdstatus(IdleBarPlugin): --- 237,241 ---- self.clock_left_position = osd.x + osd.width - w - pad_x return 0 ! class cdstatus(IdleBarPlugin): *************** *** 257,264 **** """ Shows if new mail is in the mailbox. ! Activate with: plugin.activate('idlebar.mail', level=10, args=('path to mailbox', )) ! """ def __init__(self, mailbox): --- 280,287 ---- """ Shows if new mail is in the mailbox. ! Activate with: plugin.activate('idlebar.mail', level=10, args=('path to mailbox', )) ! """ def __init__(self, mailbox): *************** *** 286,290 **** return osd.draw_image(self.MAILIMAGE, (x, osd.y + 10, -1, -1))[0] else: ! return osd.draw_image(self.NO_MAILIMAGE, (x, osd.y + 10, -1, -1))[0] --- 309,313 ---- return osd.draw_image(self.MAILIMAGE, (x, osd.y + 10, -1, -1))[0] else: ! return osd.draw_image(self.NO_MAILIMAGE, (x, osd.y + 10, -1, -1))[0] *************** *** 315,319 **** self.NEAR_EXPIRED = os.path.join(icondir, 'television_near_expired.png') self.EXPIRED = os.path.join(icondir, 'television_expired.png') ! def checktv(self): if os.path.exists(self.tvlockfile): --- 338,342 ---- self.NEAR_EXPIRED = os.path.join(icondir, 'television_near_expired.png') self.EXPIRED = os.path.join(icondir, 'television_expired.png') ! def checktv(self): if os.path.exists(self.tvlockfile): *************** *** 364,369 **** def checkweather(self): # We don't want to do this every 30 seconds, so we need ! # to cache the date somewhere. ! # # First check the age of the cache. # --- 387,392 ---- def checkweather(self): # We don't want to do this every 30 seconds, so we need ! # to cache the date somewhere. ! # # First check the age of the cache. # *************** *** 429,438 **** 'left', 'top') return width + 15 ! class holidays(IdleBarPlugin): """ Display some holidays in the idlebar ! This plugin checks if the current date is a holiday and will display a specified icon for that holiday. If no holiday is found, --- 452,461 ---- 'left', 'top') return width + 15 ! class holidays(IdleBarPlugin): """ Display some holidays in the idlebar ! This plugin checks if the current date is a holiday and will display a specified icon for that holiday. If no holiday is found, *************** *** 455,459 **** def __init__(self): IdleBarPlugin.__init__(self) ! def config(self): return [ ('HOLIDAYS', [ ('01-01', 'newyear.png'), --- 478,482 ---- def __init__(self): IdleBarPlugin.__init__(self) ! def config(self): return [ ('HOLIDAYS', [ ('01-01', 'newyear.png'), *************** *** 472,476 **** todays_date = time.strftime('%m-%d') ! for i in config.HOLIDAYS: holiday, icon = i if todays_date == holiday: --- 495,499 ---- todays_date = time.strftime('%m-%d') ! for i in config.HOLIDAYS: holiday, icon = i if todays_date == holiday: *************** *** 481,486 **** if icon: return osd.draw_image(icon, (x, osd.y + 10, -1, -1))[0] ! ! class logo(IdleBarPlugin): --- 504,509 ---- if icon: return osd.draw_image(icon, (x, osd.y + 10, -1, -1))[0] ! ! class logo(IdleBarPlugin): *************** *** 491,495 **** IdleBarPlugin.__init__(self) self.image = image ! def draw(self, (type, object), x, osd): if not self.image: --- 514,518 ---- IdleBarPlugin.__init__(self) self.image = image ! def draw(self, (type, object), x, osd): if not self.image: ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Freevo-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog