Index: /ipk/source/spinner_spinnerselector/CONTROL/control
===================================================================
--- /ipk/source/spinner_spinnerselector/CONTROL/control	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/CONTROL/control	(revision 5934)
@@ -0,0 +1,8 @@
+Package: enigma2-plugin-spinner-spinnerselector
+Version: 2.0
+Architecture: sh4
+OE: Spinner Selector for your AAF Duckbox!
+Section: extra
+Priority: optional
+Homepage: http://www.aaf-digital.info
+Description: Spinner Selector 2.0
Index: /ipk/source/spinner_spinnerselector/CONTROL/postinst
===================================================================
--- /ipk/source/spinner_spinnerselector/CONTROL/postinst	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/CONTROL/postinst	(revision 5934)
@@ -0,0 +1,12 @@
+#!/bin/sh
+TMP=/tmp/.spinner
+
+echo "successfully installed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: /ipk/source/spinner_spinnerselector/CONTROL/postrm
===================================================================
--- /ipk/source/spinner_spinnerselector/CONTROL/postrm	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/CONTROL/postrm	(revision 5934)
@@ -0,0 +1,14 @@
+#!/bin/sh
+TMP=/tmp/.browsers
+PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector
+rm -r $PLUGINDIR > /dev/null 2>&1
+
+echo "successfully removed"
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo new freespace size $FREE kb
+fi
+exit 0
Index: /ipk/source/spinner_spinnerselector/CONTROL/preinst
===================================================================
--- /ipk/source/spinner_spinnerselector/CONTROL/preinst	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/CONTROL/preinst	(revision 5934)
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+TMP=/tmp/.spinner
+echo "syncing disk"
+sync
+
+model=`cat /etc/model`
+echo""
+echo "Checking your Boxtype...."
+echo "Some Plugins will not work correctly on your $model!"
+echo ""
+if [ "$model" = "" ]; then
+	echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
+	echo "Aborting installation..."
+	exit 1
+else
+	echo "Boxtype: $model OK"
+fi
+
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 50`
+	SIZE=15
+	echo "checking freespace"
+	echo packege size $SIZE kb
+	echo freespace size $FREE kb
+	if  [ "$FREE" -lt "$SIZE" ]; then
+		echo "sorry no freespace left on device"
+		exit 1
+	else
+		echo ok
+	fi
+fi   
+echo "installing Spinner Selector ..."
+echo "checking OS"
+if  [ `cat /etc/motd | grep AAF | grep M | grep rev | wc -l` -eq 0 ]; then                      
+	echo ---------------------------
+	echo DONT USE this IPK Package!!
+	echo ---
+	echo Only for AAF Image!!
+	echo ---------------------------
+	exit 1
+fi
+exit 0
Index: /ipk/source/spinner_spinnerselector/CONTROL/prerm
===================================================================
--- /ipk/source/spinner_spinnerselector/CONTROL/prerm	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/CONTROL/prerm	(revision 5934)
@@ -0,0 +1,11 @@
+#!/bin/sh
+TMP=/tmp/.spinner
+echo "syncing disk"
+sync
+if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
+	SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
+	FREE=`expr $SPACE - 100`
+	echo freespace size $FREE kb
+fi
+echo "removing Spinner Selector"
+exit 0
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/Spinner.py
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/Spinner.py	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/Spinner.py	(revision 5934)
@@ -0,0 +1,29 @@
+from Components.GUIComponent import GUIComponent
+from enigma import ePixmap
+#from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
+from enigma import eTimer
+
+class Spinner(GUIComponent):
+	def __init__(self,Bilder):
+		GUIComponent.__init__(self)
+		self.len = 0
+		self.SetBilder(Bilder)
+		self.timer = eTimer()
+		self.timer.callback.append(self.Invalidate)
+		self.timer.start(100)
+
+	def SetBilder(self,Bilder):
+		self.Bilder = Bilder
+
+	GUI_WIDGET = ePixmap
+
+	def destroy(self):
+		if self.timer:
+			self.timer.callback.remove(self.Invalidate)
+
+	def Invalidate(self):
+		if self.instance:
+			if self.len >= len(self.Bilder):
+				self.len = 0
+			self.instance.setPixmapFromFile(self.Bilder[self.len])
+			self.len += 1
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelectionBox.py
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelectionBox.py	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelectionBox.py	(revision 5934)
@@ -0,0 +1,142 @@
+from Screens.Screen import Screen
+from Components.ActionMap import NumberActionMap
+from Components.Label import Label
+#from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
+from Components.MenuList import MenuList
+from Components.Sources.StaticText import StaticText
+from Plugins.Extensions.SpinnerSelector.Spinner import Spinner
+import os
+
+class SpinnerSelectionBox(Screen):
+	skin = """
+	<screen name="SpinnerSelectionBox" position="150,100" size="550,400" title="Input" backgroundColor="transparent">
+		<widget name="text" position="10,160" size="550,25" font="Regular;20" backgroundColor="transparent" />
+		<widget name="list" position="0,30" size="550,335" scrollbarMode="showOnDemand" />
+		<widget name="bild" position="200,10" zPosition="1" size="300,200" transparent="1" />
+		<applet type="onLayoutFinish">
+# this should be factored out into some helper code, but currently demonstrates applets.
+from enigma import eSize, ePoint
+
+orgwidth = self.instance.size().width()
+orgpos = self.instance.position()
+textsize = self[&quot;text&quot;].getSize()
+
+# y size still must be fixed in font stuff...
+textsize = (textsize[0] + 50, textsize[1] + 200)
+count = len(self.list)
+if count &gt; 8:
+	count = 8
+offset = 25 * count
+wsizex = textsize[0] + 60
+wsizey = textsize[1] + offset
+
+if (520 &gt; wsizex):
+	wsizex = 520
+wsize = (wsizex, wsizey)
+
+# resize
+self.instance.resize(eSize(*wsize))
+
+# resize label
+self[&quot;text&quot;].instance.resize(eSize(*textsize))
+
+# move list
+listsize = (wsizex, 25 * count)
+self[&quot;list&quot;].instance.move(ePoint(0, textsize[1]))
+self[&quot;list&quot;].instance.resize(eSize(*listsize))
+
+# center window
+newwidth = wsize[0]
+self.instance.move(ePoint((720-wsizex)/2, (576-wsizey)/(count &gt; 7 and 2 or 3)))
+		</applet>
+	</screen>"""
+	def __init__(self, session, title = "", list = []):
+		Screen.__init__(self, session)
+
+		self["text"] = Label(title)
+		self.list = list #[]
+		self.summarylist = []
+		cursel = self.list[0]
+		self.Bilder = []
+		if cursel:
+			for i in range(64):
+				if (os.path.isfile("/usr/share/enigma2/spinner/%s/wait%d.png"%(cursel[0],i+1))):
+					self.Bilder.append("/usr/share/enigma2/spinner/%s/wait%d.png"%(cursel[0],i+1))
+		self["bild"] = Spinner(self.Bilder);
+		self["list"] = MenuList(list = self.list) #, selection = selection)
+		self["list"].onSelectionChanged.append(self.Changed)
+		self["summary_list"] = StaticText()
+		self.updateSummary()
+				
+		self["actions"] = NumberActionMap(["WizardActions","DirectionActions"], 
+		{
+			"ok": self.go,
+			"back": self.cancel,
+			"up": self.up,
+			"down": self.down
+		}, -1)
+
+	def Changed(self):
+		cursel = self["list"].l.getCurrentSelection()
+		if cursel:
+			self.Bilder = []
+			for i in range(64):
+				if (os.path.isfile("/usr/share/enigma2/spinner/%s/wait%d.png"%(cursel[0],i+1))):
+					self.Bilder.append("/usr/share/enigma2/spinner/%s/wait%d.png"%(cursel[0],i+1))
+			self["bild"].SetBilder(self.Bilder)
+			
+		
+	def keyLeft(self):
+		pass
+	
+	def keyRight(self):
+		pass
+	
+	def up(self):
+		if len(self["list"].list) > 0:
+			while 1:
+				self["list"].instance.moveSelection(self["list"].instance.moveUp)
+				self.updateSummary(self["list"].l.getCurrentSelectionIndex())
+				if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == 0:
+					break
+
+	def down(self):
+		if len(self["list"].list) > 0:
+			while 1:
+				self["list"].instance.moveSelection(self["list"].instance.moveDown)
+				self.updateSummary(self["list"].l.getCurrentSelectionIndex())
+				if self["list"].l.getCurrentSelection()[0][0] != "--" or self["list"].l.getCurrentSelectionIndex() == len(self["list"].list) - 1:
+					break
+
+	# runs the current selected entry
+	def go(self):
+		cursel = self["list"].l.getCurrentSelection()
+		if cursel:
+			self.goEntry(cursel[0])
+		else:
+			self.cancel()
+
+	# runs a specific entry
+	def goEntry(self, entry):
+		if len(entry) > 2 and isinstance(entry[1], str) and entry[1] == "CALLFUNC":
+			# CALLFUNC wants to have the current selection as argument
+			arg = self["list"].l.getCurrentSelection()[0]
+			entry[2](arg)
+		else:
+			self.close(entry)
+
+	def updateSummary(self, curpos=0):
+		pos = 0
+		summarytext = ""
+		for entry in self.summarylist:
+			if pos > curpos-2 and pos < curpos+5:
+				if pos == curpos:
+					summarytext += ">"
+				else:
+					summarytext += entry[0]
+				summarytext += ' ' + entry[1] + '\n'
+			pos += 1
+		self["summary_list"].setText(summarytext)
+
+	def cancel(self):
+		self.close(None)
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelector.py
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelector.py	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/SpinnerSelector.py	(revision 5934)
@@ -0,0 +1,45 @@
+# coding=ISO-8859-1
+from Plugins.Plugin import PluginDescriptor
+from Plugins.Extensions.SpinnerSelector.SpinnerSelectionBox import SpinnerSelectionBox
+from Screens.MessageBox import MessageBox
+from Screens.Standby import TryQuitMainloop
+from Components.config import config
+import os
+
+import gettext
+try:
+	cat = gettext.translation('lang', '/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po', [config.osd.language.getText()])
+	_ = cat.gettext
+except IOError:
+	pass
+
+class SpinnerSelector:
+	def __init__(self,session):
+		self.session = session
+		path = "/usr/share/enigma2/spinner/"
+		dirs = os.listdir(path)
+		dirs.sort()
+		menu = []
+		for dir in dirs:
+			p = path + dir
+			if os.path.isdir(p):
+				menu.append((dir,dir))
+		self.session.openWithCallback(self.menuCallback, SpinnerSelectionBox, title=_("Chose Spinner"), list=menu)
+
+	def menuCallback(self,choice):
+		if choice is None:
+			return
+		First = True
+		for i in range(64):
+			if (os.path.isfile("/usr/share/enigma2/skin_default/spinner/wait%d.png"%(i+1))):
+				os.system("rm -f /usr/share/enigma2/skin_default/spinner/wait%d.png"%(i+1))
+			if (os.path.isfile("/usr/share/enigma2/spinner/%s/wait%d.png"%(choice,i+1))):
+				os.system("ln -s /usr/share/enigma2/spinner/%s/wait%d.png /usr/share/enigma2/skin_default/spinner/wait%d.png"%(choice,i+1,i+1))
+				if First:
+					First = False
+					os.system("rm -f /usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelektor/plugin.png; ln -s /usr/share/enigma2/spinner/%s/wait%d.png /usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelektor/plugin.png"%(choice,i+1));
+		self.session.openWithCallback(self.restart,MessageBox,_("GUI needs a restart to apply a new spinner.\nDo you want to restart the GUI now ?"), MessageBox.TYPE_YESNO)
+
+	def restart(self, answer):
+		if answer is True:
+			self.session.open(TryQuitMainloop, 3)
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/clean.py.txt
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/clean.py.txt	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/clean.py.txt	(revision 5934)
@@ -0,0 +1,5 @@
+import os
+
+for i in range(64):
+	if (os.path.isfile("/usr/share/enigma2/wait%d.png"%(i+1))):
+		os.system("rm -f /usr/share/enigma2/wait%d.png"%(i+1))
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/plugin.py
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/plugin.py	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/plugin.py	(revision 5934)
@@ -0,0 +1,27 @@
+# coding=ISO-8859-1
+from Plugins.Plugin import PluginDescriptor
+from Screens.ChoiceBox import ChoiceBox
+from Screens.MessageBox import MessageBox
+from Screens.Standby import TryQuitMainloop
+from Components.config import config
+from Plugins.Extensions.SpinnerSelector.SpinnerSelector import SpinnerSelector
+import os
+
+import gettext
+try:
+	cat = gettext.translation('lang', '/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po', [config.osd.language.getText()])
+	_ = cat.gettext
+except IOError:
+	pass
+
+def main(session, **kwargs):
+	SpinnerSelector(session)
+			
+def autostart(reason, **kwargs):
+	pass
+		
+def Plugins(**kwargs):
+	if (os.path.isdir("/usr/lib/enigma2/python/Plugins/Extensions/AladinsPluginContainer")):
+		return [PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART, PluginDescriptor.WHERE_AUTOSTART], fnc = autostart)]
+	else:
+		return [PluginDescriptor(name=_("Change spinner"), description=_("select a other spinner"), where = PluginDescriptor.WHERE_PLUGINMENU, icon="plugin.png", fnc=main)]
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.po
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.po	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.po	(revision 5934)
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-02-28 20:05+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../plugin.py:46
+msgid "Chose Spinner"
+msgstr "Spinner auswählen"
+
+#: ../plugin.py:66
+msgid "GUI needs a restart to apply a new spinner.\nDo you want to restart the GUI now ?"
+msgstr "Das System muß neu gestartet werden,\num den neuen Spinner übernehmen zu können.\nWollen sie jetzt neustarten ?"
+
+#: ../plugin.py:82
+msgid "Change spinner"
+msgstr "Spinner wechseln"
+
+#: ../plugin.py:82
+msgid "select a other spinner"
+msgstr "Einen anderen Spinner auswählen"
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.utf.po
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.utf.po	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/de.utf.po	(revision 5934)
@@ -0,0 +1,33 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-02-28 20:05+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../plugin.py:46
+msgid "Chose Spinner"
+msgstr "Spinner auswählen"
+
+#: ../plugin.py:66
+msgid "GUI needs a restart to apply a new spinner.\nDo you want to restart the GUI now ?"
+msgstr "Das System muß neu gestartet werden,\num den neuen Spinner übernehmen zu können.\nWollen sie jetzt neustarten ?"
+
+#: ../plugin.py:82
+msgid "Change spinner"
+msgstr "Spinner wechseln"
+
+#: ../plugin.py:82
+msgid "select a other spinner"
+msgstr "Einen anderen Spinner auswählen"
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/ifiles.txt
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/ifiles.txt	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/ifiles.txt	(revision 5934)
@@ -0,0 +1,3 @@
+../__init__.py
+../plugin.py
+../clean.py
Index: /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/messages.pot
===================================================================
--- /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/messages.pot	(revision 5934)
+++ /ipk/source/spinner_spinnerselector/usr/lib/enigma2/python/Plugins/Extensions/SpinnerSelector/po/messages.pot	(revision 5934)
@@ -0,0 +1,35 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-02-28 20:05+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../plugin.py:46
+msgid "Chose Spinner"
+msgstr ""
+
+#: ../plugin.py:66
+msgid ""
+"GUI needs a restart to apply a new spinner.\n"
+"Do you want to restart the GUI now ?"
+msgstr ""
+
+#: ../plugin.py:82
+msgid "Change spinner"
+msgstr ""
+
+#: ../plugin.py:82
+msgid "select a other spinner"
+msgstr ""
