Index: ipk/source/infos_imdb_1_0/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.py
===================================================================
--- ipk/source/infos_imdb_1_0/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.py	(revision 14689)
+++ ipk/source/infos_imdb_1_0/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.py	(revision 14689)
@@ -0,0 +1,662 @@
+# -*- coding: UTF-8 -*-
+from Plugins.Plugin import PluginDescriptor
+from twisted.web.client import downloadPage
+from enigma import ePicLoad, eServiceReference, getDesktop
+from Screens.Screen import Screen
+from Screens.EpgSelection import EPGSelection
+from Screens.ChannelSelection import SimpleChannelSelection
+from Components.ActionMap import ActionMap
+from Components.Pixmap import Pixmap
+from Components.Label import Label
+from Components.ScrollLabel import ScrollLabel
+from Components.Button import Button
+from Components.AVSwitch import AVSwitch
+from Components.MenuList import MenuList
+from Components.Language import language
+from Components.ProgressBar import ProgressBar
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
+from os import environ as os_environ, system as os_system
+from Screens.MessageBox import MessageBox
+import re
+import htmlentitydefs
+import urllib
+import gettext
+
+def localeInit():
+	lang = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country"
+	os_environ["LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it!
+	gettext.bindtextdomain("IMDb", resolveFilename(SCOPE_PLUGINS, "Extensions/IMDb/locale"))
+
+def _(txt):
+	t = gettext.dgettext("IMDb", txt)
+	if t == txt:
+		print "[IMDb] fallback to default translation for", txt 
+		t = gettext.gettext(txt)
+	return t
+
+localeInit()
+language.addCallback(localeInit)
+
+class IMDBChannelSelection(SimpleChannelSelection):
+	def __init__(self, session):
+		SimpleChannelSelection.__init__(self, session, _("Channel Selection"))
+		self.skinName = "SimpleChannelSelection"
+
+		self["ChannelSelectEPGActions"] = ActionMap(["ChannelSelectEPGActions"],
+			{
+				"showEPGList": self.channelSelected
+			}
+		)
+
+	def channelSelected(self):
+		ref = self.getCurrentSelection()
+		if (ref.flags & 7) == 7:
+			self.enterPath(ref)
+		elif not (ref.flags & eServiceReference.isMarker):
+			self.session.openWithCallback(
+				self.epgClosed,
+				IMDBEPGSelection,
+				ref,
+				openPlugin = False
+			)
+
+	def epgClosed(self, ret = None):
+		if ret:
+			self.close(ret)
+
+class IMDBEPGSelection(EPGSelection):
+	def __init__(self, session, ref, openPlugin = True):
+		EPGSelection.__init__(self, session, ref)
+		self.skinName = "EPGSelection"
+		self["key_green"].setText(_("Lookup"))
+		self.openPlugin = openPlugin
+
+	def infoKeyPressed(self):
+		self.timerAdd()
+
+	def timerAdd(self):
+		cur = self["list"].getCurrent()
+		evt = cur[0]
+		sref = cur[1]
+		if not evt: 
+			return
+
+		if self.openPlugin:
+			self.session.open(
+				IMDB,
+				evt.getEventName()
+			)
+		else:
+			self.close(evt.getEventName())
+
+	def onSelectionChanged(self):
+		pass
+
+class IMDB(Screen):
+	if (getDesktop(0).size().width() == 1280):
+		skin = """
+			<screen name="IMDB" position="125,100" size="1030,520" title="Internet Movie Database Details Plugin" >
+				<eLabel backgroundColor="red" position="94,510" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="328,510" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="562,510" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="796,510" size="140,3" zPosition="0" />
+				<widget name="key_red" position="94,485" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_green" position="328,485" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_yellow" position="562,485" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_blue" position="796,485" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="titellabel" position="10,40" size="780,45" valign="center" font="Regular;22"/>
+				<widget name="detailslabel" position="105,90" size="895,140" font="Regular;18" />
+				<widget name="castlabel" position="10,235" size="990,240" font="Regular;18" />
+				<widget name="extralabel" position="10,40" size="990,450" font="Regular;18" />
+				<widget name="ratinglabel" position="790,62" size="210,20" halign="center" font="Regular;18" foregroundColor="#f0b400"/>
+				<widget name="statusbar" position="10,10" size="990,20" font="Regular;16" foregroundColor="#cccccc" />
+				<widget name="poster" position="4,90" size="96,140" alphatest="on" />
+				<widget name="menu" position="10,115" size="990,355" zPosition="3" scrollbarMode="showOnDemand" />
+				<widget name="starsbg" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_empty.png" position="790,40" zPosition="0" size="210,21" transparent="1" alphatest="on" />
+				<widget name="stars" position="790,40" size="210,21" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_filled.png" transparent="1" />
+			</screen>"""
+	elif (getDesktop(0).size().width() == 1024):
+		skin = """
+			<screen name="IMDB" position="97,78" size="830,420" title="Internet Movie Database Details Plugin" >
+				<eLabel backgroundColor="red" position="54,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="248,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="442,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="636,410" size="140,3" zPosition="0" />
+				<widget name="key_red" position="54,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_green" position="248,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_yellow" position="442,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_blue" position="636,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="titellabel" position="10,40" size="580,45" valign="center" font="Regular;22"/>
+				<widget name="detailslabel" position="105,90" size="695,140" font="Regular;18" />
+				<widget name="castlabel" position="10,235" size="790,140" font="Regular;18" />
+				<widget name="extralabel" position="10,40" size="790,350" font="Regular;18" />
+				<widget name="ratinglabel" position="590,62" size="210,20" halign="center" font="Regular;18" foregroundColor="#f0b400"/>
+				<widget name="statusbar" position="10,10" size="790,20" font="Regular;16" foregroundColor="#cccccc" />
+				<widget name="poster" position="4,90" size="96,140" alphatest="on" />
+				<widget name="menu" position="10,115" size="790,255" zPosition="3" scrollbarMode="showOnDemand" />
+				<widget name="starsbg" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_empty.png" position="590,40" zPosition="0" size="210,21" transparent="1" alphatest="on" />
+				<widget name="stars" position="590,40" size="210,21" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_filled.png" transparent="1" />
+			</screen>"""
+	else:
+		skin = """
+			<screen name="IMDB" position="45,78" size="630,420" title="Internet Movie Database Details Plugin" >
+				<eLabel backgroundColor="red" position="20,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="170,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="320,410" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="470,410" size="140,3" zPosition="0" />
+				<widget name="key_red" position="20,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_green" position="170,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_yellow" position="320,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="key_blue" position="470,385" zPosition="1" size="140,25" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget name="titellabel" position="10,40" size="380,45" valign="center" font="Regular;22"/>
+				<widget name="detailslabel" position="105,90" size="495,140" font="Regular;18" />
+				<widget name="castlabel" position="10,235" size="590,140" font="Regular;18" />
+				<widget name="extralabel" position="10,40" size="590,350" font="Regular;18" />
+				<widget name="ratinglabel" position="390,62" size="210,20" halign="center" font="Regular;18" foregroundColor="#f0b400"/>
+				<widget name="statusbar" position="10,10" size="590,20" font="Regular;16" foregroundColor="#cccccc" />
+				<widget name="poster" position="4,90" size="96,140" alphatest="on" />
+				<widget name="menu" position="10,115" size="590,255" zPosition="3" scrollbarMode="showOnDemand" />
+				<widget name="starsbg" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_empty.png" position="390,40" zPosition="0" size="210,21" transparent="1" alphatest="on" />
+				<widget name="stars" position="390,40" size="210,21" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/IMDb/starsbar_filled.png" transparent="1" />
+			</screen>"""
+
+	def __init__(self, session, eventName, callbackNeeded=False):
+		Screen.__init__(self, session)
+
+		self.eventName = eventName
+		global searchname
+		searchname = eventName		
+		print "[Imdb] searchname", searchname
+		
+		self.callbackNeeded = callbackNeeded
+		self.callbackData = ""
+		self.callbackGenre = ""
+
+		self.dictionary_init()
+
+		self["poster"] = Pixmap()
+		self.picload = ePicLoad()
+		self.picload.PictureData.get().append(self.paintPosterPixmapCB)
+
+		self["stars"] = ProgressBar()
+		self["starsbg"] = Pixmap()
+		self["stars"].hide()
+		self["starsbg"].hide()
+		self.ratingstars = -1
+
+		self["titellabel"] = Label(_("The Internet Movie Database"))
+		self["detailslabel"] = ScrollLabel("")
+		self["castlabel"] = ScrollLabel("")
+		self["extralabel"] = ScrollLabel("")
+		self["statusbar"] = Label("")
+		self["ratinglabel"] = Label("")
+		self.resultlist = []
+		self["menu"] = MenuList(self.resultlist)
+		self["menu"].hide()
+
+		self["key_red"] = Button(_("Exit"))
+		self["key_green"] = Button("")
+		self["key_yellow"] = Button("")
+		self["key_blue"] = Button("")
+
+		# 0 = multiple query selection menu page
+		# 1 = movie info page
+		# 2 = extra infos page
+		self.Page = 0
+
+		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MovieSelectionActions", "DirectionActions"],
+		{
+			"ok": self.showDetails,
+			"cancel": self.exit,
+			"down": self.pageDown,
+			"up": self.pageUp,
+			"red": self.exit,
+			"green": self.showMenu,
+			"yellow": self.showDetails,
+			"blue": self.showExtras,
+			"contextMenu": self.openChannelSelection,
+			"showEventInfo": self.showDetails
+		}, -1)
+
+		self.getIMDB()
+
+	def exit(self):
+		if self.callbackNeeded:
+			self.close([self.callbackData, self.callbackGenre])
+		else:
+			self.close()
+
+	def dictionary_init(self):
+		syslang = language.getLanguage()
+		if "de" not in syslang:
+			self.IMDBlanguage = ""  # set to empty ("") for english version
+		else:
+			self.IMDBlanguage = "german." # it's a subdomain, so add a '.' at the end
+
+		self.htmltags = re.compile('<.*?>')
+
+		self.generalinfomask = re.compile(
+		'<h1>(?P<title>.*?) <.*?</h1>.*?'
+		'(?:.*?<h5>(?P<g_director>Regisseur|Directors?):</h5>.*?<a href=\".*?\">(?P<director>.*?)</a>)*'
+		'(?:.*?<h5>(?P<g_creator>Sch\S*?pfer|Creators?):</h5>.*?<a href=\".*?\">(?P<creator>.*?)</a>)*'
+		'(?:.*?<h5>(?P<g_seasons>Seasons):</h5>(?:.*?)<a href=\".*?\">(?P<seasons>\d+?)</a>\s+?(?:<a class|\|\s+?<a href="episodes#season-unknown))*'
+		'(?:.*?<h5>(?P<g_writer>Drehbuch|Writer).*?</h5>.*?<a href=\".*?\">(?P<writer>.*?)</a>)*'
+		'(?:.*?<h5>(?P<g_premiere>Premiere|Release Date).*?</h5>\s+<div.*?>\s?(?P<premiere>.*?)\n\s.*?<)*'
+		'(?:.*?<h5>(?P<g_alternativ>Auch bekannt als|Also Known As):</h5><div.*?>\s*(?P<alternativ>.*?)<br>\s{0,8}<a.*?>(?:mehr|more))*'
+		'(?:.*?<h5>(?P<g_country>Land|Country):</h5>\s+<div.*?>(?P<country>.*?)</div>(?:.*?mehr|\s+?</div>))*'
+		, re.DOTALL)
+
+		self.extrainfomask = re.compile(
+		'(?:.*?<h5>(?P<g_tagline>Werbezeile|Tagline?):</h5>\n(?P<tagline>.+?)<)*'
+		'(?:.*?<h5>(?P<g_outline>Kurzbeschreibung|Plot Outline):</h5>(?P<outline>.+?)<)*'
+		'(?:.*?<h5>(?P<g_synopsis>Plot Synopsis):</h5>(?:.*?)(?:<a href=\".*?\">)*?(?P<synopsis>.+?)(?:</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_keywords>Plot Keywords):</h5>(?P<keywords>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_awards>Filmpreise|Awards):</h5>(?P<awards>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_runtime>L\S*?nge|Runtime):</h5>(?P<runtime>.+?)</div>)*'
+		'(?:.*?<h5>(?P<g_language>Sprache|Language):</h5>(?P<language>.+?)</div>)*'
+		'(?:.*?<h5>(?P<g_color>Farbe|Color):</h5>(?P<color>.+?)</div>)*'
+		'(?:.*?<h5>(?P<g_aspect>Seitenverh\S*?ltnis|Aspect Ratio):</h5>(?P<aspect>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_sound>Tonverfahren|Sound Mix):</h5>(?P<sound>.+?)</div>)*'
+		'(?:.*?<h5>(?P<g_cert>Altersfreigabe|Certification):</h5>(?P<cert>.+?)</div>)*'
+		'(?:.*?<h5>(?P<g_locations>Drehorte|Filming Locations):</h5>(?P<locations>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_company>Firma|Company):</h5>(?P<company>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_trivia>Dies und das|Trivia):</h5>(?P<trivia>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_goofs>Pannen|Goofs):</h5>(?P<goofs>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_quotes>Dialogzitate|Quotes):</h5>(?P<quotes>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h5>(?P<g_connections>Bez\S*?ge zu anderen Titeln|Movie Connections):</h5>(?P<connections>.+?)(?:mehr|more</a>|</div>))*'
+		'(?:.*?<h3>(?P<g_comments>Nutzerkommentare|User Comments)</h3>.*?<a href="/user/ur\d{7,7}/comments">(?P<commenter>.+?)\n</div>.*?<p>(?P<comment>.+?)</p>)*'
+		, re.DOTALL)
+
+	def resetLabels(self):
+		self["detailslabel"].setText("")
+		self["ratinglabel"].setText("")
+		self["titellabel"].setText("")
+		self["castlabel"].setText("")
+		self["titellabel"].setText("")
+		self["extralabel"].setText("")
+		self.ratingstars = -1
+
+	def pageUp(self):
+		if self.Page == 0:
+			self["menu"].instance.moveSelection(self["menu"].instance.moveUp)
+		if self.Page == 1:
+			self["castlabel"].pageUp()
+			self["detailslabel"].pageUp()
+		if self.Page == 2:
+			self["extralabel"].pageUp()
+
+	def pageDown(self):
+		if self.Page == 0:
+			self["menu"].instance.moveSelection(self["menu"].instance.moveDown)
+		if self.Page == 1:
+			self["castlabel"].pageDown()
+			self["detailslabel"].pageDown()
+		if self.Page == 2:
+			self["extralabel"].pageDown()
+
+	def showMenu(self):
+		if ( self.Page is 1 or self.Page is 2 ) and self.resultlist:
+			self["menu"].show()
+			self["stars"].hide()
+			self["starsbg"].hide()
+			self["ratinglabel"].hide()
+			self["castlabel"].hide()
+			self["poster"].hide()
+			self["extralabel"].hide()
+			global searchname
+			self["titellabel"].setText(searchname)
+#			self["titellabel"].setText(_("Ambiguous results"))
+			self["detailslabel"].setText(_("Please select the matching entry"))
+			self["detailslabel"].show()
+			self["key_blue"].setText("")
+			self["key_green"].setText(_("Title Menu"))
+			self["key_yellow"].setText(_("Details"))
+			self.Page = 0
+
+	def showDetails(self):
+		self["ratinglabel"].show()
+		self["castlabel"].show()
+		self["detailslabel"].show()
+
+		if self.resultlist and self.Page == 0:
+			link = self["menu"].getCurrent()[1]
+			title = self["menu"].getCurrent()[0]
+			self["statusbar"].setText(_("Re-Query IMDb: %s...") % (title))
+			localfile = "/tmp/imdbquery2.html"
+			fetchurl = "http://" + self.IMDBlanguage + "imdb.com/title/" + link
+			print "[IMDB] downloading query " + fetchurl + " to " + localfile
+			downloadPage(fetchurl,localfile).addCallback(self.IMDBquery2).addErrback(self.fetchFailed)
+			self["menu"].hide()
+			self.resetLabels()
+			self.Page = 1
+
+		if self.Page == 2:
+			self["extralabel"].hide()
+			self["poster"].show()
+			if self.ratingstars > 0:
+				self["starsbg"].show()
+				self["stars"].show()
+				self["stars"].setValue(self.ratingstars)
+
+			self.Page = 1
+
+	def showExtras(self):
+		if self.Page == 1:
+			self["extralabel"].show()
+			self["detailslabel"].hide()
+			self["castlabel"].hide()
+			self["poster"].hide()
+			self["stars"].hide()
+			self["starsbg"].hide()
+			self["ratinglabel"].hide()
+			self.Page = 2
+
+	def openChannelSelection(self):
+		self.session.openWithCallback(
+			self.channelSelectionClosed,
+			IMDBChannelSelection
+		)
+
+	def channelSelectionClosed(self, ret = None):
+		if ret:
+			self.eventName = ret
+			self.Page = 0
+			self.resultlist = []
+			self["menu"].hide()
+			self["ratinglabel"].show()
+			self["castlabel"].show()
+			self["detailslabel"].show()
+			self["poster"].hide()
+			self["stars"].hide()
+			self["starsbg"].hide()
+			self.getIMDB()
+
+	def getIMDB(self):
+#		print "!!!!!!!!!!!!!!!!!!!!!!!wo"
+		self.resetLabels()
+		if self.eventName is "":
+#			print "!!!!!!!!!!!!!!!!!!!!!!!wo1"
+			s = self.session.nav.getCurrentService()
+			info = s.info()
+			event = info.getEvent(0) # 0 = now, 1 = next
+			if event:
+				self.eventName = event.getEventName()
+		if self.eventName is not "":
+#			print "!!!!!!!!!!!!!!!!!!!!!!!wo2"
+			self["statusbar"].setText(_("Query IMDb: %s...") % (self.eventName))
+			event_quoted = urllib.quote(self.eventName.decode('utf8').encode('latin-1','ignore'))
+			localfile = "/tmp/imdbquery.html"
+			fetchurl = "http://" + self.IMDBlanguage + "imdb.com/find?q=" + event_quoted + "&s=tt&site=aka"
+			print "[IMDB] Downloading Query " + fetchurl + " to " + localfile
+			downloadPage(fetchurl,localfile).addCallback(self.IMDBquery).addErrback(self.fetchFailed)
+		else:
+#			print "!!!!!!!!!!!!!!!!!!!!!!!wo3"	
+			global searchname
+			print "[Imdb-getIMDB] error get searchname back", searchname
+			self["statusbar"].setText(searchname)
+#			self["statusbar"].setText(_("Could't get Eventname"))
+
+	def fetchFailed(self,string):
+		print "[IMDB] fetch failed", string
+		self["statusbar"].setText(_("IMDb Download failed"))
+#		self.closed()
+
+	def html2utf8(self,in_html):
+		htmlentitynumbermask = re.compile('(&#(\d{1,5}?);)')
+		htmlentityhexmask = re.compile('(&#x([0-9A-Fa-f]{2,2}?);)')
+		htmlentitynamemask = re.compile('(&([^#]\D{1,5}?);)')
+		entitydict = {}
+		entityhexdict = {}
+		entities = htmlentitynamemask.finditer(in_html)
+
+		for x in entities:
+			entitydict[x.group(1)] = x.group(2)
+		for key, name in entitydict.items():
+			entitydict[key] = htmlentitydefs.name2codepoint[name]
+		entities = htmlentityhexmask.finditer(in_html)
+
+		for x in entities:
+			entityhexdict[x.group(1)] = x.group(2)
+
+		for key, name in entityhexdict.items():
+			entitydict[key] = "%d" % int(key[3:5], 16)
+			print "key:", key, "before:", name, "after:", entitydict[key]
+		
+		entities = htmlentitynumbermask.finditer(in_html)
+		for x in entities:
+			entitydict[x.group(1)] = x.group(2)
+		for key, codepoint in entitydict.items():
+			in_html = in_html.replace(key, (unichr(int(codepoint)).encode('latin-1')))
+		self.inhtml = in_html.decode('latin-1').encode('utf8')
+
+	def IMDBquery(self,string):
+		print "[IMDBquery]"
+		self["statusbar"].setText(_("IMDb Download completed"))
+
+		self.html2utf8(open("/tmp/imdbquery.html", "r").read())
+
+		self.generalinfos = self.generalinfomask.search(self.inhtml)
+#		print "!!!!!!!!!!!!!!!!!!!!!!!wo10"
+
+		if self.generalinfos:
+#			print "!!!!!!!!!!!!!!!!!!!!!!!wo20"
+			self.IMDBparse()
+		else:
+#			print "!!!!!!!!!!!!!!!!!!!!!!!wo30"		
+			if re.search("<title>(?:IMDb.{0,9}Search|IMDb Titelsuche)</title>", self.inhtml):
+#				print "!!!!!!!!!!!!!!!!!!!!!!!wo40"
+				searchresultmask = re.compile("<tr> <td.*?img src.*?>.*?<a href=\".*?/title/(tt\d{7,7})/\".*?>(.*?)</td>", re.DOTALL)
+				searchresults = searchresultmask.finditer(self.inhtml)
+				self.resultlist = [(self.htmltags.sub('',x.group(2)), x.group(1)) for x in searchresults]
+				self["menu"].l.setList(self.resultlist)
+				if len(self.resultlist) > 1:
+#					print "!!!!!!!!!!!!!!!!!!!!!!!wo50"
+#					global searchname
+#					self["detailslabel"].setText(searchname)
+
+					self.Page = 1
+					self.showMenu()
+				else:
+#					print "!!!!!!!!!!!!!!!!!!!!!!!wo60"
+				
+					global searchname
+					print "[Imdb-IMDBquery] error get searchname back", searchname
+					self["detailslabel"].setText(searchname)
+#					self["detailslabel"].setText(_("No IMDb match."))
+#					self["statusbar"].setText(_("No IMDb match."))
+					self["statusbar"].setText(_(searchname))
+#					self.closed()
+#					return
+
+			else:
+				splitpos = self.eventName.find('(')
+				if splitpos > 0 and self.eventName.endswith(')'):
+					self.eventName = self.eventName[splitpos+1:-1]
+					self["statusbar"].setText(_("Re-Query IMDb: %s...") % (self.eventName))
+					event_quoted = urllib.quote(self.eventName.decode('utf8').encode('latin-1','ignore'))
+					localfile = "/tmp/imdbquery.html"
+					fetchurl = "http://" + self.IMDBlanguage + "imdb.com/find?q=" + event_quoted + "&s=tt&site=aka"
+					print "[IMDB] Downloading Query " + fetchurl + " to " + localfile
+					downloadPage(fetchurl,localfile).addCallback(self.IMDBquery).addErrback(self.fetchFailed)
+				else:
+					self["detailslabel"].setText(_("IMDb query failed!"))
+
+	def IMDBquery2(self,string):
+		self["statusbar"].setText(_("IMDb Re-Download completed"))
+		self.html2utf8(open("/tmp/imdbquery2.html", "r").read())
+		self.generalinfos = self.generalinfomask.search(self.inhtml)
+		self.IMDBparse()
+
+	def IMDBparse(self):
+		print "[IMDBparse]"
+		self.Page = 1
+		Detailstext = _("No details found.")
+		if self.generalinfos:
+			self["key_yellow"].setText(_("Details"))
+			self["statusbar"].setText(_("IMDb Details parsed"))
+			Titeltext = self.generalinfos.group("title")
+			if len(Titeltext) > 57:
+				Titeltext = Titeltext[0:54] + "..."
+			self["titellabel"].setText(Titeltext)
+
+			Detailstext = ""
+
+			genreblockmask = re.compile('<h5>Genre:</h5>\n<p>\s+?(.*?)\s+?(?:mehr|more|</p|<a class|</div>)', re.DOTALL)
+			genreblock = genreblockmask.findall(self.inhtml)
+			if genreblock:
+				genres = self.htmltags.sub('', genreblock[0])
+				if genres:
+					Detailstext += "Genre: "
+					Detailstext += genres
+					self.callbackGenre = genres
+
+			for category in ("director", "creator", "writer", "premiere", "seasons"):
+				if self.generalinfos.group('g_'+category):
+					Detailstext += "\n" + self.generalinfos.group('g_'+category) + ": " + self.generalinfos.group(category)
+
+			if self.generalinfos.group("country"):
+				Detailstext += "\n" + self.generalinfos.group("g_country") + ": " + self.htmltags.sub('', self.generalinfos.group("country").replace('\n','').replace("<br>",'\n').replace("  ",' '))
+
+			if self.generalinfos.group("alternativ"):
+				Detailstext += "\n" + self.generalinfos.group("g_alternativ") + ": " + self.htmltags.sub('', self.generalinfos.group("alternativ").replace('\n','').replace("<br>",'\n').replace("  ",' '))
+
+			ratingmask = re.compile('<h5>(?P<g_rating>Nutzer-Bewertung|User Rating):</h5>.*?<b>(?P<rating>.*?)/10</b>', re.DOTALL)
+			rating = ratingmask.search(self.inhtml)
+			Ratingtext = _("no user rating yet")
+			if rating:
+				Ratingtext = rating.group("g_rating") + ": " + rating.group("rating") + " / 10"
+				self.ratingstars = int(10*round(float(rating.group("rating").replace(',','.')),1))
+				outrating = float(rating.group("rating").replace(',','.'))
+				self["stars"].show()
+				self["stars"].setValue(self.ratingstars)
+				self["starsbg"].show()
+			self["ratinglabel"].setText(Ratingtext)
+			castmask = re.compile('<td class="nm">.*?>(.*?)</a>.*?<td class="char">(?:<a.*?>)?(.*?)(?:</a>)?</td>', re.DOTALL)
+			castresult = castmask.finditer(self.inhtml)
+			if castresult:
+				Casttext = ""
+				count = 0
+				firstcast = ""
+				for x in castresult:
+					count += 1
+					if count == 1:
+						firstcast = self.htmltags.sub('', x.group(1))
+					else:						
+						if count == 2:
+							Casttext += "\n" + _("Second Cast: ") + "\n---------------\n" + self.htmltags.sub('', x.group(1))
+						else:							
+							Casttext += "\n" + self.htmltags.sub('', x.group(1))
+
+					if x.group(2):
+						if count == 1:
+							firstcast += _(" as ") + self.htmltags.sub('', x.group(2).replace('/ ...',''))
+						else:
+							Casttext += _(" as ") + self.htmltags.sub('', x.group(2).replace('/ ...',''))
+				if Casttext is not "":
+					Casttext = "\n" + _("Cast: ") + firstcast + "\n" + Casttext
+				else:
+					Casttext = _("No cast list found in the database.")
+				self["castlabel"].setText(Casttext)
+			postermask = re.compile('<div class="photo">.*?<img .*? src=\"(http.*?)\" .*?>', re.DOTALL)
+			posterurl = postermask.search(self.inhtml)
+			if posterurl and posterurl.group(1).find("jpg") > 0:
+				posterurl = posterurl.group(1)
+				self["statusbar"].setText(_("Downloading Movie Poster: %s...") % (posterurl))
+				localfile = "/tmp/poster.jpg"
+				print "[IMDB] downloading poster " + posterurl + " to " + localfile
+				downloadPage(posterurl,localfile).addCallback(self.IMDBPoster).addErrback(self.fetchFailed)
+			else:
+				self.IMDBPoster("kein Poster")
+			extrainfos = self.extrainfomask.search(self.inhtml)
+
+			if extrainfos:
+				Extratext = "\n" + _("Extra Info: ") + "\n------------\n"
+
+				for category in ("tagline","outline","synopsis","keywords","awards","runtime","language","color","aspect","sound","cert","locations","company","trivia","goofs","quotes","connections"):
+					if extrainfos.group('g_'+category):
+						Extratext += extrainfos.group('g_'+category) + ": " + self.htmltags.sub('',extrainfos.group(category).replace("\n",'').replace("<br>",'\n')) + "\n"
+				if extrainfos.group("g_comments"):
+					stripmask = re.compile('\s{2,}', re.DOTALL)
+					Extratext += extrainfos.group("g_comments") + " [" + stripmask.sub(' ', self.htmltags.sub('',extrainfos.group("commenter"))) + "]: " + self.htmltags.sub('',extrainfos.group("comment").replace("\n",' ')) + "\n"
+
+				self["extralabel"].setText(Extratext)
+				self["extralabel"].hide()
+				self["key_blue"].setText(_("Extra Info"))
+
+		self["detailslabel"].setText(Detailstext)
+		
+		if outrating is not None:
+			Detailstext += "\nRating: " + str(outrating) + " / 10"
+		for x in Casttext:
+			Detailstext += Casttext
+			break
+
+		for x in Extratext:
+			Detailstext += "\n" + Extratext
+			break		
+		
+		self.callbackData = Detailstext
+
+		
+	def IMDBPoster(self,string):
+		self["statusbar"].setText(_("IMDb Details parsed"))
+		if not string:
+			filename = "/tmp/poster.jpg"
+		else:
+			filename = resolveFilename(SCOPE_PLUGINS, "Extensions/IMDb/no_poster.png")
+		sc = AVSwitch().getFramebufferScale()
+		self.picload.setPara((self["poster"].instance.size().width(), self["poster"].instance.size().height(), sc[0], sc[1], False, 1, "#00000000"))
+		self.picload.startDecode(filename)
+
+	def paintPosterPixmapCB(self, picInfo=None):
+		ptr = self.picload.getData()
+		if ptr != None:
+			self["poster"].instance.setPixmap(ptr.__deref__())
+			self["poster"].show()
+
+	def createSummary(self):
+		return IMDbLCDScreen
+
+class IMDbLCDScreen(Screen):
+	skin = """
+	<screen position="0,0" size="132,64" title="IMDB Plugin">
+		<widget name="headline" position="4,0" size="128,22" font="Regular;20"/>
+		<widget source="session.Event_Now" render="Label" position="6,26" size="120,34" font="Regular;14" >
+			<convert type="EventName">Name</convert>
+		</widget>
+	</screen>"""
+
+	def __init__(self, session, parent):
+		Screen.__init__(self, session)
+		self["headline"] = Label(_("IMDb Plugin"))
+
+def eventinfo(session, servicelist, **kwargs):
+	ref = session.nav.getCurrentlyPlayingServiceReference()
+	session.open(IMDBEPGSelection, ref)
+
+def main(session, eventName="", **kwargs):
+	ret = os_system("checknet 4.2.2.1")
+	if ret == 0:
+		session.open(IMDB, eventName)
+	else:
+		session.open(MessageBox, _("Start of application without internet not allowed."), type = MessageBox.TYPE_INFO, timeout = 10)
+
+def Plugins(**kwargs):
+	try:
+		return [PluginDescriptor(name="IMDb Details",
+				description=_("Query details from the Internet Movie Database"),
+				icon="imdb.png",
+				where = PluginDescriptor.WHERE_PLUGINMENU,
+				fnc = main),
+				PluginDescriptor(name="IMDb Details",
+				description=_("Query details from the Internet Movie Database"),
+				where = PluginDescriptor.WHERE_EVENTINFO,
+				fnc = eventinfo)
+				]
+	except AttributeError:
+		wherelist = [PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU]
+		return PluginDescriptor(name="IMDb Details",
+				description=_("Query details from the Internet Movie Database"),
+				icon="imdb.png",
+				where = wherelist,
+				fnc=main)	
Index: ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/LICENSE
===================================================================
--- ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/LICENSE	(revision 14689)
+++ ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/LICENSE	(revision 14689)
@@ -0,0 +1,12 @@
+This plugin is licensed under the Creative Commons 
+Attribution-NonCommercial-ShareAlike 3.0 Unported 
+License. To view a copy of this license, visit
+http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative
+Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+
+Alternatively, this plugin may be distributed and executed on hardware which
+is licensed by Dream Multimedia GmbH.
+
+This plugin is NOT free software. It is open source, you are allowed to
+modify it (if you keep the license), but it may not be commercially 
+distributed other than under the conditions noted above.
Index: ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/__init__.py
===================================================================
--- ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/__init__.py	(revision 14689)
+++ ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/__init__.py	(revision 14689)
@@ -0,0 +1,1 @@
+ 
Index: ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/keymap.xml
===================================================================
--- ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/keymap.xml	(revision 14689)
+++ ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/keymap.xml	(revision 14689)
@@ -0,0 +1,30 @@
+<keymap>
+	<map context="DVDPlayerActions">
+		<key id="KEY_MENU" mapto="dvdMenu" flags="m" />
+		<key id="KEY_INFO" mapto="toggleInfo" flags="m" />
+		<key id="KEY_CHANNELUP" mapto="nextTitle" flags="m" />
+		<key id="KEY_CHANNELDOWN" mapto="prevTitle" flags="m" />
+		<key id="KEY_YELLOW" mapto="dvdAudioMenu" flags="m"/>
+		<key id="KEY_BLUE" mapto="nextAudioTrack" flags="m"/>
+		<key id="KEY_TEXT" mapto="nextSubtitleTrack" flags="m" />
+		<device name="dreambox remote control (native)">
+			<key id="KEY_PREVIOUS" mapto="prevChapter" flags="m" />
+			<key id="KEY_NEXT" mapto="nextChapter" flags="m" />
+			<key id="KEY_TV" mapto="tv" flags="m" />
+			<key id="KEY_AUDIO" mapto="dvdAudioMenu" flags="m" />
+			<key id="KEY_RADIO" mapto="nextAudioTrack" flags="m" />
+			<key id="KEY_TEXT" mapto="nextSubtitleTrack" flags="m" />
+			<key id="KEY_VIDEO" mapto="nextAngle" flags="m" />
+		</device>
+		<device name="dreambox advanced remote control (native)">
+			<key id="KEY_PREVIOUS" mapto="prevChapter" flags="m" />
+			<key id="KEY_NEXT" mapto="nextChapter" flags="m" />
+			<key id="KEY_TV" mapto="tv" flags="m" />
+			<key id="KEY_STOP" mapto="tv" flags="m" />
+			<key id="KEY_RADIO" mapto="dvdAudioMenu" flags="l" />
+			<key id="KEY_RADIO" mapto="nextAudioTrack" flags="m" />
+			<key id="KEY_TEXT" mapto="nextSubtitleTrack" flags="m" />
+			<key id="KEY_VIDEO" mapto="nextAngle" flags="m" />
+		</device>
+	</map>
+</keymap>
Index: ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.py
===================================================================
--- ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.py	(revision 14689)
+++ ipk/source/players_dvdplayer_1_0/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.py	(revision 14689)
@@ -0,0 +1,885 @@
+from os import path as os_path, remove as os_remove, listdir as os_listdir, system
+from enigma import eTimer, iPlayableService, iServiceInformation, eServiceReference, iServiceKeys, getDesktop, eAVSwitch, eConsoleAppContainer, evfd
+from Screens.Screen import Screen
+from Screens.MessageBox import MessageBox
+from Screens.ChoiceBox import ChoiceBox
+from Screens.HelpMenu import HelpableScreen
+from Screens.InfoBarGenerics import InfoBarSubtitleSupport, InfoBarAudioSelection, InfoBarSecondInfobar, InfoBarResolutionSelection, InfoBarSeek, InfoBarPVRState, InfoBarCueSheetSupport, InfoBarShowHide, InfoBarNotifications
+from Components.ActionMap import ActionMap, NumberActionMap, HelpableActionMap
+from Components.Label import Label
+from Components.Pixmap import Pixmap
+from Components.FileList import FileList
+from Components.MenuList import MenuList
+from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase
+from Components.config import config
+from Tools.Directories import pathExists, fileExists
+from Components.Harddisk import harddiskmanager
+from Components.Console import Console
+from Components.config import config, ConfigYesNo, ConfigSubsection
+try:
+	from Plugins.Extensions.MediaCenter.GlobalFunctions import InfoBarAspectSelection
+except:
+	pass
+import servicedvd # load c++ part of dvd player plugin
+import os
+import time
+
+config.plugins.DVDPlayer = ConfigSubsection()
+config.plugins.DVDPlayer.Enabled = ConfigYesNo(default=False)
+
+lastpath = "/media/"
+tmppolicy = "None"
+
+def command(comandline):
+	comandline = comandline + " >/tmp/command.txt"
+	os.system(comandline)
+	text = ""
+	if os.path.exists("/tmp/command.txt") is True:
+		file = open("/tmp/command.txt", "r")
+		for line in file:
+			text = text + line.strip() + '\n'
+		file.close
+	# if one or last line then remove linefeed
+	if text[-1:] == '\n': text = text[:-1]
+	comandline = text
+	os.system("rm /tmp/command.txt")
+	return comandline
+
+boxversion = command('cat /etc/model')
+
+global HDskin
+global KSskin
+HDskin = False
+KSskin = False
+try:
+	skin_w = getDesktop(0).size().width()
+	if skin_w == 1280:
+		HDskin = True
+		KSskin = False
+	elif skin_w == 1024:
+		HDskin = False
+		KSskin = True
+	else:
+		HDskin = False
+		KSskin = False
+except:
+	HDskin = False
+	KSskin = False
+
+def applySkinVars(skin,dict):
+	for key in dict.keys():
+		try:
+			skin = skin.replace('{'+key+'}',dict[key])
+		except Exception,e:
+			print e,"@key=",key
+	return skin
+
+def tryOpen(filename):
+	try:
+		procFile = open(filename)
+	except IOError:
+		return ""
+	return procFile
+		
+class FileBrowser(Screen):
+	skin = """
+		<screen name="FileBrowser" position="center,center" size="520,376" title="DVD File Browser" >
+			<widget name="filelist" position="0,0" size="520,376" scrollbarMode="showOnDemand" />
+		</screen>"""
+
+	def __init__(self, session, dvd_filelist = [ ]):
+		Screen.__init__(self, session)
+
+		self.dvd_filelist = dvd_filelist
+		if len(dvd_filelist):	
+			self["filelist"] = MenuList(self.dvd_filelist)
+		else:
+			global lastpath
+			if lastpath is not None:
+				currDir = lastpath
+			else:
+				currDir = "/media/dvd/"
+			if not pathExists(currDir):
+				currDir = "/"
+
+			self.filelist = FileList(currDir, matchingPattern = "(?i)^.*\.(iso)", useServiceRef = True)
+			self["filelist"] = self.filelist
+
+		self["FilelistActions"] = ActionMap(["OkCancelActions"],
+			{
+				"ok": self.ok,
+				"cancel": self.exit
+			})
+
+	def ok(self):
+		if len(self.dvd_filelist):
+			print "OK " + self["filelist"].getCurrent()
+			self.close(self["filelist"].getCurrent())
+		else:
+			global lastpath
+			filename = self["filelist"].getFilename()
+			if filename is not None:
+				if filename.upper().endswith("VIDEO_TS/"):
+					print "dvd structure found, trying to open..."
+					dvdpath = filename[0:-9]
+					lastpath = (dvdpath.rstrip("/").rsplit("/",1))[0]
+					print "lastpath video_ts/=", lastpath
+					self.close(dvdpath)
+					return
+			if self["filelist"].canDescent(): # isDir
+				self["filelist"].descent()
+				pathname = self["filelist"].getCurrentDirectory() or ""
+				if fileExists(pathname+"VIDEO_TS.IFO"):
+					print "dvd structure found, trying to open..."
+					lastpath = (pathname.rstrip("/").rsplit("/",1))[0]
+					print "lastpath video_ts.ifo=", lastpath
+					self.close(pathname)
+			else:
+				lastpath = filename[0:filename.rfind("/")]
+				print "lastpath directory=", lastpath
+				self.close(filename)
+
+	def exit(self):
+		self.close(None)
+
+class DVDSummary(Screen):
+	skin = """
+	<screen position="0,0" size="132,64">
+		<widget source="session.CurrentService" render="Label" position="5,4" size="120,28" font="Regular;12" transparent="1" >
+			<convert type="ServiceName">Name</convert>
+		</widget>
+		<widget name="DVDPlayer" position="5,30" size="66,16" font="Regular;12" transparent="1" />
+		<widget name="Chapter" position="72,30" size="54,16" font="Regular;12" transparent="1" halign="right" />
+		<widget source="session.CurrentService" render="Label" position="66,46" size="60,18" font="Regular;16" transparent="1" halign="right" >
+			<convert type="ServicePosition">Position</convert>
+		</widget>
+		<widget source="session.CurrentService" render="Progress" position="6,46" size="60,18" borderWidth="1" >
+			<convert type="ServicePosition">Position</convert>
+		</widget>
+	</screen>"""
+
+	def __init__(self, session, parent):
+		Screen.__init__(self, session, parent)
+
+		self["DVDPlayer"] = Label("DVD Player")
+		self["Title"] = Label("")
+		self["Time"] = Label("")
+		self["Chapter"] = Label("")
+
+	def updateChapter(self, chapter):
+		self["Chapter"].setText(chapter)
+
+	def setTitle(self, title):
+		self["Title"].setText(title)
+
+class DVDOverlay(Screen):
+	def __init__(self, session, args = None):
+		desktop_size = getDesktop(0).size()
+		DVDOverlay.skin = """<screen name="DVDOverlay" position="0,0" size="%d,%d" flags="wfNoBorder" zPosition="-1" backgroundColor="transparent" />""" %(desktop_size.width(), desktop_size.height())
+		Screen.__init__(self, session)
+
+class ChapterZap(Screen):
+	skin = """
+	<screen name="ChapterZap" position="center,center" size="250,60" title="Chapter" >
+		<widget name="chapter" position="35,15" size="110,25" font="Regular;23" />
+		<widget name="number" position="145,15" size="80,25" halign="right" font="Regular;23" />
+	</screen>"""
+
+	def quit(self):
+		self.Timer.stop()
+		self.close(0)
+
+	def keyOK(self):
+		self.Timer.stop()
+		self.close(int(self["number"].getText()))
+
+	def keyNumberGlobal(self, number):
+		self.Timer.start(3000, True)		#reset timer
+		self.field = self.field + str(number)
+		self["number"].setText(self.field)
+		if len(self.field) >= 4:
+			self.keyOK()
+
+	def __init__(self, session, number):
+		Screen.__init__(self, session)
+		self.field = str(number)
+
+		self["chapter"] = Label(_("Chapter:"))
+
+		self["number"] = Label(self.field)
+
+		self["actions"] = NumberActionMap( [ "SetupActions" ],
+			{
+				"cancel": self.quit,
+				"ok": self.keyOK,
+				"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
+			})
+
+		self.Timer = eTimer()
+		self.Timer.callback.append(self.keyOK)
+		self.Timer.start(3000, True)
+
+class DVDPlayer(Screen, InfoBarBase, InfoBarSubtitleSupport, InfoBarAudioSelection, InfoBarNotifications, InfoBarSeek, InfoBarPVRState, InfoBarShowHide, HelpableScreen, InfoBarCueSheetSupport, InfoBarAspectSelection, InfoBarSecondInfobar, InfoBarResolutionSelection):
+#	ALLOW_SUSPEND = True
+	ENABLE_RESUME_SUPPORT = True
+	skin = """
+		<screen name="DVDPlayer" flags="wfNoBorder" position="center,433" size="824,110" title="InfoBar" backgroundColor="#42000000">
+			<eLabel backgroundColor="#32000000" position="694,0" size="130,180" zPosition="1"/>
+			<eLabel backgroundColor="#32000000" position="0,0" size="693,35" zPosition="1"/>
+			<ePixmap position="712,10" zPosition="3" size="94,58" backgroundColor="transparent" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/MediaCenter/skins/Default/images/AAF-MC.png" alphatest="on" transparent="1"/>
+			<widget source="session.CurrentService" render="Progress" position="155,60" size="339,8" zPosition="3" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/MediaCenter/skins/Default/images/icons/progress_mp.png">
+				<convert type="ServicePosition">Position</convert>
+			</widget>
+			<ePixmap position="155,70" zPosition="2" size="339,17" pixmap="/usr/lib/enigma2/python/Plugins/Extensions/MediaCenter/skins/Default/images/icons/mp-scale2.png" alphatest="on"/>
+			<widget source="session.CurrentService" render="Label" position="10,6" size="550,23" valign="top" halign="left" zPosition="3" font="Regular;18" transparent="1">
+				<convert type="ServiceName">Name</convert>
+			</widget>
+			<widget source="session.CurrentService" render="Label" position="570,6" size="110,23" font="Regular;21" halign="right" backgroundColor="#251e1f20" foregroundColor="#f0f0f0" zPosition="3" transparent="1">
+				<convert type="ServicePosition">Length</convert>
+			</widget>
+			<widget source="session.CurrentService" render="Label" position="60,53" size="85,30" font="Regular;21" halign="right" backgroundColor="#251e1f20" foregroundColor="#f0f0f0" zPosition="3" transparent="1">
+				<convert type="ServicePosition">Position</convert>
+			</widget>
+			<widget source="session.CurrentService" render="Label" position="505,53" size="80,26" font="Regular;21" halign="left" backgroundColor="#251e1f20" foregroundColor="#f0f0f0" zPosition="3" transparent="1">
+				<convert type="ServicePosition">Remaining</convert>
+			</widget>
+			<widget source="global.CurrentTime" render="Label" position="695,77" zPosition="3" size="85,25" font="Regular;23" transparent="1" foregroundColor="#DBDBDB" halign="right" backgroundColor="#3A0000">
+				<convert type="ClockToText">Format:%H:%M</convert>
+			</widget>
+		</screen>
+	</screen>"""
+
+	def save_infobar_seek_config(self):
+		self.saved_config_speeds_forward = config.seek.speeds_forward.value
+		self.saved_config_speeds_backward = config.seek.speeds_backward.value
+		self.saved_config_enter_forward = config.seek.enter_forward.value
+		self.saved_config_enter_backward = config.seek.enter_backward.value
+		self.saved_config_seek_on_pause = config.seek.on_pause.value
+		self.saved_config_seek_speeds_slowmotion = config.seek.speeds_slowmotion.value
+
+	def change_infobar_seek_config(self):
+		config.seek.speeds_forward.value = [2, 4, 8, 16, 32, 64]
+		config.seek.speeds_backward.value = [8, 16, 32, 64]
+		config.seek.speeds_slowmotion.value = [ ]
+		config.seek.enter_forward.value = "2"
+		config.seek.enter_backward.value = "2"
+		config.seek.on_pause.value = "play"
+
+	def restore_infobar_seek_config(self):
+		config.seek.speeds_forward.value = self.saved_config_speeds_forward
+		config.seek.speeds_backward.value = self.saved_config_speeds_backward
+		config.seek.speeds_slowmotion.value = self.saved_config_seek_speeds_slowmotion
+		config.seek.enter_forward.value = self.saved_config_enter_forward
+		config.seek.enter_backward.value = self.saved_config_enter_backward
+		config.seek.on_pause.value = self.saved_config_seek_on_pause
+
+	def __init__(self, session, dvd_device = None, dvd_filelist = [ ], args = None):
+		try:
+			if HDskin:
+				pos_w = 280
+				pos_h = 500
+			elif KSskin:
+				pos_w = 152
+				pos_h = 380
+			else:
+				pos_w = 0
+				pos_h = 380
+		except:
+			pos_w = 0
+			pos_h = 380
+		
+		self.dict = {
+				'screen.pos': "%i,%i"%(pos_w,pos_h),
+				}
+		self.skin = applySkinVars(DVDPlayer.skin,self.dict)
+
+		self.debug = command('cat /var/etc/autostart/start-config | grep debug | cut -d = -f2')
+
+		config.plugins.DVDPlayer.Enabled = ConfigYesNo(default=True)
+
+		Screen.__init__(self, session)
+		config.SecondInfobar.Enabled = ConfigYesNo(default=False)
+		InfoBarBase.__init__(self)
+		InfoBarNotifications.__init__(self)
+		InfoBarCueSheetSupport.__init__(self, actionmap = "MediaPlayerCueSheetActions")
+		InfoBarShowHide.__init__(self)
+		HelpableScreen.__init__(self)
+		InfoBarSecondInfobar.__init__(self)
+		InfoBarAspectSelection.__init__(self)
+		InfoBarAudioSelection.__init__(self)
+		InfoBarSubtitleSupport.__init__(self)
+		self.save_infobar_seek_config()
+		self.change_infobar_seek_config()
+		InfoBarSeek.__init__(self)
+		InfoBarPVRState.__init__(self)
+		self.dvdScreen = self.session.instantiateDialog(DVDOverlay)
+
+		self.oldService = self.session.nav.getCurrentlyPlayingServiceReference()
+		self.session.nav.stopService()
+		self["audioLabel"] = Label("n/a")
+		self["subtitleLabel"] = Label("")
+		self["angleLabel"] = Label("")
+		self["chapterLabel"] = Label("")
+		self["anglePix"] = Pixmap()
+		self["anglePix"].hide()
+		self.last_audioTuple = None
+		self.last_subtitleTuple = None
+		self.last_angleTuple = None
+		self.totalChapters = 0
+		self.currentChapter = 0
+		self.totalTitles = 0
+		self.currentTitle = 0
+
+		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
+			{
+				iPlayableService.evStopped: self.__serviceStopped,
+				iPlayableService.evUser: self.__timeUpdated,
+				iPlayableService.evUser+1: self.__statePlay,
+				iPlayableService.evUser+2: self.__statePause,
+				iPlayableService.evUser+3: self.__osdFFwdInfoAvail,
+				iPlayableService.evUser+4: self.__osdFBwdInfoAvail,
+				iPlayableService.evUser+5: self.__osdStringAvail,
+				iPlayableService.evUser+6: self.__osdAudioInfoAvail,
+				iPlayableService.evUser+7: self.__osdSubtitleInfoAvail,
+				iPlayableService.evUser+8: self.__chapterUpdated,
+				iPlayableService.evUser+9: self.__titleUpdated,
+				iPlayableService.evUser+11: self.__menuOpened,
+				iPlayableService.evUser+12: self.__menuClosed,
+				iPlayableService.evUser+13: self.__osdAngleInfoAvail
+			})
+
+		self["DVDPlayerDirectionActions"] = ActionMap(["DirectionActions"],
+			{
+				#MENU KEY DOWN ACTIONS
+				"left": self.keyLeft,
+				"right": self.keyRight,
+				"up": self.keyUp,
+				"down": self.keyDown,
+
+				#MENU KEY REPEATED ACTIONS
+				"leftRepeated": self.doNothing,
+				"rightRepeated": self.doNothing,
+				"upRepeated": self.doNothing,
+				"downRepeated": self.doNothing,
+
+				#MENU KEY UP ACTIONS
+				"leftUp": self.doNothing,
+				"rightUp": self.doNothing,
+				"upUp": self.doNothing,
+				"downUp": self.doNothing,
+			})
+
+		self["OkCancelActions"] = ActionMap(["OkCancelActions"],
+			{
+				"ok": self.keyOk,
+			})
+
+		self["DVDPlayerPlaybackActions"] = HelpableActionMap(self, "DVDPlayerActions",
+			{
+				#PLAYER ACTIONS
+				"dvdMenu": (self.enterDVDMenu, _("show DVD main menu")),
+				"toggleInfo": (self.toggleInfo, _("toggle time, chapter, audio, subtitle info")),
+				"nextChapter": (self.nextChapter, _("forward to the next chapter")),
+				"prevChapter": (self.prevChapter, _("rewind to the previous chapter")),
+				"nextTitle": (self.nextTitle, _("jump forward to the next title")),
+				"prevTitle": (self.prevTitle, _("jump back to the previous title")),
+				"tv": (self.askLeavePlayer, _("exit DVD player or return to file browser")),
+				"dvdAudioMenu": (self.enterDVDAudioMenu, _("(show optional DVD audio menu)")),
+				"nextAudioTrack": (self.nextAudioTrack, _("switch to the next audio track")),
+				"nextSubtitleTrack": (self.nextSubtitleTrack, _("switch to the next subtitle language")),
+				"nextAngle": (self.nextAngle, _("switch to the next angle")),
+				"seekBeginning": self.seekBeginning,
+				"leavePlayer": (self.keyCancel, _("leave movie player...")),
+			}, -2)
+			
+		self["NumberActions"] = NumberActionMap( [ "NumberActions"],
+			{
+				"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,
+			})
+
+		self["ChannelSelectEditActions"] = ActionMap(["ChannelSelectEditActions"],
+			{
+				"contextMenu": self.enterDVDMenu,	
+			})
+
+		self["ChannelSelectEPGActions"] = ActionMap(["ChannelSelectEPGActions"],
+			{
+				"showEPGList": self.enterDVDAudioMenu,
+			})
+
+		self["DvdActions"] = ActionMap(["DvdActions"],
+			{
+				"stop": self.keyCancel,
+				"subtitles": self.subtitleSelection,
+				"prevBouquet": self.prevChapter,
+				"nextBouquet": self.nextChapter,
+				"blue": self.sleepTimer,
+				"red": self.videoTune,
+				"yellow": self.audioSelection,
+				"blue": self.sleepTimer,
+			})
+
+		self.onClose.append(self.__onClose)
+
+		from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+		hotplugNotifier.append(self.hotplugCB)
+		
+		if dvd_device:
+			self.physicalDVD = True
+		else:
+			self.scanHotplug()
+
+		self.dvd_filelist = dvd_filelist
+		self.onFirstExecBegin.append(self.opened)
+		self.service = None
+		self.in_menu = False
+
+	def sleepTimer(self):
+		from Screens.SleepTimerEdit import SleepTimerEdit
+		self.session.open(SleepTimerEdit)
+
+	def videoTune(self):
+		if os_path.isfile("/usr/lib/enigma2/python/Plugins/Extensions/Aafpanel/plugin.pyc") is True:
+			try:
+				from Plugins.Extensions.Aafpanel.plugin import VideoTuneMain
+				self.session.open(VideoTuneMain)
+			except:
+				pass
+
+	def subtitleSelection(self):
+		if self.debug != "off":
+			print "[MC_VideoPlayer] start subtitleSelection"
+		from Screens.AudioSelection import SubtitleSelection
+		self.session.open(SubtitleSelection, self)
+
+	def audioSelection(self):
+		if self.debug != "off":
+			print "[MC_VideoPlayer] start audioSelection"
+		from Screens.AudioSelection import AudioSelection
+		self.session.openWithCallback(self.audioSelected, AudioSelection, infobar=self)		
+
+	def videoSelection(self):
+		if self.debug != "off":
+			print "[MC_VideoPlayer] start videoSelection"
+		from Screens.InfoBarGenerics import InfoBarAudioSelection
+		self.session.open(self.aspectSelection)
+
+	def change_ratio(self):
+		print "change ratio by obi"		
+		policy_input = open("/proc/stb/video/policy", "r")
+		policy = policy_input.read()
+		policy_input.close()
+
+		print "VideoModeLight policy current", policy
+
+		global tmppolicy
+		print "VideoModeLight tmppolicy current", tmppolicy
+
+		if tmppolicy == "None": 
+			tmppolicy = policy
+												
+		if tmppolicy.find("letterbox") != -1:
+			print "VideoModeLight set policy letterbox"
+			tmppolicy = "non"
+#			os.system('echo letterbox > /proc/stb/video/policy')
+			eAVSwitch.getInstance().setAspectRatio(0)
+			self.session.open(MessageBox, 'LETTERBOX', MessageBox.TYPE_WARNING, timeout=2)
+
+		elif tmppolicy.find("non") != -1:
+			print "VideoModeLight set policy non"
+			tmppolicy = "panscan"
+#			os.system('echo non > /proc/stb/video/policy')
+			eAVSwitch.getInstance().setAspectRatio(3)
+			self.session.open(MessageBox, 'NONLINEAR', MessageBox.TYPE_WARNING, timeout=2)
+
+		elif tmppolicy.find("panscan") != -1:
+			print "VideoModeLight set policy panscan"
+			tmppolicy = "bestfit"
+#			os.system('echo panscan > /proc/stb/video/policy')
+			eAVSwitch.getInstance().setAspectRatio(1)
+			self.session.open(MessageBox, 'PANSCAN', MessageBox.TYPE_WARNING, timeout=2)			
+
+		elif tmppolicy.find("bestfit") != -1:
+			print "VideoModeLight set policy bestfit"
+			tmppolicy = "letterbox"
+#			os.system('echo bestfit > /proc/stb/video/policy')
+			eAVSwitch.getInstance().setAspectRatio(2)
+			self.session.open(MessageBox, 'BESTFIT', MessageBox.TYPE_WARNING, timeout=2)
+
+
+	def keyNumberGlobal(self, number):
+		print "You pressed number " + str(number)
+		self.session.openWithCallback(self.numberEntered, ChapterZap, number)
+
+	def numberEntered(self, retval):
+#		print self.servicelist
+		if retval > 0:
+			self.zapToNumber(retval)
+
+	def getServiceInterface(self, iface):
+		service = self.service
+		if service:
+			attr = getattr(service, iface, None)
+			if callable(attr):
+				return attr()
+		return None
+
+	def __serviceStopped(self):
+		self.dvdScreen.hide()
+		subs = self.getServiceInterface("subtitle")
+		if subs:
+			subs.disableSubtitles(self.session.current_dialog.instance)
+
+	def serviceStarted(self): #override InfoBarShowHide function
+		self.dvdScreen.show()
+
+	def doEofInternal(self, playing):
+		if self.in_menu:
+			self.hide()
+
+	def __menuOpened(self):
+		self.hide()
+		self.in_menu = True
+		self["NumberActions"].setEnabled(False)
+
+	def __menuClosed(self):
+		self.show()
+		self.in_menu = False
+		self["NumberActions"].setEnabled(True)
+
+	def setChapterLabel(self):
+		chapterLCD = "Menu"
+		chapterOSD = "DVD Menu"
+		if self.currentTitle > 0:
+			chapterLCD = "%s %d" % (_("Chap."), self.currentChapter)
+			chapterOSD = "DVD %s %d/%d" % (_("Chapter"), self.currentChapter, self.totalChapters)
+			chapterOSD += " (%s %d/%d)" % (_("Title"), self.currentTitle, self.totalTitles)
+		self["chapterLabel"].setText(chapterOSD)
+		try:
+			self.session.summary.updateChapter(chapterLCD)
+		except:
+			pass
+
+	def doNothing(self):
+		pass
+
+	def toggleInfo(self):
+		if not self.in_menu:
+			self.toggleShow()
+
+	def __timeUpdated(self):
+		print "timeUpdated"
+
+	def __statePlay(self):
+		print "statePlay"
+
+	def __statePause(self):
+		print "statePause"
+
+	def __osdFFwdInfoAvail(self):
+		self.setChapterLabel()
+		print "FFwdInfoAvail"
+
+	def __osdFBwdInfoAvail(self):
+		self.setChapterLabel()
+		print "FBwdInfoAvail"
+
+	def __osdStringAvail(self):
+		print "StringAvail"
+
+	def __osdAudioInfoAvail(self):
+		info = self.getServiceInterface("info")
+		audioTuple = info and info.getInfoObject(iServiceInformation.sUser+6)
+		print "AudioInfoAvail ", repr(audioTuple)
+		if audioTuple:
+			audioString = "%d: %s (%s)" % (audioTuple[0],audioTuple[1],audioTuple[2])
+			self["audioLabel"].setText(audioString)
+			if audioTuple != self.last_audioTuple and not self.in_menu:
+				self.doShow()
+		self.last_audioTuple = audioTuple
+
+	def __osdSubtitleInfoAvail(self):
+		info = self.getServiceInterface("info")
+		subtitleTuple = info and info.getInfoObject(iServiceInformation.sUser+7)
+		print "SubtitleInfoAvail ", repr(subtitleTuple)
+		if subtitleTuple:
+			subtitleString = ""
+			if subtitleTuple[0] is not 0:
+				subtitleString = "%d: %s" % (subtitleTuple[0],subtitleTuple[1])
+			self["subtitleLabel"].setText(subtitleString)
+			if subtitleTuple != self.last_subtitleTuple and not self.in_menu:
+				self.doShow()
+		self.last_subtitleTuple = subtitleTuple
+	
+	def __osdAngleInfoAvail(self):
+		info = self.getServiceInterface("info")
+		angleTuple = info and info.getInfoObject(iServiceInformation.sUser+8)
+		print "AngleInfoAvail ", repr(angleTuple)
+		if angleTuple:
+			angleString = ""
+			if angleTuple[1] > 1:
+				angleString = "%d / %d" % (angleTuple[0],angleTuple[1])
+				self["anglePix"].show()
+			else:
+				self["anglePix"].hide()
+			self["angleLabel"].setText(angleString)
+			if angleTuple != self.last_angleTuple and not self.in_menu:
+				self.doShow()
+		self.last_angleTuple = angleTuple
+
+	def __chapterUpdated(self):
+		info = self.getServiceInterface("info")
+		if info:
+			self.currentChapter = info.getInfo(iServiceInformation.sCurrentChapter)
+			self.totalChapters = info.getInfo(iServiceInformation.sTotalChapters)
+			self.setChapterLabel()
+			print "__chapterUpdated: %d/%d" % (self.currentChapter, self.totalChapters)
+
+	def __titleUpdated(self):
+		info = self.getServiceInterface("info")
+		if info:
+			self.currentTitle = info.getInfo(iServiceInformation.sCurrentTitle)
+			self.totalTitles = info.getInfo(iServiceInformation.sTotalTitles)
+			self.setChapterLabel()
+			print "__titleUpdated: %d/%d" % (self.currentTitle, self.totalTitles)
+			if not self.in_menu:
+				self.doShow()
+		
+	def askLeavePlayer(self):
+		choices = [(_("Yes"), "exit"), (_("No"), "play")]
+		self.session.openWithCallback(self.exitCB, ChoiceBox, title=_("Stop playing this movie ?"), list = choices)	
+
+	def sendKey(self, key):
+		keys = self.getServiceInterface("keys")
+		if keys:
+			keys.keyPressed(key)
+		return keys
+
+	def nextAudioTrack(self):
+		self.sendKey(iServiceKeys.keyUser)
+
+	def nextSubtitleTrack(self):
+		self.sendKey(iServiceKeys.keyUser+1)
+
+	def enterDVDAudioMenu(self):
+		self.sendKey(iServiceKeys.keyUser+2)
+
+	def nextChapter(self):
+		self.sendKey(iServiceKeys.keyUser+3)
+
+	def prevChapter(self):
+		self.sendKey(iServiceKeys.keyUser+4)
+
+	def nextTitle(self):
+		self.sendKey(iServiceKeys.keyUser+5)
+
+	def prevTitle(self):
+		self.sendKey(iServiceKeys.keyUser+6)
+
+	def enterDVDMenu(self):
+		self.sendKey(iServiceKeys.keyUser+7)
+	
+	def nextAngle(self):
+		self.sendKey(iServiceKeys.keyUser+8)
+
+	def seekBeginning(self):
+		if self.service:
+			seekable = self.getSeek()
+			if seekable:
+				seekable.seekTo(0)
+
+	def zapToNumber(self, number):
+		if self.service:
+			seekable = self.getSeek()
+			if seekable:
+				print "seek to chapter %d" % number
+				seekable.seekChapter(number)
+
+#	MENU ACTIONS
+	def keyRight(self):
+		self.sendKey(iServiceKeys.keyRight)
+
+	def keyLeft(self):
+		self.sendKey(iServiceKeys.keyLeft)
+
+	def keyUp(self):
+		self.sendKey(iServiceKeys.keyUp)
+
+	def keyDown(self):
+		self.sendKey(iServiceKeys.keyDown)
+
+	def keyOk(self):
+		if self.sendKey(iServiceKeys.keyOk) and not self.in_menu:
+#			self.toggleInfo()
+			self.change_ratio()
+
+	def keyCancel(self):
+		self.askLeavePlayer()
+
+	def opened(self):
+		if len(self.dvd_filelist) == 1:
+			# opened via autoplay
+			print "self.FileBrowserClosed(self.dvd_filelist[0])", self.FileBrowserClosed(self.dvd_filelist[0])
+			self.FileBrowserClosed(self.dvd_filelist[0])
+		elif self.physicalDVD:
+			# opened from menu with dvd in drive
+			self.session.openWithCallback(self.playPhysicalCB, MessageBox, text=_("Do you want to play DVD in drive?"), timeout=5 )
+		else:
+			# opened from menu without dvd in drive
+			self.session.openWithCallback(self.FileBrowserClosed, FileBrowser, self.dvd_filelist)
+
+	def playPhysicalCB(self, answer):
+		if answer == True:
+			self.FileBrowserClosed(harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD()))
+		else:
+			self.session.openWithCallback(self.FileBrowserClosed, FileBrowser)
+
+	def showFileInfo(self):
+		print "skip"
+		
+	def FileBrowserClosed(self, val):
+		curref = self.session.nav.getCurrentlyPlayingServiceReference()
+		print "FileBrowserClosed", val
+		if val is None:
+			self.askLeavePlayer()
+		else:
+			newref = eServiceReference(4369, 0, val)
+			if curref is None or curref != newref:
+				self.session.nav.playService(newref)
+				self.service = self.session.nav.getCurrentService()
+				subs = self.getServiceInterface("subtitle")
+				if subs:
+					subs.enableSubtitles(self.dvdScreen.instance, None)
+
+	def exitCB(self, answer):
+		if answer is not None:
+			if answer[1] == "exit":
+				if self.service:
+					self.service = None
+				config.SecondInfobar.Enabled = ConfigYesNo(default=True)
+				config.plugins.DVDPlayer.Enabled = ConfigYesNo(default=False)
+				config.plugins.DVDPlayer.save()
+				self.close()
+
+ 			if answer[1] == "loaddvd":
+ 				os.system('mount /dev/sr0 /media/dvd')
+ 				self.session.openWithCallback(self.FileBrowserClosed, FileBrowser)
+			if answer[1] == "ejectdvd":
+				os.system('umount /media/dvd')
+				os.system('eject /dev/sr0')
+				self.session.openWithCallback(self.FileBrowserClosed, FileBrowser)
+
+	def __onClose(self):
+		self.restore_infobar_seek_config()
+		self.session.nav.playService(self.oldService)
+		from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
+		hotplugNotifier.remove(self.hotplugCB)
+
+	def playLastCB(self, answer): # overwrite infobar cuesheet function
+		print "playLastCB", answer, self.resume_point
+		if self.service:
+			if answer == True:
+				seekable = self.getSeek()
+				if seekable:
+					seekable.seekTo(self.resume_point)
+			pause = self.service.pause()
+			pause.unpause()
+		self.hideAfterResume()
+
+	def showAfterCuesheetOperation(self):
+		if not self.in_menu:
+			self.show()
+
+	def createSummary(self):
+		return DVDSummary
+
+#override some InfoBarSeek functions
+	def doEof(self):
+		self.setSeekState(self.SEEK_STATE_PLAY)
+
+	def calcRemainingTime(self):
+		return 0
+
+	def hotplugCB(self, dev, media_state):
+		print "[hotplugCB]", dev, media_state
+		if dev == harddiskmanager.getCD():
+			if media_state == "1":
+				self.scanHotplug()
+			else:
+				self.physicalDVD = False
+
+	def scanHotplug(self):
+		devicepath = harddiskmanager.getAutofsMountpoint(harddiskmanager.getCD())
+		if pathExists(devicepath):
+			from Components.Scanner import scanDevice
+			res = scanDevice(devicepath)
+			list = [ (r.description, r, res[r], self.session) for r in res ]
+			if list:
+				(desc, scanner, files, session) = list[0]
+				for file in files:
+					print file
+					if file.mimetype == "video/x-dvd":
+						print "physical dvd found:", devicepath
+						self.physicalDVD = True
+						return
+		self.physicalDVD = False
+
+from Plugins.Plugin import PluginDescriptor
+
+def filescan_open(list, session, **kwargs):
+	if len(list) == 1 and list[0].mimetype == "video/x-dvd":
+		splitted = list[0].path.split('/')
+		print "splitted", splitted
+		if len(splitted) > 2:
+			if splitted[1] == 'autofs':
+				session.open(DVDPlayer, dvd_device="/dev/%s" %(splitted[2]))
+				return
+			else:
+				print "splitted[0]", splitted[1]
+	else:
+		dvd_filelist = []
+		for x in list:
+			if x.mimetype == "video/x-dvd-iso":
+				dvd_filelist.append(x.path)
+			if x.mimetype == "video/x-dvd":
+				dvd_filelist.append(x.path.rsplit('/',1)[0])			
+		session.open(DVDPlayer, dvd_filelist=dvd_filelist)
+
+def filescan(**kwargs):
+	from Components.Scanner import Scanner, ScanPath
+
+	# Overwrite checkFile to only detect local
+	class LocalScanner(Scanner):
+		def checkFile(self, file):
+			return fileExists(file.path)
+
+	return [
+		LocalScanner(mimetypes = ["video/x-dvd","video/x-dvd-iso"],
+			paths_to_scan =
+				[
+					ScanPath(path = "video_ts", with_subdirs = False),
+					ScanPath(path = "VIDEO_TS", with_subdirs = False),
+					ScanPath(path = "", with_subdirs = False),
+				],
+			name = "DVD",
+			description = _("Play DVD"),
+			openfnc = filescan_open,
+		)]
Index: ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/__init__.py
===================================================================
--- ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/__init__.py	(revision 14689)
+++ ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/__init__.py	(revision 14689)
@@ -0,0 +1,15 @@
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
+import gettext, os
+
+lang = language.getLanguage()
+os.environ["LANGUAGE"] = lang[:2]
+gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
+gettext.textdomain("enigma2")
+gettext.bindtextdomain("Auto3DSkinSwitch", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "SystemPlugins/Auto3DSkinSwitch/locale/"))
+
+def _(txt):
+	t = gettext.dgettext("Auto3DSkinSwitch", txt)
+	if t == txt:
+		t = gettext.gettext(txt)
+	return t
Index: ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/plugin.py
===================================================================
--- ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/plugin.py	(revision 14689)
+++ ipk/source/system_auto3dskinswitch_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/Auto3DSkinSwitch/plugin.py	(revision 14689)
@@ -0,0 +1,169 @@
+################################################
+#
+#  3d2dSkinSwitch Plugin for Dreambox-Enigma2
+#  Coded by Vali (c)2011 modded by bonkel for aaf
+#  Support: www.dreambox-tools.info
+#
+#  This plugin is licensed under the Creative Commons 
+#  Attribution-NonCommercial-ShareAlike 3.0 Unported License.
+#  To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
+#  or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+#
+#  Alternatively, this plugin may be distributed and executed on hardware which
+#  is licensed by Dream Multimedia GmbH.
+#
+#
+#  This plugin is NOT free software. It is open source, you are allowed to
+#  modify it (if you keep the license), but it may not be commercially 
+#  distributed other than under the conditions noted above.
+#
+################################################
+import commands
+from commands import getoutput
+from Components.ActionMap import ActionMap
+from Components.config import config, getConfigListEntry, ConfigSelection, ConfigSubsection, ConfigYesNo, ConfigSubDict, ConfigNothing
+from Components.ConfigList import ConfigList, ConfigListScreen
+from Components.Sources.StaticText import StaticText
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.Label import Label
+from enigma import iPlayableService, iServiceInformation, eServiceCenter, eServiceReference
+from os import path as os_path, listdir, unlink, readlink, remove, system
+from Plugins.Plugin import PluginDescriptor
+from Screens.ChoiceBox import ChoiceBox
+from Screens.Screen import Screen
+from Screens.Setup import SetupSummary
+from ServiceReference import ServiceReference
+import time
+from __init__ import _
+
+config.plugins.autothreed = ConfigSubsection()
+config.plugins.autothreed.enable = ConfigYesNo(default = False)
+config.plugins.autothreed.mode = ConfigSelection(default = "sbs", choices =
+		[("sbs", _("Side-by-Side")), ("tab", _("Top and Bottom"))])
+config.plugins.autothreed.signal = ConfigYesNo(default = False)
+config.plugins.autothreed.ask = ConfigYesNo(default = False)
+
+class Auto3DSkinSwitch(Screen):
+	def __init__(self, session):
+		self.session = session
+		Screen.__init__(self, session)
+		self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
+			{
+				iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
+				iPlayableService.evStart: self.__evStart
+			})
+		self.newService = False
+	def __evStart(self):
+		self.newService = True
+	def __evUpdatedInfo(self):
+		if self.newService and self.session.nav.getCurrentlyPlayingServiceReference():
+			self.newService = False
+			ref = self.session.nav.getCurrentService() 
+			serviceRef = self.session.nav.getCurrentlyPlayingServiceReference()
+			if serviceRef.getPath():
+				serviceHandler = eServiceCenter.getInstance()
+				r = eServiceReference(ref.info().getInfoString(iServiceInformation.sServiceref))
+				info = serviceHandler.info(r)
+				if info:
+					name = ServiceReference(info.getInfoString(r, iServiceInformation.sServiceref)).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '')
+				else:
+					name = ""
+			else:
+				name = ServiceReference(ref.info().getInfoString(iServiceInformation.sServiceref)).getServiceName().replace('\xc2\x86', '').replace('\xc2\x87', '')
+			if config.plugins.autothreed.enable.value is True:
+				if "3d" in name.lower():
+					if config.plugins.autothreed.ask.value and os_path.isfile("/tmp/3don") is not True:
+						self.session.openWithCallback(self.threedswitchchoise, ChoiceBox, title=_("Switch to 3D modus now ?"), list=[(_("yes"), "yes"), (_("no"), "no")])
+					else:
+						commands.getoutput('touch /tmp/3don')
+						mode = config.plugins.autothreed.mode.getValue()
+						config.av.threedmode.value = "%s" % (mode)
+						config.av.threedmode.save()
+						if config.plugins.autothreed.signal.value:
+							system('/bin/3d-mode 40 &')
+				elif os_path.isfile("/tmp/3don") is True:
+					commands.getoutput('rm -r /tmp/3don')
+					config.av.threedmode.value = "off"
+					config.av.threedmode.save()
+					if config.plugins.autothreed.signal.value:
+						commands.getoutput('killall 3d-mode')
+	def threedswitchchoise(self, result):
+		if result is not None:
+			if result[1] == "yes":
+				commands.getoutput('touch /tmp/3don')
+				mode = config.plugins.autothreed.mode.getValue()
+				config.av.threedmode.value = "%s" % (mode)
+				config.av.threedmode.save()
+class AutothreedSetupMenu(Screen, ConfigListScreen):
+	def __init__(self, session):
+		Screen.__init__(self, session)
+		self.skinName = [ "Auto3DSetupMenu", "Setup" ]
+		self.setup_title = _("Auto 3D OSD Switcher")
+		self.onChangedEntry = [ ]
+		self.list = [ ]
+		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
+		self["actions"] = ActionMap(["SetupActions"],
+			{
+				"cancel": self.keyCancel,
+				"save": self.apply,
+			}, -2)
+		self["key_green"] = StaticText(_("OK"))
+		self["key_red"] = StaticText(_("Cancel"))
+		self.createSetup()
+		self.onLayoutFinish.append(self.layoutFinished)
+	def layoutFinished(self):
+		self.setTitle(_("Auto 3D OSD settings"))
+	def createSetup(self):
+		list = [
+			getConfigListEntry(_("Enable Auto3D"), config.plugins.autothreed.enable) 
+		]
+		if config.plugins.autothreed.enable.value == True:
+			sublist = [
+				getConfigListEntry(_("3D mode"), config.plugins.autothreed.mode),
+				getConfigListEntry(_("Send 3D mode switch signal to tv (only sbs)"), config.plugins.autothreed.signal),
+				getConfigListEntry(_("3D mode with question popup"), config.plugins.autothreed.ask),
+			]
+			list.extend(sublist)
+		self["config"].list = list
+		self["config"].setList(list)
+	def apply(self):
+		for x in self["config"].list:
+			x[1].save()
+			if config.plugins.autothreed.enable.value:
+				if os_path.isfile("/tmp/3don") is True:
+					mode = config.plugins.autothreed.mode.getValue()
+					config.av.threedmode.value = "%s" % (mode)
+					config.av.threedmode.save()
+			else:
+				config.av.threedmode.value = "off"
+				config.av.threedmode.save()
+		self.close()
+	def keyLeft(self):
+		ConfigListScreen.keyLeft(self)
+		if self["config"].getCurrent()[1] == config.plugins.autothreed.enable:
+			self.createSetup()
+	def keyRight(self):
+		ConfigListScreen.keyRight(self)
+		if self["config"].getCurrent()[1] == config.plugins.autothreed.enable:
+			self.createSetup()
+	def changedEntry(self):
+		for x in self.onChangedEntry:
+			x()
+	def getCurrentEntry(self):
+		return self["config"].getCurrent()[0]
+	def getCurrentValue(self):
+		return str(self["config"].getCurrent()[1].getText())
+	def createSummary(self):
+		return SetupSummary
+def autostart(reason, **kwargs):
+	session = kwargs["session"]
+	Auto3DSkinSwitch(session)
+def startSetup(menuid):
+	if menuid != "system":
+		return [ ]
+	return [("Auto 3D mode", autothreedSetup, "autothreed_setup", 45)]
+def autothreedSetup(session, **kwargs):
+	session.open(AutothreedSetupMenu)
+def Plugins(**kwargs):
+	return [PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART], fnc = autostart), \
+		PluginDescriptor(name=_("Auto 3D mode"), description=_("Auto 3D mode"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup) ]
Index: ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/__init__.py
===================================================================
--- ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/__init__.py	(revision 14689)
+++ ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/__init__.py	(revision 14689)
@@ -0,0 +1,15 @@
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
+import gettext, os
+
+lang = language.getLanguage()
+os.environ["LANGUAGE"] = lang[:2]
+gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
+gettext.textdomain("enigma2")
+gettext.bindtextdomain("AutoResolution", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "SystemPlugins/AutoResolution/locale/"))
+
+def _(txt):
+	t = gettext.dgettext("AutoResolution", txt)
+	if t == txt:
+		t = gettext.gettext(txt)
+	return t
Index: ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/plugin.py
===================================================================
--- ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/plugin.py	(revision 14689)
+++ ipk/source/system_autoresolution_1_0/usr/lib/enigma2/python/Plugins/SystemPlugins/AutoResolution/plugin.py	(revision 14689)
@@ -0,0 +1,359 @@
+from Screens.Screen import Screen
+from Screens.Setup import SetupSummary
+from Screens.MessageBox import MessageBox
+from Components.ConfigList import ConfigList, ConfigListScreen
+from Components.config import config, getConfigListEntry, ConfigSelection, ConfigSubsection, ConfigYesNo, ConfigSubDict, ConfigNothing
+from Components.ServiceEventTracker import ServiceEventTracker
+from Components.ActionMap import ActionMap
+from Components.Label import Label
+from Components.Sources.StaticText import StaticText
+from enigma import iPlayableService, iServiceInformation, eTimer
+from Plugins.Plugin import PluginDescriptor
+from Plugins.SystemPlugins.Videomode.VideoHardware import video_hw # depends on Videomode Plugin
+
+from __init__ import _
+
+usable = False
+session = [ ]
+preferedmodes = None
+default = None
+port = None
+videoresolution_dictionary = {}
+
+resolutions = (('sd_i_50', (_("SD 25/50HZ Interlace Mode"))), ('sd_i_60', (_("SD 30/60HZ Interlace Mode"))), \
+			('sd_p_50', (_("SD 25/50HZ Progressive Mode"))), ('sd_p_60', (_("SD 30/60HZ Progressive Mode"))), \
+			('hd_i', (_("HD Interlace Mode"))), ('hd_p', (_("HD Progressive Mode"))), \
+			('p720_24', (_("Enable 720p24 Mode"))), ('p1080_24', (_("Enable 1080p24 Mode"))), \
+			('p1080_25', (_("Enable 1080p25 Mode"))), ('p1080_30', (_("Enable 1080p30 Mode"))))
+
+config.plugins.autoresolution = ConfigSubsection()
+config.plugins.autoresolution.enable = ConfigYesNo(default = False)
+config.plugins.autoresolution.showinfo = ConfigYesNo(default = True)
+config.plugins.autoresolution.testmode = ConfigYesNo(default = False)
+config.plugins.autoresolution.deinterlacer = ConfigSelection(default = "auto", choices =
+		[("off", _("off")), ("auto", _("auto")), ("on", _("on")), ("bob", _("bob"))])
+config.plugins.autoresolution.deinterlacer_progressive = ConfigSelection(default = "auto", choices =
+		[("off", _("off")), ("auto", _("auto")), ("on", _("on")), ("bob", _("bob"))])
+config.plugins.autoresolution.delay_switch_mode = ConfigSelection(default = "1", choices = [
+		("1", "off"), ("1000", "1 " + _("second")), ("2000", "2 " + _("seconds")), ("3000", "3 " + _("seconds")),
+		("4000", "4 " + _("seconds")), ("5000", "5 " + _("seconds")), ("6000", "6 " + _("seconds")), ("7000", "7 " + _("seconds")),
+		("8000", "8 " + _("seconds")), ("9000", "9 " + _("seconds")), ("10000", "10 " + _("seconds"))])
+####### add 1ms (delay= off)
+####### Husky default delay set to 1 (delay=off) 
+
+def setDeinterlacer(mode):
+	print "[AutoRes] switch deinterlacer mode to %s" % mode
+#	f = open('/proc/stb/vmpeg/deinterlace' , "w")         ### 
+#	f.write("%s\n" % mode)                                ###
+#	f.close()                                             ###
+
+frqdic = { 23976: '24', \
+		24000: '24', \
+		25000: '25', \
+		29970: '30', \
+		30000: '30', \
+		50000: '50', \
+		59940: '60', \
+		60000: '60'}
+
+class AutoRes(Screen):
+	def __init__(self, session):
+		global port
+		Screen.__init__(self, session)
+		self.__event_tracker = ServiceEventTracker(screen = self, eventmap =
+			{
+				iPlayableService.evVideoSizeChanged: self.__evVideoSizeChanged,
+				iPlayableService.evVideoProgressiveChanged: self.__evVideoProgressiveChanged,
+				iPlayableService.evVideoFramerateChanged: self.__evVideoFramerateChanged,
+				iPlayableService.evUpdatedInfo: self.__evUpdatedInfo,
+				iPlayableService.evStart: self.__evStart
+			})
+		self.timer = eTimer()
+		self.timer.callback.append(self.determineContent)
+		self.lastmode = config.av.videomode[config.av.videoport.value].value
+		config.av.videoport.addNotifier(self.defaultModeChanged)
+		config.plugins.autoresolution.enable.addNotifier(self.enableChanged, initial_call = False)
+		config.plugins.autoresolution.deinterlacer.addNotifier(self.enableChanged, initial_call = False)
+		config.plugins.autoresolution.deinterlacer_progressive.addNotifier(self.enableChanged, initial_call = False)
+		self.setMode(default[0], False)
+		self.after_switch_delay = False
+		self.newService = False
+
+	def __evStart(self):
+		self.newService = True
+
+	def __evUpdatedInfo(self):
+		if self.newService:
+			print "[AutoRes] service changed"
+			self.after_switch_delay = False
+			self.timer.start(int(config.plugins.autoresolution.delay_switch_mode.value))
+			self.newService = False
+
+	def defaultModeChanged(self, configEntry):
+		global preferedmodes
+		global port
+		global default
+		global usable
+		port_changed = configEntry == config.av.videoport
+		if port_changed:
+			print "port changed to", configEntry.value
+			if port:
+				config.av.videomode[port].notifiers.remove(self.defaultModeChanged)
+			port = config.av.videoport.value
+			config.av.videomode[port].addNotifier(self.defaultModeChanged)
+			usable = config.plugins.autoresolution.enable.value and not port in ('DVI-PC', 'Scart')
+		else: # videomode changed in normal av setup
+			global videoresolution_dictionary
+			print "mode changed to", configEntry.value
+			default = (configEntry.value, _("default"))
+			preferedmodes = [mode[0] for mode in video_hw.getModeList(port) if mode[0] != default[0]]
+			preferedmodes.append(default)
+			print "default", default
+			print "preferedmodes", preferedmodes
+			videoresolution_dictionary = {}
+			config.plugins.autoresolution.videoresolution = ConfigSubDict()
+			for mode in resolutions:
+				if mode[0].startswith('p1080'):
+					choices = ['1080p24', '1080p25', '1080p30'] + preferedmodes
+				elif mode[0] == 'p720_24':
+					choices = ['720p24', '1080p24'] + preferedmodes
+				else:
+					choices = preferedmodes
+				config.plugins.autoresolution.videoresolution[mode[0]] = ConfigSelection(default = default[0], choices = choices)
+				config.plugins.autoresolution.videoresolution[mode[0]].addNotifier(self.modeConfigChanged, initial_call = False, immediate_feedback = False)
+				videoresolution_dictionary[mode[0]] = (config.plugins.autoresolution.videoresolution[mode[0]])
+
+	def modeConfigChanged(self, configElement):
+		self.determineContent()
+
+	def enableChanged(self, configElement):
+		global usable
+		if configElement.value:
+			usable = not port in ('DVI-PC', 'Scart')
+			self.determineContent()
+		else:
+			usable = False
+			self.changeVideomode()
+
+	def __evVideoFramerateChanged(self):
+		print "[AutoRes] got event evFramerateChanged"
+		if not self.timer.isActive() or self.after_switch_delay:
+			self.timer.start(100) # give other pending events a chance..
+
+	def __evVideoSizeChanged(self):
+		print "[AutoRes] got event evVideoSizeChanged"
+		if not self.timer.isActive() or self.after_switch_delay:
+			self.timer.start(100) # give other pending events a chance..
+
+	def __evVideoProgressiveChanged(self):
+		print "[AutoRes] got event evVideoProgressiveChanged"
+		if not self.timer.isActive() or self.after_switch_delay:
+			self.timer.start(100) # give other pending events a chance..
+
+	def determineContent(self):
+		print "[AutoRes] determineContent"
+		self.timer.stop()
+		self.after_switch_delay = True
+		if usable:
+			service = session.nav.getCurrentService()
+			info = service and service.info()
+			height = info and info.getInfo(iServiceInformation.sVideoHeight)
+			width = info and info.getInfo(iServiceInformation.sVideoWidth)
+			framerate = info and info.getInfo(iServiceInformation.sFrameRate)
+
+			if height > 0 and width > 0 and framerate > 0:
+				frate = str(framerate)[:2] #fallback?
+				if frqdic.has_key(framerate):
+					frate = frqdic[framerate]
+				progressive = info and info.getInfo(iServiceInformation.sProgressive)
+				prog = progressive == 1 and 'p' or 'i'
+
+				if (height >= 900 or width >= 1600) and frate in ('24', '25', '30') and prog == 'p': 	# 1080p content
+					new_mode = 'p1080_%s' % frate
+######## HUSKY NEW 720p 
+				elif (height > 576 or width > 720) and frate == '50' : 	                 	# 720p 50Hz detection
+						prog = 'p'
+						new_mode = 'hd_%s' % prog
+######## HUSKY END of NEW 720p
+				elif (height > 576 or width > 720) and frate == '24' and prog == 'p': 		# 720p24 detection
+					new_mode = 'p720_24'
+				elif (height <= 576) and (width <= 720) and frate in ('25', '50'):
+					new_mode = 'sd_%s_50' % prog
+				elif (height <= 480) and (width <= 720) and frate in ('24', '30', '60'):
+					new_mode = 'sd_%s_60' % prog
+				else:
+					new_mode = 'hd_%s' % prog
+
+				if  progressive == 1 or prog == 'p':						####### HUSKY or prog added
+					setDeinterlacer(config.plugins.autoresolution.deinterlacer_progressive.value)
+
+				else:
+					setDeinterlacer(config.plugins.autoresolution.deinterlacer.value)
+				print "[AutoRes] new content is %sx%s%s%s" %(width, height, prog, frate)
+
+				if videoresolution_dictionary.has_key(new_mode):
+					new_mode = videoresolution_dictionary[new_mode].value
+					print '[AutoRes] determined videomode', new_mode
+					old = resolutionlabel["content"].getText()
+					resolutionlabel["content"].setText("Videocontent: %sx%s%s %sHZ" % (width, height, prog, frate))
+					if self.lastmode != new_mode:
+						self.lastmode = new_mode
+						self.changeVideomode()
+					elif old != resolutionlabel["content"].getText() and config.plugins.autoresolution.showinfo.value:
+						resolutionlabel.show()
+
+	def changeVideomode(self):
+		if usable:
+			mode = self.lastmode
+			if mode.find("1080p") != -1 or mode.find("720p24") != -1:
+				print "[AutoRes] switching to", mode
+				v = open('/proc/stb/video/videomode' , "w")
+				v.write("%s\n" % mode)
+				v.close()
+				resolutionlabel["restxt"].setText("Videomode: %s" % mode)
+				if config.plugins.autoresolution.showinfo.value:
+					resolutionlabel.show()
+			else:
+				self.setMode(mode)
+			if config.plugins.autoresolution.testmode.value:
+				self.session.openWithCallback(
+					self.confirm,
+					MessageBox,
+					_("Autoresolution Plugin Testmode:\nIs %s %s Videomode ok?" % (port, mode)), #### Husky Test because of GS
+					MessageBox.TYPE_YESNO,
+					timeout = 15,
+					default = False
+				)
+			     
+		else:
+			setDeinterlacer("auto")
+			if self.lastmode != default[0]:
+				self.setMode(default[0])
+
+	def confirm(self, confirmed):
+		if not confirmed:
+			self.setMode(default[0])
+
+	def setMode(self, mode, set=True):
+		rate = config.av.videorate[mode].value
+		resolutionlabel["restxt"].setText("Videomode: %s %s %s" % (port, mode, rate))
+		if set:
+			print "[AutoRes] switching to %s %s %s" % (port, mode, rate)
+			if config.plugins.autoresolution.showinfo.value:
+				resolutionlabel.show()
+			video_hw.setMode(port, mode, rate)
+		self.lastmode = mode
+
+class ResolutionLabel(Screen):
+	skin = """
+		<screen position="50,40" size="250,36" flags="wfNoBorder" >
+			<widget name="content" position="0,0" size="250,18" font="Regular;16" />
+			<widget name="restxt" position="0,18" size="250,18" font="Regular;16" />
+		</screen>"""
+	def __init__(self, session):
+		Screen.__init__(self, session)
+
+		self["content"] = Label()
+		self["restxt"] = Label()
+
+		self.hideTimer = eTimer()
+		self.hideTimer.callback.append(self.hide)
+
+		self.onShow.append(self.hide_me)
+
+	def hide_me(self):
+		self.hideTimer.start(config.usage.infobar_timeout.index * 1500, True)
+
+
+class AutoResSetupMenu(Screen, ConfigListScreen):
+	def __init__(self, session):
+		Screen.__init__(self, session)
+		self.skinName = [ "AutoResSetupMenu", "Setup" ]
+		self.setup_title = _("Autoresolution videomode setup")
+
+		self.onChangedEntry = [ ]
+		self.list = [ ]
+		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)
+
+		self["actions"] = ActionMap(["SetupActions"],
+			{
+				"cancel": self.keyCancel,
+				"save": self.apply,
+			}, -2)
+
+		self["key_green"] = StaticText(_("OK"))
+		self["key_red"] = StaticText(_("Cancel"))
+
+		self.createSetup()
+		self.onLayoutFinish.append(self.layoutFinished)
+
+	def layoutFinished(self):
+		self.setTitle(_("Autoresolution settings"))
+
+	def createSetup(self):
+		self.list = [ getConfigListEntry(_("Enable Autoresolution"), config.plugins.autoresolution.enable) ]
+		if config.plugins.autoresolution.enable.value:
+			if usable:
+				for mode, label in resolutions:
+					self.list.append(getConfigListEntry(label, videoresolution_dictionary[mode]))
+				self.list.extend((
+					getConfigListEntry(_("Show info screen"), config.plugins.autoresolution.showinfo),
+					getConfigListEntry(_("Delay x seconds after service started"), config.plugins.autoresolution.delay_switch_mode),
+### Husky Callback in Testmode not ok	getConfigListEntry(_("Running in testmode"), config.plugins.autoresolution.testmode),
+##					getConfigListEntry(_("Deinterlacer mode for interlaced content"), config.plugins.autoresolution.deinterlacer),
+##					getConfigListEntry(_("Deinterlacer mode for progressive content"), config.plugins.autoresolution.deinterlacer_progressive)
+				))
+			else:
+				self.list.append(getConfigListEntry(_("Autoresolution is not working in Scart/DVI-PC Mode"), ConfigNothing()))
+
+		self["config"].list = self.list
+		self["config"].setList(self.list)
+
+	def apply(self):
+		for x in self["config"].list:
+			x[1].save()
+		self.close()
+
+	def keyLeft(self):
+		ConfigListScreen.keyLeft(self)
+		if self["config"].getCurrent()[1] == config.plugins.autoresolution.enable:
+			self.createSetup()
+
+	def keyRight(self):
+		ConfigListScreen.keyRight(self)
+		if self["config"].getCurrent()[1] == config.plugins.autoresolution.enable:
+			self.createSetup()
+
+	# for summary:
+	def changedEntry(self):
+		for x in self.onChangedEntry:
+			x()
+
+	def getCurrentEntry(self):
+		return self["config"].getCurrent()[0]
+
+	def getCurrentValue(self):
+		return str(self["config"].getCurrent()[1].getText())
+
+	def createSummary(self):
+		return SetupSummary
+
+
+def autostart(reason, **kwargs):
+	global session, resolutionlabel
+	if "session" in kwargs:
+		session = kwargs["session"]
+		resolutionlabel = session.instantiateDialog(ResolutionLabel)
+		AutoRes(session)
+
+def startSetup(menuid):
+	if menuid != "system":
+		return [ ]
+	return [("Autoresolution...", autoresSetup, "autores_setup", 45)]
+
+def autoresSetup(session, **kwargs):
+	session.open(AutoResSetupMenu)
+
+def Plugins(path, **kwargs):
+	return [PluginDescriptor(where = [PluginDescriptor.WHERE_SESSIONSTART], fnc = autostart), \
+		PluginDescriptor(name=_("Autoresolution"), description=_("Autoresolution Switch"), where = PluginDescriptor.WHERE_MENU, fnc=startSetup) ]
Index: ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/__init__.py
===================================================================
--- ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/__init__.py	(revision 14689)
+++ ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/__init__.py	(revision 14689)
@@ -0,0 +1,15 @@
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS
+import gettext, os
+
+lang = language.getLanguage()
+os.environ["LANGUAGE"] = lang[:2]
+gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE))
+gettext.textdomain("enigma2")
+gettext.bindtextdomain("OSDAdjustment", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/OSDAdjustment/locale/"))
+
+def _(txt):
+	t = gettext.dgettext("OSDAdjustment", txt)
+	if t == txt:
+		t = gettext.gettext(txt)
+	return t
Index: ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/plugin.py
===================================================================
--- ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/plugin.py	(revision 14689)
+++ ipk/source/system_osdadjustment_1_0/usr/lib/enigma2/python/Plugins/Extensions/OSDAdjustment/plugin.py	(revision 14689)
@@ -0,0 +1,462 @@
+# OSD Adjustment 
+# This Software is Free, use it where you want, when you want for whatever you want and modify it if you want.
+# 2010 nit & Civer
+
+from Screens.Screen import Screen
+from Components.ActionMap import ActionMap
+from Components.config import config, ConfigSubsection, ConfigInteger
+from Components.Label import Label
+from Components.Sources.StaticText import StaticText
+from Plugins.Plugin import PluginDescriptor
+from enigma import getDesktop, fbClass
+
+from os import path as os_path
+
+config.OSDAdjustment  = ConfigSubsection()
+config.OSDAdjustment.top = ConfigInteger(default=0)
+config.OSDAdjustment.bottom = ConfigInteger(default=0)
+config.OSDAdjustment.left = ConfigInteger(default=0)
+config.OSDAdjustment.right = ConfigInteger(default=0)
+config.OSDAdjustment.settuxtxt2conf = ConfigInteger(default=0)
+
+from __init__ import _
+
+class Screen_adjust(Screen):
+	if (getDesktop(0).size().width() == 1280):
+		skin = """
+			<screen position="center,center" size="1280,720" backgroundColor="#000000" title="OSD Adjustment" >
+
+				<widget source="title" render="Label" position="200,130" zPosition="1" size="880,60" font="Regular;58" halign="center" valign="center" foregroundColor="yellow" backgroundColor="#1f771f" transparent="1" />
+				<widget source="introduction" render="Label" position="150,250" zPosition="1" size="980,100" font="Regular;40" halign="center" valign="center" transparent="1" />
+				<widget source="infotext" render="Label" position="150,380" zPosition="1" size="980,200" font="Regular;40" halign="center" valign="center" transparent="1" />
+
+				<eLabel backgroundColor="red" position="0,0" size="1280,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,719" size="1280,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,0" size="1,720" zPosition="0" />
+				<eLabel backgroundColor="red" position="1279,0" size="1,720" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="1230,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,694" size="1230,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="1,670" zPosition="0" />
+				<eLabel backgroundColor="green" position="1254,25" size="1,670" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="1180,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,669" size="1180,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="1,620" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="1229,50" size="1,620" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="1130,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,644" size="1130,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="1,570" zPosition="0" />
+				<eLabel backgroundColor="blue" position="1204,75" size="1,570" zPosition="0" />
+
+				<eLabel backgroundColor="red" position="189,627" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="443,627" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="697,627" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="951,627" size="140,3" zPosition="0" />
+				<widget source="key_red" render="Label" position="189,605" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_green" render="Label" position="443,605" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_yellow" render="Label" position="697,605" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_blue" render="Label" position="951,605" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+
+			</screen>"""
+
+	elif (getDesktop(0).size().width() == 1024):
+		skin = """
+			<screen position="center,center" size="1024,576" backgroundColor="#000000" title="OSD Adjustment" >
+
+				<widget source="title" render="Label" position="200,100" zPosition="1" size="624,40" font="Regular;38" halign="center" valign="center" foregroundColor="yellow" backgroundColor="#1f771f" transparent="1" />
+				<widget source="introduction" render="Label" position="100,180" zPosition="1" size="824,50" font="Regular;24" halign="center" valign="center" transparent="1" />
+				<widget source="infotext" render="Label" position="100,310" zPosition="1" size="824,50" font="Regular;24" halign="center" valign="center" transparent="1" />
+
+				<eLabel backgroundColor="red" position="0,0" size="1024,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,575" size="1024,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,0" size="1,576" zPosition="0" />
+				<eLabel backgroundColor="red" position="1023,0" size="1,576" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="974,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,551" size="974,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="1,526" zPosition="0" />
+				<eLabel backgroundColor="green" position="999,25" size="1,526" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="924,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,526" size="924,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="1,476" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="974,50" size="1,476" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="874,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,501" size="874,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="1,426" zPosition="0" />
+				<eLabel backgroundColor="blue" position="949,75" size="1,426" zPosition="0" />
+
+				<eLabel backgroundColor="red" position="138,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="341,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="544,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="747,477" size="140,3" zPosition="0" />
+				<widget source="key_red" render="Label" position="138,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_green" render="Label" position="341,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_yellow" render="Label" position="544,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_blue" render="Label" position="747,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+			</screen>"""
+
+	else:
+		skin = """
+			<screen position="center,center" size="720,576" backgroundColor="#000000" title="OSD Adjustment" >
+
+				<widget source="title" render="Label" position="75,100" zPosition="1" size="570,40" font="Regular;38" halign="center" valign="center" foregroundColor="yellow" backgroundColor="#1f771f" transparent="1" />
+				<widget source="introduction" render="Label" position="75,180" zPosition="1" size="570,50" font="Regular;21" halign="center" valign="center" transparent="1" />
+				<widget source="infotext" render="Label" position="75,310" zPosition="1" size="570,50" font="Regular;21" halign="center" valign="center" transparent="1" />
+
+				<eLabel backgroundColor="red" position="0,0" size="720,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,575" size="720,1" zPosition="0" />
+				<eLabel backgroundColor="red" position="0,0" size="1,576" zPosition="0" />
+				<eLabel backgroundColor="red" position="719,0" size="1,576" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="670,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,551" size="670,1" zPosition="0" />
+				<eLabel backgroundColor="green" position="25,25" size="1,526" zPosition="0" />
+				<eLabel backgroundColor="green" position="694,25" size="1,526" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="620,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,526" size="620,1" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="50,50" size="1,476" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="670,50" size="1,476" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="570,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,501" size="570,1" zPosition="0" />
+				<eLabel backgroundColor="blue" position="75,75" size="1,426" zPosition="0" />
+				<eLabel backgroundColor="blue" position="645,75" size="1,426" zPosition="0" />
+
+				<eLabel backgroundColor="red" position="80,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="green" position="220,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="yellow" position="360,477" size="140,3" zPosition="0" />
+				<eLabel backgroundColor="blue" position="500,477" size="140,3" zPosition="0" />
+				<widget source="key_red" render="Label" position="80,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_green" render="Label" position="220,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_yellow" render="Label" position="360,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+				<widget source="key_blue" render="Label" position="500,455" zPosition="1" size="140,22" font="Regular;18" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
+
+			</screen>"""
+
+	def __init__(self, session):
+		global top, bottom, left, right, rightbottom
+		self.skin = Screen_adjust.skin
+		Screen.__init__(self, session)
+
+		self["key_red"] = StaticText(_("cancel"))
+		self["key_green"] = StaticText(_("save"))
+		self["key_yellow"] = StaticText(_("set default"))
+		self["key_blue"] = StaticText(_("change sides"))
+
+
+		self["title"] = StaticText(_("OSD Adjustment"))
+		self["introduction"] = StaticText(_("Here you can change the screen positions with the arrow buttons on your remote control!"))
+		self["infotext"] = StaticText(_("Now you can change the position of the upper and left side. Press blue button to switch..."))
+
+		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "DirectionActions",],
+		{
+			"cancel": self.Exit,
+			"ok": self.Ok,
+			"red": self.Exit,
+			"green": self.Ok,
+			"yellow": self.yellow,
+			"blue": self.blue,
+			"left": self.left,
+			"right": self.right,
+			"up": self.up,
+			"down": self.down,
+		}, -1)
+
+		self.LoadConfig()
+
+		rightbottom = False
+
+	def LoadConfig(self):
+		global top, oldtop, bottom, oldbottom, left, oldleft, right, oldright
+#-----------------------------------------------------
+# you can load the settings directly, too....for example...
+#		top=fbClass.getInstance().getFBdiff(0)
+#		left=fbClass.getInstance().getFBdiff(1)
+#		right=fbClass.getInstance().getFBdiff(2)
+#		bottom=fbClass.getInstance().getFBdiff(3)
+#------------------------------------------------------
+		# load settings
+		top = config.OSDAdjustment.top.value
+		bottom = config.OSDAdjustment.bottom.value
+		left = config.OSDAdjustment.left.value
+		right = config.OSDAdjustment.right.value
+
+		# backuping settings...use it when canceling
+		oldtop = top
+		oldbottom = bottom
+		oldleft = left
+		oldright = right
+
+	def left(self):
+		global top, bottom, left, right, rightbottom
+		if rightbottom is False:
+			print "[OSD Adjustment] left"
+			left = int(left) - 5
+			if left < 0:
+				left = 0
+		else:
+			print "[OSD Adjustment] right"
+			right = int(right) - 5
+			if right < -150:
+				right = -150
+		fbClass.getInstance().setFBdiff(int(top), int(left), int(right), int(bottom))
+		fbClass.getInstance().clearFBblit()
+
+	def right(self):
+		global top, bottom, left, right, rightbottom
+		if rightbottom is False:
+			print "[OSD Adjustment] left"
+			left = int(left) + 5
+			if left > 150:
+				left = 150
+		else:
+			print "[OSD Adjustment] right"
+			right = int(right) + 5
+			if right > 0:
+				right = 0
+		fbClass.getInstance().setFBdiff(int(top), int(left), int(right), int(bottom))
+		fbClass.getInstance().clearFBblit()
+
+	def up(self):
+		global top, bottom, left, right, rightbottom
+		if rightbottom is False:
+			print "[OSD Adjustment] top"
+			top = int(top) - 5
+			if top < 0:
+				top = 0
+		else:
+			print "[OSD Adjustment] bottom"
+			bottom = int(bottom) - 5
+			if bottom < -150:
+				bottom = -150
+		fbClass.getInstance().setFBdiff(int(top), int(left), int(right), int(bottom))
+		fbClass.getInstance().clearFBblit()
+
+	def down(self):
+		global top, bottom, left, right, rightbottom
+		if rightbottom is False:
+			print "[OSD Adjustment] top"
+			top = int(top) + 5
+			if top > 150:
+				top = 150
+		else:
+			print "[OSD Adjustment] bottom"
+			bottom = int(bottom) + 5
+			if bottom > 0:
+				bottom = 0
+		fbClass.getInstance().setFBdiff(int(top), int(left), int(right), int(bottom))
+		fbClass.getInstance().clearFBblit()
+
+	def yellow(self):
+		global top, bottom, left, right
+		print "[OSD Adjustment] set Default Screen Settings"
+		top = 0
+		bottom = 0
+		left = 0
+		right = 0
+		fbClass.getInstance().setFBdiff(0, 0, 0, 0)
+		fbClass.getInstance().clearFBblit()
+
+	def blue(self):
+		# toggle between upper/left and lower/right screen side...
+		global rightbottom
+		if rightbottom is False:
+			rightbottom = True
+			self["infotext"].setText(_("Now you can change the position of the lower and right side. Press blue button to switch..."))
+		else:
+			rightbottom = False
+			self["infotext"].setText(_("Now you can change the position of the upper and left side. Press blue button to switch..."))
+
+	def Exit(self):
+		global oldtop, oldbottom, oldleft, oldright
+		fbClass.getInstance().setFBdiff(int(oldtop), int(oldleft), int(oldright), int(oldbottom))
+		fbClass.getInstance().clearFBblit()
+		self.close()
+
+	def Ok(self):
+		global top, bottom, left, right
+		config.OSDAdjustment.top.value = int(top)
+		config.OSDAdjustment.bottom.value = int(bottom)
+		config.OSDAdjustment.left.value = int(left)
+		config.OSDAdjustment.right.value = int(right)
+		config.OSDAdjustment.settuxtxt2conf.value = 1
+		config.OSDAdjustment.save()
+		self.close()
+
+
+class SetScreen:
+	def __init__(self, session):
+		self.ScreenOnStartup()
+
+	def ScreenOnStartup(self):
+		print "[OSD Adjustment] Set Screen on startup"
+		top = config.OSDAdjustment.top.value
+		bottom = config.OSDAdjustment.bottom.value
+		left = config.OSDAdjustment.left.value
+		right = config.OSDAdjustment.right.value
+		fbClass.getInstance().setFBdiff(int(top), int(left), int(right), int(bottom))
+		fbClass.getInstance().clearFBblit()
+
+		if config.OSDAdjustment.settuxtxt2conf.value == 1 or os_path.isfile("/var/etc/.getbootvid"):	#--- Set tuxtxt2.conf on startup when OSD was changed before or on firstboot
+
+			config.OSDAdjustment.settuxtxt2conf.value = 0
+			config.OSDAdjustment.save()
+
+			VTStartX = 40 + int(left) # 40 is default StartX Position in tuxtxt2.conf
+			VTEndX = 680 + int(right) # 680 is default EndX Position in tuxtxt2.conf
+			VTStartY = 20 + int(top) # 20 is default StartY Position in tuxtxt2.conf
+			VTEndY = 555 + int(bottom) # 555 is default EndY Position in tuxtxt2.conf
+
+			adir = "/var/etc/tuxbox/tuxtxt2.conf"
+			self.e = []
+			if os_path.isfile(adir) is True:
+				f = open( adir, "r" )
+				self.e = f.readlines()
+				f.close
+				for line in self.e:
+					if line.find("ScreenMode16x9Normal ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						ScreenMode16x9Normal = line
+					elif line.find("ScreenMode16x9Divided ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						ScreenMode16x9Divided = line
+					elif line.find("Brightness ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						Brightness = line
+					elif line.find("MenuLanguage ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						MenuLanguage = line
+					elif line.find("AutoNational ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						AutoNational = line
+					elif line.find("NationalSubset ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						NationalSubset = line
+					elif line.find("SwapUpDown ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						SwapUpDown = line
+					elif line.find("ShowHexPages ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						ShowHexPages = line
+					elif line.find("Transparency ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						Transparency = line
+					elif line.find("TTFWidthFactor16 ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						TTFWidthFactor16 = line
+					elif line.find("TTFHeightFactor16 ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						TTFHeightFactor16 = line
+					elif line.find("TTFShiftX ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						TTFShiftX = line
+					elif line.find("TTFShiftY ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						TTFShiftY = line
+					elif line.find("Screenmode ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						Screenmode = line
+					elif line.find("ShowFLOF ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						ShowFLOF = line
+					elif line.find("Show39 ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						Show39 = line
+					elif line.find("ShowLevel2p5 ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						ShowLevel2p5 = line
+					elif line.find("DumpLevel2p5 ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						DumpLevel2p5 = line
+					elif line.find("UseTTF ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						UseTTF = line
+####################################
+					elif line.find("StartX ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						StartX = line
+					elif line.find("EndX ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						EndX = line
+					elif line.find("StartY ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						StartY = line
+					elif line.find("EndY ") > -1:
+						line = line.split(' ')
+						line = line[1]
+						EndY = line
+					else:
+						pass
+######################################
+
+				if not VTStartX == int(StartX) or not VTEndX == int(EndX) or not VTStartY == int(StartY) or not VTEndY == int(EndY):
+					print "[OSD Adjustment] Write tuxtxt2.conf with new OSD settings"
+					self.e = []
+					self.e.append('ScreenMode16x9Normal ' + ScreenMode16x9Normal + "\n" )
+					self.e.append('ScreenMode16x9Divided ' + ScreenMode16x9Divided + "\n" )
+					self.e.append('Brightness ' + Brightness + "\n" )
+					self.e.append('MenuLanguage ' + MenuLanguage + "\n" )
+					self.e.append('AutoNational ' + AutoNational + "\n" )
+					self.e.append('NationalSubset ' + NationalSubset + "\n" )
+					self.e.append('SwapUpDown ' + SwapUpDown + "\n" )
+					self.e.append('ShowHexPages ' + ShowHexPages + "\n" )
+					self.e.append('Transparency ' + Transparency + "\n" )
+					self.e.append('TTFWidthFactor16 ' + TTFWidthFactor16 + "\n" )
+					self.e.append('TTFHeightFactor16 ' + TTFHeightFactor16 + "\n" )
+					self.e.append('TTFShiftX ' + TTFShiftX + "\n" )
+					self.e.append('TTFShiftY ' + TTFShiftY + "\n" )
+					self.e.append('Screenmode ' + Screenmode + "\n" )
+					self.e.append('ShowFLOF ' + ShowFLOF + "\n" )
+					self.e.append('Show39 ' + Show39 + "\n" )
+					self.e.append('ShowLevel2p5 ' + ShowLevel2p5 + "\n" )
+					self.e.append('DumpLevel2p5 ' + DumpLevel2p5 + "\n" )
+					self.e.append('UseTTF ' + UseTTF + "\n" )
+#################################
+					self.e.append('StartX ' + str(VTStartX) + "\n" )
+					self.e.append('EndX ' + str(VTEndX) + "\n" )
+					self.e.append('StartY ' + str(VTStartY) + "\n" )
+					self.e.append('EndY ' + str(VTEndY) + "\n" )
+#################################
+
+					if os_path.isfile(adir) is True:
+						f = open( adir, "w" )
+						f.writelines(self.e)
+						f.flush()
+						f.close
+
+ScreenInstance = None
+
+def sessionstart(reason, session):
+	global ScreenInstance
+	if ScreenInstance is None:
+		ScreenInstance = SetScreen(session)
+
+def main(session, **kwargs):
+	session.open(Screen_adjust)
+
+def menu(menuid, **kwargs):
+	if menuid == "setup":
+		return [(_("OSD Adjustment"), main, "OSD_Adjustment", 11)]
+	return [ ]
+
+def Plugins(**kwargs):
+	return [PluginDescriptor( where = PluginDescriptor.WHERE_SESSIONSTART, fnc = sessionstart ),
+			PluginDescriptor( name = "OSD Adjustment", description = _("change the OSD screen size"), where = PluginDescriptor.WHERE_MENU, fnc = menu )]
