X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FPlugins%2FSystemPlugins%2FNFIFlash%2Fdownloader.py;h=34f87256afe4f2be8e4bd2be36dea51367f990a1;hp=2c8b45db8c249c8c722df354b5d2e116033f342d;hb=f3a9c38ed6a5c75deaf360ead55dfea74f86a83c;hpb=fb75a5db67a5f82d9c4976cd2d056f47376affd3 diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py index 2c8b45d..34f8725 100644 --- a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py +++ b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py @@ -16,7 +16,7 @@ from Components.MultiContent import MultiContentEntryText from Components.ScrollLabel import ScrollLabel from Components.Harddisk import harddiskmanager from Components.Task import Task, Job, job_manager, Condition -from Tools.Directories import fileExists, isMount +from Tools.Directories import fileExists, isMount, resolveFilename, SCOPE_HDD from Tools.HardwareInfo import HardwareInfo from Tools.Downloader import downloadWithProgress from enigma import eConsoleAppContainer, gFont, RT_HALIGN_LEFT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_WRAP, eTimer @@ -35,8 +35,8 @@ class ImageDownloadJob(Job): MountTask(self, device, mountpoint) ImageDownloadTask(self, url, mountpoint+filename) ImageDownloadTask(self, url[:-4]+".nfo", mountpoint+filename[:-4]+".nfo") - if device: - UmountTask(self, mountpoint) + #if device: + #UmountTask(self, mountpoint) def retry(self): self.tasks[0].args += self.tasks[0].retryargs @@ -215,7 +215,7 @@ class CopyTask(Task): class NFOViewer(Screen): skin = """ - + """ @@ -611,11 +611,30 @@ class NFIDownload(Screen): print "[ImageDownloadCB]", ret # print job_manager.active_jobs, job_manager.failed_jobs, job_manager.job_classes, job_manager.in_background, job_manager.active_job if len(job_manager.failed_jobs) == 0: - self.session.open(MessageBox, _("To update your Dreambox firmware, please follow these steps:\n1) Turn off your box with the rear power switch and plug in the bootable USB stick.\n2) Turn mains back on and hold the DOWN button on the front panel pressed for 10 seconds.\n3) Wait for bootup and follow instructions of the wizard."), type = MessageBox.TYPE_INFO) + self.session.openWithCallback(self.askBackupCB, MessageBox, _("The wizard can backup your current settings. Do you want to do a backup now?"), MessageBox.TYPE_YESNO) else: self.umountCallback = self.keyRed self.umount() + def askBackupCB(self, ret): + if ret: + from Plugins.SystemPlugins.SoftwareManager.BackupRestore import BackupScreen + + class USBBackupScreen(BackupScreen): + def __init__(self, session, usbmountpoint): + BackupScreen.__init__(self, session, runBackup = True) + self.backuppath = usbmountpoint + self.fullbackupfilename = self.backuppath + "/" + self.backupfile + + self.session.openWithCallback(self.showHint, USBBackupScreen, self.usbmountpoint) + else: + self.showHint() + + def showHint(self, ret=None): + self.session.open(MessageBox, _("To update your Dreambox firmware, please follow these steps:\n1) Turn off your box with the rear power switch and make sure the bootable USB stick is plugged in.\n2) Turn mains back on and hold the DOWN button on the front panel pressed for 10 seconds.\n3) Wait for bootup and follow instructions of the wizard."), type = MessageBox.TYPE_INFO) + self.umountCallback = self.keyRed + self.umount() + def getFeed(self): self.feedDownloader15 = feedDownloader(self.feed_base, self.box, OE_vers="1.5") self.feedDownloader16 = feedDownloader(self.feed_base, self.box, OE_vers="1.6") @@ -671,8 +690,8 @@ class NFIDownload(Screen): def askStartWizard(self): self.branch = STICK_WIZARD - message = _("""This plugin creates a USB stick which can be used to update the firmware of your Dreambox in case it has no network connection or only WLAN access. -First, you need to prepare a USB stick so that it is bootable. + message = _("""This plugin creates a USB stick which can be used to update the firmware of your Dreambox without the need for a network or WLAN connection. +First, a USB stick needs to be prepared so that it becomes bootable. In the next step, an NFI image file can be downloaded from the update server and saved on the USB stick. If you already have a prepared bootable USB stick, please insert it now. Otherwise plug in a USB stick with a minimum size of 64 MB!""") self.session.openWithCallback(self.wizardDeviceBrowserClosed, DeviceBrowser, None, message, showDirectories=True, showMountpoints=True, inhibitMounts=["/","/autofs/sr0/","/autofs/sda1/","/media/hdd/","/media/net/",self.usbmountpoint,"/media/dvd/"]) @@ -734,7 +753,7 @@ If you already have a prepared bootable USB stick, please insert it now. Otherwi def nfo_finished(self,nfodata=""): print "[nfo_finished] " + str(nfodata) - self["key_blue"].text = _("Changelog viewer") + self["key_blue"].text = _("Changelog") self.nfo = nfodata def md5verify(self, md5, path): @@ -773,7 +792,7 @@ If you already have a prepared bootable USB stick, please insert it now. Otherwi self.umountCallback() def main(session, **kwargs): - session.open(NFIDownload,"/home/root") + session.open(NFIDownload,resolveFilename(SCOPE_HDD)) def filescan_open(list, session, **kwargs): dev = "/dev/" + (list[0].path).rsplit('/',1)[0][7:]