Ejemplo n.º 1
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self.firsttime = True

# [iq
		self.mtdSwap = 0	# mini not support mtd swap

		self.pathForSwap = None

		if not self.mtdSwap:	# do file swap

			from Components.Harddisk import isFileSystemSupported
			for partition in harddiskmanager.getMountedPartitions():
				if "/media/hdd" in partition.mountpoint:
					self.pathForSwap = partition.mountpoint
					break

				if partition.device and isFileSystemSupported(partition.filesystem()):
					if not self.pathForSwap:
						self.pathForSwap = partition.mountpoint

		self.Console = SwapConsole()
		self.swapOn()
# iq]

		from Tools.HardwareInfo import HardwareInfo
		model = HardwareInfo().get_device_name()

		self["red"] = Label(_("Remove Plugins"))
		if os_path.exists("/etc/factory"):
			self["green"] = Label(_(" "))
		else:
			self["green"] = Label(_("Download Plugins"))
		
		self.list = []
		self["list"] = PluginList(self.list)
		if config.usage.sort_pluginlist.value:
			self["list"].list.sort() # sort

# NOTE : plugins sort
		
		self["actions"] = ActionMap(["WizardActions"],
		{
			"ok": self.save,
			"back": self.close,
		})
		if os_path.exists("/etc/factory"):
			self["PluginDownloadActions"] = ActionMap(["ColorActions"],
			{
				"red": self.delete
			})
		else:
			self["PluginDownloadActions"] = ActionMap(["ColorActions"],
			{
				"red": self.delete,
				"green": self.download
			})

		self.onFirstExecBegin.append(self.checkWarnings)
		self.onShown.append(self.updateList)
		self.onChangedEntry = []
		self["list"].onSelectionChanged.append(self.selectionChanged)
		self.onLayoutFinish.append(self.saveListsize)
# [iq
#		self.onLayoutFinish.append(self.swapOn)
		self.onClose.append(self.swapOff)
Ejemplo n.º 2
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self.firsttime = True

# [iq
		self.mtdSwap = 0

		self.pathForSwap = None
		if not self.mtdSwap:

#			hddList = harddiskmanager.HDDList()
#			for h in hddList:
#				if "/media/hdd" in h[1].findMount():
#					self.hddForSwap = h[1].findMount()
#					break
#
#				devpath = "/sys/block/" + h[1].device[:3]
#				removable = bool(int(readFile(devpath + "/removable")))
#				if not removable:
#					if not self.hddForSwap:
#					self.hddForSwap = h[1].findMount()

			from Components.Harddisk import isFileSystemSupported
			for partition in harddiskmanager.getMountedPartitions():
				if "/media/hdd" in partition.mountpoint:
					self.pathForSwap = partition.mountpoint
					break

				if partition.device and isFileSystemSupported(partition.filesystem()):
					if not self.pathForSwap:
						self.pathForSwap = partition.mountpoint

		self.Console = SwapConsole()
		self.swapOn()
# iq]

		self["red"] = Label(_("Remove Plugins"))
		self["green"] = Label(_("Download Plugins"))
		
		self.list = []
		self["list"] = PluginList(self.list)
		if config.usage.sort_pluginlist.value:
			self["list"].list.sort() # sort

# NOTE : plugins sort
		
		self["actions"] = ActionMap(["WizardActions"],
		{
			"ok": self.save,
			"back": self.close,
		})
		self["PluginDownloadActions"] = ActionMap(["ColorActions"],
		{
			"red": self.delete,
			"green": self.download
		})

		self.onFirstExecBegin.append(self.checkWarnings)
		self.onShown.append(self.updateList)
		self.onChangedEntry = []
		self["list"].onSelectionChanged.append(self.selectionChanged)
		self.onLayoutFinish.append(self.saveListsize)
# [iq
#		self.onLayoutFinish.append(self.swapOn)
		self.onClose.append(self.swapOff)