Index: ipk/source/mediacenter_mediathek_2_7/CONTROL/control
===================================================================
--- ipk/source/mediacenter_mediathek_2_5/CONTROL/control	(revision 6925)
+++ ipk/source/mediacenter_mediathek_2_7/CONTROL/control	(revision 7056)
@@ -1,4 +1,4 @@
 Package: enigma2-plugin-mediacenter-multimediathek
-Version: 2.5
+Version: 2.7
 Architecture: sh4
 OE: MultiMediathek
Index: ipk/source/mediacenter_mediathek_2_7/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py
===================================================================
--- ipk/source/mediacenter_mediathek_2_5/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py	(revision 6925)
+++ ipk/source/mediacenter_mediathek_2_7/usr/lib/enigma2/python/Plugins/Extensions/MultiMediathek/plugin.py	(revision 7056)
@@ -3,5 +3,5 @@
 # Coded by Homey (c) 2011
 #
-# Version: 2.5
+# Version: 2.7
 # Support: www.i-have-a-dreambox.com
 #####################################################
@@ -35,5 +35,5 @@
 from time import time
 from twisted.web.client import getPage, downloadPage
-from urllib import urlencode, unquote
+from urllib import urlencode, unquote, quote_plus
 from urllib2 import Request, urlopen
 from xml.dom.minidom import parse, parseString
@@ -60,6 +60,6 @@
 config.plugins.multimediathek.showadultcontent = ConfigYesNo(default=False)
 config.plugins.multimediathek.showsecretcontent = ConfigYesNo(default=False)
-config.plugins.multimediathek.checkforupdate = ConfigYesNo(default=True)
-config.plugins.multimediathek.version = NoSave(ConfigText(default="250"))
+config.plugins.multimediathek.checkforupdate = ConfigYesNo(default=False)
+config.plugins.multimediathek.version = NoSave(ConfigText(default="270"))
 
 #################################
@@ -69,5 +69,5 @@
 class downloadJob(Job):
 	def __init__(self, toolbox, cmdline, filename, filetitle):
-		Job.__init__(self, _("Saving Movie from Mediathek"))
+		Job.__init__(self, _("Download Movie"))
 		self.toolbox = toolbox
 		self.retrycount = 0
@@ -211,5 +211,4 @@
 		size_w = getDesktop(0).size().width()
 		size_h = getDesktop(0).size().height()
-		self.FramebufferScale = AVSwitch().getFramebufferScale()
 
 		if size_w == 1280:
@@ -310,14 +309,11 @@
 			self["thumb"+str(x)] = Pixmap()
 
+		# Get FrameBuffer Scale for ePicLoad()
+		sc = AVSwitch().getFramebufferScale()
+		
+		# Init Thumb PicLoad
 		self.picload = ePicLoad()
-		self.picload.PictureData.get().append(self.showPic)
-
-		self.ThumbTimer = eTimer()
-		self.ThumbTimer.callback.append(self.showPic)
-
-		# Init Thumb PicLoad
-		self.thumbload = ePicLoad()
-		self.thumbload.PictureData.get().append(self.showThumbPixmap)
-		self.thumbload.setPara((self.picX-10, self.picY-(textsize*2), self.FramebufferScale[0], self.FramebufferScale[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
+		self.picload.PictureData.get().append(self.showThumbPixmap)
+		self.picload.setPara((self.picX-10, self.picY-(textsize*2), sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
 
 		# Init eBackgroundFileEraser
@@ -331,6 +327,7 @@
 
 	def loadFrame(self):
-		if not self.createMediaFolders():
-			return
+		if self.feedtitle == "Startseite":
+			if not self.createMediaFolders():
+				return
 
 		if self.feedtitle == "Bookmarks":
@@ -340,15 +337,24 @@
 
 	def createMediaFolders(self):
-		#if self.feedtitle == "Startseite" and not os_path.ismount(config.plugins.multimediathek.storagepath.value):
-		#	self["pageinfo"].setText(_("ERROR creating mediathek folders ..."))
-		#	return False
-
-		if self.feedtitle == "Startseite" and os_path.ismount(config.plugins.multimediathek.storagepath.value):
-			os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek")
-			os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/images")
-			os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/movies")
-			os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/tmp")
-
-		return True
+		# Check if cache folder is on a mountable device and not inside flash-memory
+		tmppath = config.plugins.multimediathek.storagepath.value
+		while not os_path.ismount(tmppath):
+			tmppath = os_path.dirname(tmppath)
+			if tmppath == "/":
+				self["pageinfo"].setText(_("Error: Can not create cache-folders inside flash memory. Check your Cache-Folder Settings!"))
+				return False
+
+		# Create Cache Folders ...
+		os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek")
+		os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/images")
+		os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/movies")
+		os_system("mkdir -p "+config.plugins.multimediathek.storagepath.value+"/mediathek/tmp")
+
+		# Check if Cache Folders were created successfully
+		if not os_path.exists(config.plugins.multimediathek.storagepath.value+"/mediathek"):
+			self["pageinfo"].setText(_("Error: No write permission to create cache-folders. Check your Cache-Folder Settings!"))
+			return False
+		else:
+			return True
 
 	def checkforupdate(self):
@@ -493,13 +499,11 @@
 			self.gotThumbnail()
 		else:
-			downloadPage(self.thumburl, self.thumbfile).addCallback(self.gotThumbnail).addErrback(self.showThumbError)
-
-	def gotThumbnail(self, txt=""):
-		if self.thumbload.getThumbnail(self.thumbfile) == 1:
-			if self.thumbcount+1 < len(self.Thumbnaillist):
-				self.getThumbnail()
+			downloadPage(self.thumburl, self.thumbfile, agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.2) Gecko/2008091620 Firefox/3.0.2").addCallback(self.gotThumbnail).addErrback(self.showThumbError)
+
+	def gotThumbnail(self, data=""):
+		self.picload.startDecode(self.thumbfile)
 
 	def showThumbPixmap(self, picInfo=None):
-		ptr = self.thumbload.getData()
+		ptr = self.picload.getData()
 		if ptr != None:
 			self["thumb" + str(self.thumbcount)].instance.setPixmap(ptr.__deref__())
@@ -549,19 +553,4 @@
 		self.getThumbnail()
 
-	def showPic(self, picInfo=""):
-		for x in range(len(self.Thumbnaillist)):
-			if self.Thumbnaillist[x][0] == 0:
-				if self.picload.getThumbnail(self.Thumbnaillist[x][2]) == 1:
-					self.ThumbTimer.start(500, True)
-				else:
-					self.Thumbnaillist[x][0] = 1
-				break
-			elif self.Thumbnaillist[x][0] == 1:
-				self.Thumbnaillist[x][0] = 2
-				ptr = self.picload.getData()
-				if ptr != None:
-					self["thumb" + str(self.Thumbnaillist[x][1])].instance.setPixmap(ptr.__deref__())
-					self["thumb" + str(self.Thumbnaillist[x][1])].show()
-
 	def selectBookmark(self):
 		self.session.open(MultiMediathek, self.itemlist[self.index][5], "Bookmarks", "Bookmarks from your favorite Movies")
@@ -600,5 +589,5 @@
 			self.session.openWithCallback(self.loadFrame, MultiMediathek_Settings)
 		elif self.itemlist:
-			self.session.openWithCallback(self.loadFrame, MultiMediathek_ItemOptions, self.itemlist[self.index])
+			self.session.openWithCallback(self.loadFrame, MultiMediathek_MenuOptions, self.itemlist[self.index])
 
 	def key_ok(self):
@@ -610,4 +599,8 @@
 		elif self.itemlist[self.index][6] == "movie":
 			self.session.open(MovieInfoScreen, self.itemlist[self.index][5])
+		elif self.itemlist[self.index][6] == "switchpage":
+			self.feedurl = self.itemlist[self.index][5]
+			self.index = 0
+			self.getxmlfeed()
 		elif self.itemlist[self.index][6] == "search":
 			self.searchurl = self.itemlist[self.index][5]
@@ -616,5 +609,5 @@
 	def SendSearchQuery(self, query):
 		if query is not None:
-			searchurl = self.itemlist[self.index][5] + "&searchquery=" + str(query)
+			searchurl = self.itemlist[self.index][5] + "&searchquery=" + quote_plus(str(query))
 			self.session.open(MultiMediathek, searchurl, self.itemlist[self.index][3], self.feedtext + " - " + self.itemlist[self.index][3] + ": " + query)
 
@@ -638,4 +631,5 @@
 						self.BgFileEraser.erase(filelocation)
 
+		del self.picload
 		self.close()
 
@@ -716,4 +710,12 @@
 		}, -1)
 
+		# Get FrameBuffer Scale for ePicLoad()
+		sc = AVSwitch().getFramebufferScale()
+		
+		# Init ePicLoad
+		self.picload = ePicLoad()
+		self.picload.PictureData.get().append(self.showPosterPixmap)
+		self.picload.setPara((270, 350, sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
+		
 		self.onFirstExecBegin.append(self.GetMovieInfo)
 
@@ -770,11 +772,7 @@
 		
 		# Download Image
-		downloadPage(self.movieinfo[3], self.imagefolder+"/poster.jpg").addCallback(self.downloadPosterCallback)
+		downloadPage(self.movieinfo[3], self.imagefolder+"/poster.jpg", agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.2) Gecko/2008091620 Firefox/3.0.2").addCallback(self.downloadPosterCallback)
 
  	def downloadPosterCallback(self, txt=""):
-		sc = AVSwitch().getFramebufferScale()
-		self.picload = ePicLoad()
-		self.picload.PictureData.get().append(self.showPosterPixmap)
-		self.picload.setPara((270, 350, sc[0], sc[1], config.plugins.multimediathek.imagecache.value, int(config.plugins.multimediathek.imagescaling.value), "#00000000"))
 		self.picload.startDecode(self.imagefolder+"/poster.jpg")
 
@@ -945,4 +943,5 @@
 
 	def Exit(self):
+		del self.picload
 		self.close()
 
@@ -1153,10 +1152,10 @@
 #------------------------------------------------------------------------------------------
 
-class MultiMediathek_ItemOptions(Screen):
+class MultiMediathek_MenuOptions(Screen):
 	def __init__(self, session, movieinfo):
 		Screen.__init__(self, session)
 
 		self.skin = """
-			<screen position="center,center" size="400,200" title="Mediathek - Item Options">
+			<screen position="center,center" size="400,200" title="Mediathek - Menu Options">
 				<widget source="itemname" transparent="1" render="Label" zPosition="2" position="10,180" size="380,20" font="Regular;16" />
 				<widget source="menu" render="Listbox" zPosition="5" transparent="1" position="10,10" size="380,160" scrollbarMode="showOnDemand" >
@@ -1168,10 +1167,11 @@
 		self.movieinfo = movieinfo
 		if self.movieinfo[7] == "bookmark":
-			list.append(("Delete this bookmark", "delbookmark", "menu_delbookmark", "50"))
+			list.append(("Delete selected bookmark", "delbookmark", "menu_delbookmark", "50"))
 		elif self.movieinfo[6] == "movie":
-			list.append(("Bookmark this movie", "addbookmark", "menu_addbookmark", "50"))
+			list.append(("Bookmark selected movie", "addbookmark", "menu_addbookmark", "50"))
 		elif self.movieinfo[6] == "cat":
-			list.append(("Bookmark this category", "addbookmark", "menu_addbookmark", "50"))
+			list.append(("Bookmark selected category", "addbookmark", "menu_addbookmark", "50"))
 		list.append(("View Bookmarks", "viewbookmarks", "menu_viewbookmarks", "50"))
+		list.append(("View Downloads", "viewdownloads", "menu_viewdownloads", "50"))
 		list.append(("Mediathek Settings", "settingsmenu", "menu_settings", "50"))
 
@@ -1190,5 +1190,4 @@
 			if selection[1] == "addbookmark":
 				os_system("echo '%s:::%s:::%s:::%s' >> /etc/enigma2/multimediathek.bookmarks" % (self.movieinfo[6], self.movieinfo[3], self.movieinfo[5], self.movieinfo[4]))
-				#self.session.openWithCallback(self.Exit, MessageBox, _("Bookmark added!"), MessageBox.TYPE_INFO, timeout=5)
 				self.Exit()
 			if selection[1] == "delbookmark":
@@ -1203,9 +1202,9 @@
 					tmpfile.close()
 					os_system("echo '%s' > %s" % (tmpdata,bookmarkfile))
-
-				#self.session.openWithCallback(self.Exit, MessageBox, _("Bookmark deleted!"), MessageBox.TYPE_INFO, timeout=5)
 				self.Exit()
 			elif selection[1] == "viewbookmarks":
 				self.session.open(MultiMediathek, self.movieinfo[5], "Bookmarks", "Bookmarks from your favorite Movies")
+			elif selection[1] == "viewdownloads":
+				self.session.openWithCallback(self.Exit, MultiMediathek_TaskViewer)
 			elif selection[1] == "settingsmenu":
 				self.session.openWithCallback(self.Exit, MultiMediathek_Settings)
@@ -1216,4 +1215,78 @@
 
 	def Exit(self, retval=None):
+		self.close()
+
+
+#------------------------------------------------------------------------------------------
+
+
+class MultiMediathek_TaskViewer(Screen):
+	def __init__(self, session):
+		Screen.__init__(self, session)
+		self.session = session
+		
+		self.skin = """
+			<screen name="MediathekTasksScreen" position="center,center" size="700,550" title="Mediathek - Active Downloads">
+				<widget source="tasklist" render="Listbox" position="30,120" size="640,370" zPosition="7" scrollbarMode="showOnDemand" transparent="1" >
+					<convert type="TemplatedMultiContent">
+						{"template": [
+								MultiContentEntryText(pos = (0, 1), size = (200, 24), font=1, flags = RT_HALIGN_LEFT, text = 1), # index 1 is the name
+								MultiContentEntryText(pos = (210, 1), size = (150, 24), font=1, flags = RT_HALIGN_RIGHT, text = 2), # index 2 is the state
+								MultiContentEntryProgress(pos = (370, 1), size = (100, 24), percent = -3), # index 3 should be progress 
+								MultiContentEntryText(pos = (480, 1), size = (100, 24), font=1, flags = RT_HALIGN_RIGHT, text = 4), # index 4 is the percentage
+							],
+						"fonts": [gFont("Regular", 22),gFont("Regular", 18)],
+						"itemHeight": 25
+						}
+					</convert>
+				</widget>
+				<ePixmap position="220,500" zPosition="4" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
+				<widget name="key_red" position="220,500" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;21" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
+			</screen>"""
+		
+		self["shortcuts"] = ActionMap(["SetupActions", "ColorActions"],
+		{
+			"ok": self.keyOK,
+			"cancel": self.keyClose,
+			"red": self.keyClose
+		}, -1)
+
+		self["tasklist"] = List([])
+		self["key_red"] = Button(_("Close"))
+		
+		self.Timer = eTimer()
+		self.Timer.callback.append(self.TimerFire)
+
+		self.onLayoutFinish.append(self.layoutFinished)
+		self.onClose.append(self.__onClose)
+		
+	def __onClose(self):
+		del self.Timer
+
+	def layoutFinished(self):
+		self.Timer.startLongTimer(2)
+
+	def TimerFire(self):
+		self.Timer.stop()
+		self.rebuildTaskList()
+	
+	def rebuildTaskList(self):
+		self.tasklist = []
+		for job in JobManager.getPendingJobs():
+			self.tasklist.append((job, job.name, job.getStatustext(), int(100*job.progress/float(job.end)) ,str(100*job.progress/float(job.end)) + "%" ))
+		self['tasklist'].setList(self.tasklist)
+		self['tasklist'].updateList(self.tasklist)
+		self.Timer.startLongTimer(2)
+
+	def keyOK(self):
+		current = self["tasklist"].getCurrent()
+		if current:
+			job = current[0]
+			self.session.openWithCallback(self.JobViewCB, JobView, job)
+	
+	def JobViewCB(self, why):
+		pass
+
+	def keyClose(self):
 		self.close()
 
