本文整理汇总了Python中Components.ConfigList.ConfigList.setList方法的典型用法代码示例。如果您正苦于以下问题:Python ConfigList.setList方法的具体用法?Python ConfigList.setList怎么用?Python ConfigList.setList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Components.ConfigList.ConfigList
的用法示例。
在下文中一共展示了ConfigList.setList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: BrowserMenu
# 需要导入模块: from Components.ConfigList import ConfigList [as 别名]
# 或者: from Components.ConfigList.ConfigList import setList [as 别名]
#.........这里部分代码省略.........
# self.detailList.instance.hide()
self.detailInput.hide()
if self.detailConfigList.visible == 0:
self.detailConfigList.show()
def __drawSeparator(self):
self["line"].fill(0, 0, 4, BrowserMenu.height, 0xFF9900)
self["line"].flush()
def __setStatus(self, text):
print "[BrowserMenu].__setStatus"
self["statuslabel"].setText(text)
self["statuslabel"].show()
self.__statusTimer.startLongTimer(3)
def __hideStatus(self):
self["statuslabel"].hide()
self.__statusTimer.stop()
# Config List Methods
def __cfgCreateSetup(self):
list = [
getConfigListEntry(_("Home Page"), config.plugins.WebBrowser.home),
getConfigListEntry(_("Page to load on startup"), config.plugins.WebBrowser.startPage),
getConfigListEntry(_("Search Provider"), config.plugins.WebBrowser.searchProvider),
getConfigListEntry(_("Run fullscreen"), config.plugins.WebBrowser.fullscreen),
getConfigListEntry(_("Offset in scroll mode (px)"), config.plugins.WebBrowser.scrollOffset),
getConfigListEntry(_("Target directory for downloads"), config.plugins.WebBrowser.downloadpath),
getConfigListEntry(_("Enable persistent storage"), config.plugins.WebBrowser.storage.enabled),
]
if config.plugins.WebBrowser.storage.enabled.value:
list.append(getConfigListEntry(_("Path for persistent storage"), config.plugins.WebBrowser.storage.path))
self.detailConfigList.setList(list)
def __cfgExpandableElementChanged(self, element):
self.__cfgCreateSetup()
def __cfgSave(self):
for x in self.detailConfigList.list:
x[1].save()
self.__setStatus(_("Settings have been saved successfully!"))
def __cfgStoragePathChanged(self, element):
action = [self.ACTION_STORAGE_PATH,True]
if not action in self.__actions:
self.__actions.append(action)
def __cfgCancel(self):
dlg = self.session.openWithCallback(self.__cfgCancelCB, MessageBox, _("Do you really want to discard all changes?"), type = MessageBox.TYPE_YESNO)
dlg.setTitle(_("Discard changed settings?"))
def __cfgCancelCB(self, confirmed):
for x in self.detailConfigList.list:
x[1].cancel()
self.__setStatus(_("All changes to the settings have been discarded!"))
def __cfgKeyText(self):
from Screens.VirtualKeyBoard import VirtualKeyBoard
self.session.openWithCallback(self.__cfgVirtualKeyBoardCallback, VirtualKeyBoard, title = self.detailConfigList.getCurrent()[0], text = self.detailConfigList.getCurrent()[1].getValue())
def __cfgVirtualKeyBoardCallback(self, callback = None):
if callback is not None and len(callback):
self.detailConfigList.getCurrent()[1].setValue(callback)
self.detailConfigList.invalidate(self.detailConfigList.getCurrent())