Exemple #1
0
	def __init__(self, session, setup, plugin=None, PluginLanguageDomain=None):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.setup = setup
		self.plugin = plugin
		self.pluginLanguageDomain = PluginLanguageDomain
		if not isinstance(self.skinName, list):
			self.skinName = [self.skinName]
		if setup:
			self.skinName.append("Setup%s" % setup)  # DEBUG: Proposed for new setup screens.
			self.skinName.append("setup_%s" % setup)
		self.skinName.append("Setup")
		self.list = []
		ConfigListScreen.__init__(self, self.list, session=session, on_change=self.changedEntry, fullUI=True)
		self["footnote"] = Label()
		self["footnote"].hide()
		self["description"] = Label()
		self.createSetup()
		defaultSetupImage = setups.get("default", "")
		setupImage = setups.get(setup, defaultSetupImage)
		if setupImage:
			imgType = "Default" if setupImage is defaultSetupImage else "Setup"
			setupImage = resolveFilename(SCOPE_CURRENT_SKIN, setupImage)
			print("[Setup] %s image '%s'." % (imgType, setupImage))
			self.setupImage = LoadPixmap(setupImage)
			if self.setupImage:
				self["setupimage"] = Pixmap()
			else:
				print("[Setup] Error: Unable to load menu image '%s'!" % setupImage)
		else:
			self.setupImage = None
		if self.layoutFinished not in self.onLayoutFinish:
			self.onLayoutFinish.append(self.layoutFinished)
		if self.selectionChanged not in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.selectionChanged)
 def __init__(self, session, setup, plugin=None, PluginLanguageDomain=None):
     Screen.__init__(self,
                     session,
                     mandatoryWidgets=["config", "footnote", "description"])
     HelpableScreen.__init__(self)
     self.setup = setup
     self.plugin = plugin
     self.pluginLanguageDomain = PluginLanguageDomain
     if not isinstance(self.skinName, list):
         self.skinName = [self.skinName]
     if setup:
         self.skinName.append("setup_%s" % setup)
         self.skinName.append("Setup%s" % setup)
     self.skinName.append("Setup")
     self.list = []
     ConfigListScreen.__init__(self,
                               self.list,
                               session=session,
                               on_change=self.changedEntry,
                               fullUI=True)
     self["footnote"] = Label()
     self["footnote"].hide()
     self["description"] = Label()
     self.createSetup()
     defaultSetupImage = setups.get("default", "")
     setupImage = setups.get(setup, defaultSetupImage)
     if setupImage:
         type = "Default" if setupImage is defaultSetupImage else "Setup"
         setupImage = resolveFilename(SCOPE_GUISKIN, setupImage)
         print("[Setup] %s image '%s'." % (type, setupImage))
         if isfile(setupImage):
             self.setupImage = LoadPixmap(setupImage)
             if self.setupImage:
                 self["setupimage"] = Pixmap()
             else:
                 print("[Setup] Error: Unable to load image '%s'!" %
                       setupImage)
         else:
             print("[Setup] Error: Setup image '%s' is not a file!" %
                   setupImage)
     else:
         self.setupImage = None
     self["config"].onSelectionChanged.append(self.selectionChanged)
     self.onLayoutFinish.append(self.layoutFinished)
Exemple #3
0
	def __init__(self, session, setup, plugin=None, PluginLanguageDomain=None):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)
		self.setup = setup
		self.plugin = plugin
		self.PluginLanguageDomain = PluginLanguageDomain
		self.onChangedEntry = []
		if hasattr(self, "skinName"):
			if not isinstance(self.skinName, list):
				self.skinName = [self.skinName]
		else:
			self.skinName = []
		if setup:
			self.skinName.append("Setup_%s" % setup)
		self.skinName.append("Setup")
		self.list = []
		ConfigListScreen.__init__(self, self.list, session=session, on_change=self.changedEntry)
		self["footnote"] = Label()
		self["footnote"].hide()
		self["description"] = Label()
		defaultmenuimage = setups.get("default", "")
		menuimage = setups.get(setup, defaultmenuimage)
		if menuimage:
			print("[Setup] %s image '%s'." % ("Default" if menuimage is defaultmenuimage else "Menu", menuimage))
			menuimage = resolveFilename(SCOPE_CURRENT_SKIN, menuimage)
			self.menuimage = LoadPixmap(menuimage)
			if self.menuimage:
				self["menuimage"] = Pixmap()
			else:
				print("[Setup] Error: Unable to load menu image '%s'!" % menuimage)
		else:
			self.menuimage = None
		self.createSetup()
		if self.layoutFinished not in self.onLayoutFinish:
			self.onLayoutFinish.append(self.layoutFinished)
		if self.selectionChanged not in self["config"].onSelectionChanged:
			self["config"].onSelectionChanged.append(self.selectionChanged)