aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-22 15:22:30 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2006-02-22 15:22:30 +0000
commitd120b13dd6d9460fc9a66680ffb42632cb597522 (patch)
tree3eaeb6584a450d5b022189aeef52d0fd1589c29e /lib/python/Plugins
parent6119f4c4a0d947d56e758fe53f2822db8490b444 (diff)
downloadenigma2-d120b13dd6d9460fc9a66680ffb42632cb597522.tar.gz
enigma2-d120b13dd6d9460fc9a66680ffb42632cb597522.zip
add FileManger plugin
reenable plugin icons
Diffstat (limited to 'lib/python/Plugins')
-rw-r--r--lib/python/Plugins/FileManager/Makefile.am0
-rw-r--r--lib/python/Plugins/FileManager/__init__.py0
-rw-r--r--lib/python/Plugins/FileManager/plugin.py69
-rw-r--r--lib/python/Plugins/Makefile.am2
-rw-r--r--lib/python/Plugins/Plugin.py15
-rw-r--r--lib/python/Plugins/update/plugin.py2
6 files changed, 82 insertions, 6 deletions
diff --git a/lib/python/Plugins/FileManager/Makefile.am b/lib/python/Plugins/FileManager/Makefile.am
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/lib/python/Plugins/FileManager/Makefile.am
diff --git a/lib/python/Plugins/FileManager/__init__.py b/lib/python/Plugins/FileManager/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/lib/python/Plugins/FileManager/__init__.py
diff --git a/lib/python/Plugins/FileManager/plugin.py b/lib/python/Plugins/FileManager/plugin.py
new file mode 100644
index 00000000..4b577b02
--- /dev/null
+++ b/lib/python/Plugins/FileManager/plugin.py
@@ -0,0 +1,69 @@
+from enigma import *
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Components.ActionMap import NumberActionMap
+from Components.Label import Label
+from Components.Input import Input
+from Components.GUIComponent import *
+from Components.Pixmap import Pixmap
+from Components.FileList import FileEntryComponent, FileList
+from Plugins.Plugin import PluginDescriptor
+
+import os
+
+class FileManager(Screen):
+ skin = """
+ <screen position="100,100" size="550,400" title="Test" >
+ <!--widget name="text" position="0,0" size="550,25" font="Regular;20" /-->
+ <widget name="list" position="10,0" size="190,250" scrollbarMode="showOnDemand" />
+ <widget name="pixmap" position="200,0" size="190,250" />
+ </screen>"""
+ def __init__(self, session, args = None):
+ self.skin = FileManager.skin
+ Screen.__init__(self, session)
+
+ self["list"] = FileList("/", matchingPattern = "^.*\.(png|avi|mp3|mpeg|ts)")
+ self["pixmap"] = Pixmap()
+
+ #self["text"] = Input("1234", maxSize=True, type=Input.NUMBER)
+
+ self["actions"] = NumberActionMap(["WizardActions", "InputActions"],
+ {
+ "ok": self.ok,
+ "back": self.close,
+# "left": self.keyLeft,
+# "right": self.keyRight,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
+ "0": self.keyNumberGlobal
+ }, -1)
+
+ def keyLeft(self):
+ self["text"].left()
+
+ def keyRight(self):
+ self["text"].right()
+
+ def ok(self):
+ selection = self["list"].getSelection()
+ if selection[1] == True: # isDir
+ self["list"].changeDir(selection[0])
+ else:
+ self["pixmap"].instance.setPixmapFromFile(selection[0])
+
+ def keyNumberGlobal(self, number):
+ print "pressed", number
+ self["text"].number(number)
+
+def main(session):
+ session.open(Test)
+
+def Plugins():
+ return PluginDescriptor(name="File-Manager", description="Let's you view/edit files in your Dreambox", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=main)
diff --git a/lib/python/Plugins/Makefile.am b/lib/python/Plugins/Makefile.am
index 6b749de2..66fb252d 100644
--- a/lib/python/Plugins/Makefile.am
+++ b/lib/python/Plugins/Makefile.am
@@ -1,6 +1,6 @@
installdir = $(LIBDIR)/enigma2/python/Plugins
-SUBDIRS = update tuxboxplugins web test fpupgrade
+SUBDIRS = update tuxboxplugins web test fpupgrade FileManager
install_PYTHON = \
__init__.py Plugin.py
diff --git a/lib/python/Plugins/Plugin.py b/lib/python/Plugins/Plugin.py
index d3635091..183419c7 100644
--- a/lib/python/Plugins/Plugin.py
+++ b/lib/python/Plugins/Plugin.py
@@ -1,3 +1,5 @@
+from enigma import loadPNG
+
class PluginDescriptor:
"""An object to describe a plugin."""
@@ -31,8 +33,13 @@ class PluginDescriptor:
else:
self.where = [ where ]
self.description = description
- if type(fnc) is str:
- self.icon = loadPNG("..")
- else:
- self.icon = icon
+
+ self.iconstr = icon
+
self.__call__ = fnc
+
+ def updateIcon(self, path):
+ if type(self.iconstr) is str:
+ self.icon = loadPNG(path + self.iconstr)
+ else:
+ self.icon = None \ No newline at end of file
diff --git a/lib/python/Plugins/update/plugin.py b/lib/python/Plugins/update/plugin.py
index aca5c674..1d91a558 100644
--- a/lib/python/Plugins/update/plugin.py
+++ b/lib/python/Plugins/update/plugin.py
@@ -253,4 +253,4 @@ def UpgradeMain(session):
session.open(UpdatePluginMenu)
def Plugins():
- return PluginDescriptor(name="Softwareupdate", description="Updates your receiver's software", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=UpgradeMain)
+ return PluginDescriptor(name="Softwareupdate", description="Updates your receiver's software", icon="update.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=UpgradeMain)