diff options
| author | Andreas Oberritter <obi@opendreambox.org> | 2010-12-20 12:18:19 +0100 |
|---|---|---|
| committer | Andreas Oberritter <obi@opendreambox.org> | 2010-12-20 12:18:19 +0100 |
| commit | 16c07b98245e94a162685803acd4ba4b5d4298a3 (patch) | |
| tree | e44802522d3c141ccc98e52a80016b862f60cf55 /lib/python/Plugins/SystemPlugins | |
| parent | 0fff842a5f2b4185257aadb6b6a3dfa033a91d72 (diff) | |
| parent | 0cbccde1b0264df7a0a5f8723b8de881f0d5f927 (diff) | |
| download | enigma2-16c07b98245e94a162685803acd4ba4b5d4298a3.tar.gz enigma2-16c07b98245e94a162685803acd4ba4b5d4298a3.zip | |
Merge branch 'master' into obi/master
Conflicts:
main/Makefile.am
Diffstat (limited to 'lib/python/Plugins/SystemPlugins')
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | 15 | ||||
| -rwxr-xr-x | lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py | 43 |
2 files changed, 40 insertions, 18 deletions
diff --git a/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py b/lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py index 296d3bca..85ecc92d 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, SCOPE_MEDIA 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 @@ -391,7 +391,7 @@ class NFIDownload(Screen): self.box = HardwareInfo().get_device_name() self.feed_base = "http://www.dreamboxupdate.com/opendreambox" #/1.5/%s/images/" % self.box - self.usbmountpoint = "/mnt/usb/" + self.usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" self.menulist = [] @@ -570,7 +570,7 @@ class NFIDownload(Screen): def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir - self.container.setCWD("/mnt") + self.container.setCWD(resolveFilename(SCOPE_MEDIA)+"usb/") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] @@ -792,13 +792,14 @@ 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:] - print "mounting device " + dev + " to /mnt/usb..." - system("mount "+dev+" /mnt/usb/ -o rw,sync") - session.open(NFIDownload,"/mnt/usb/") + print "mounting device " + dev + " to /media/usb..." + usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" + system("mount %s %s -o rw,sync" % (dev, usbmountpoint)) + session.open(NFIDownload,usbmountpoint) def filescan(**kwargs): from Components.Scanner import Scanner, ScanPath diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py index e1f3e1de..896d9f2c 100755 --- a/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py +++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py @@ -261,9 +261,6 @@ class UpdatePluginMenu(Screen): for x in parts: if not access(x[1], F_OK|R_OK|W_OK) or x[1] == '/': parts.remove(x) - for x in parts: - if x[1].startswith('/autofs/'): - parts.remove(x) if len(parts): self.session.openWithCallback(self.backuplocation_choosen, ChoiceBox, title = _("Please select medium to use as backup location"), list = parts) elif (currentEntry == "backupfiles"): @@ -278,14 +275,20 @@ class UpdatePluginMenu(Screen): def backupfiles_choosen(self, ret): self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value ) - + config.plugins.configurationbackup.backupdirs.save() + config.plugins.configurationbackup.save() + config.save() + def backuplocation_choosen(self, option): + oldpath = config.plugins.configurationbackup.backuplocation.getValue() if option is not None: config.plugins.configurationbackup.backuplocation.value = str(option[1]) config.plugins.configurationbackup.backuplocation.save() config.plugins.configurationbackup.save() config.save() - self.createBackupfolders() + newpath = config.plugins.configurationbackup.backuplocation.getValue() + if newpath != oldpath: + self.createBackupfolders() def runUpgrade(self, result): if result: @@ -1335,9 +1338,9 @@ class UpdatePlugin(Screen): self["slider"] = self.slider self.activityslider = Slider(0, 100) self["activityslider"] = self.activityslider - self.status = StaticText(_("Upgrading Dreambox... Please wait")) + self.status = StaticText(_("Please wait...")) self["status"] = self.status - self.package = StaticText() + self.package = StaticText(_("Verifying your internet connection...")) self["package"] = self.package self.oktext = _("Press OK on your remote control to continue.") @@ -1348,20 +1351,35 @@ class UpdatePlugin(Screen): self.activity = 0 self.activityTimer = eTimer() self.activityTimer.callback.append(self.doActivityTimer) - self.activityTimer.start(100, False) self.ipkg = IpkgComponent() self.ipkg.addCallback(self.ipkgCallback) - self.updating = True - self.package.setText(_("Package list update")) - self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) + self.updating = False self["actions"] = ActionMap(["WizardActions"], { "ok": self.exit, "back": self.exit }, -1) + + iNetwork.checkNetworkState(self.checkNetworkCB) + self.onClose.append(self.cleanup) + + def cleanup(self): + iNetwork.stopPingConsole() + + def checkNetworkCB(self,data): + if data is not None: + if data <= 2: + self.updating = True + self.activityTimer.start(100, False) + self.package.setText(_("Package list update")) + self.status.setText(_("Upgrading Dreambox... Please wait")) + self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) + else: + self.package.setText(_("Your network is not working. Please try again.")) + self.status.setText(self.oktext) def doActivityTimer(self): self.activity += 1 @@ -1440,6 +1458,9 @@ class UpdatePlugin(Screen): self.session.openWithCallback(self.exitAnswer, MessageBox, _("Upgrade finished.") +" "+_("Do you want to reboot your Dreambox?")) else: self.close() + else: + if not self.updating: + self.close() def exitAnswer(self, result): if result is not None and result: |
