Author: duncan
Date: Tue Mar 27 20:39:20 2007
New Revision: 9403
Added:
branches/rel-1/freevo/share/images/check.png (contents, props changed)
branches/rel-1/freevo/share/images/cross.png (contents, props changed)
branches/rel-1/freevo/src/plugins/idlebar/progactive.py (contents, props
changed)
Log:
[ 1689358 ] Progactive_1.0
Plug-in from Tobias Weis added
Added: branches/rel-1/freevo/share/images/check.png
==============================================================================
Binary file. No diff available.
Added: branches/rel-1/freevo/share/images/cross.png
==============================================================================
Binary file. No diff available.
Added: branches/rel-1/freevo/src/plugins/idlebar/progactive.py
==============================================================================
--- (empty file)
+++ branches/rel-1/freevo/src/plugins/idlebar/progactive.py Tue Mar 27
20:39:20 2007
@@ -0,0 +1,86 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------
+# osd.py - Low level graphics routines
+# -----------------------------------------------------------------------
+# $Id$
+#
+# Notes: do not use the OSD object inside a thread
+#
+# Todo:
+#
+# -----------------------------------------------------------------------
+# 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.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
+# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+"""
+
+done by despeyer >> www.despeyer.de >> [EMAIL PROTECTED]
+if you got questions, ideas, etc., please mail me !!!
+"""
+
+import time
+import os
+import locale
+import config
+import plugin
+import skin
+
+from pygame import image, transform
+from plugins.idlebar import IdleBarPlugin
+
+__version__="1.0"
+__author__="[EMAIL PROTECTED]"
+__doc__="""Display an Icon if prog (defined in local_conf.py) is active or not.
+The Prog-Name is also drawn over the icon.
+"""
+
+class PluginInterface(IdleBarPlugin):
+ """
+ Display an Icon if prog is active, put following Lines in local_conf.py:
+ plugin.activate('idlebar.progactive')
+ """
+ def __init__(self):
+ IdleBarPlugin.__init__(self)
+ self.plugin_name='idlebar.progactive'
+ self.time = 0
+ self.progname = config.PROG_NAME
+
+ def config(self):
+ '''config is called automatically, for default settings run:
+ freevo plugins -i idlebar.progactive'''
+ return [ ('PROG_NAME', None, 'Program that you want to monitor') ]
+
+ def getstatus(self):
+ """
+ Update every 30 secs
+ """
+ if (time.time()-self.time) > 30:
+ self.time = time.time()
+ cmd = "ps -A | grep " + self.progname
+ fin, fout = os.popen4(cmd)
+ result = fout.read()
+ if result == "":
+ self.image = 'cross.png'
+ else:
+ self.image = 'check.png'
+
+ def draw(self, (type, object), x, osd):
+ self.getstatus()
+ font = osd.get_font('small0')
+ widthmt = 0
+ widthmt = font.stringsize(config.PROG_NAME)
+ image = self.image
+ osd.write_text(config.PROG_NAME, font, None, x + 15, osd.y + 55 -
font.h, widthmt, font.h, 'left', 'top')
+ return osd.drawimage(self.image, (x, osd.y + 10, -1, 45))[0]
+ return widthmt + 15
+
+
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog