本文整理汇总了Python中Tc2Config.readPersistentItems方法的典型用法代码示例。如果您正苦于以下问题:Python Tc2Config.readPersistentItems方法的具体用法?Python Tc2Config.readPersistentItems怎么用?Python Tc2Config.readPersistentItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tc2Config
的用法示例。
在下文中一共展示了Tc2Config.readPersistentItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readPersistentItems [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.setUpdatesEnabled(False)
self.clear()
template = None
for template in Tc2Config.readPersistentItems(self.SettingsKeyTemplates, maxItems=Tc2Config.MaxTemplates, itemProtos=Tc2ConfigTemplates.Templates):
self.addTopLevelItem(template)
template.setExpanded(template.itemIsExpanded)
# set at least one template as default
if template is None:
template = Tc2ConfigTemplates.TemplatePokerStarsTable()
self.addTopLevelItem(template)
template.setExpanded(True)
self._templatesRead = True
self.setCurrentItem( self.topLevelItem(0) )
self.setUpdatesEnabled(True)
self.adjustActions()
self.setAlternatingRowColors(globalObject.settingsGlobal.alternatingRowColors())
globalObject.settingsGlobal.alternatingRowColorsChanged.connect(self.setAlternatingRowColors)
self.setRootIsDecorated(globalObject.settingsGlobal.childItemIndicators())
globalObject.settingsGlobal.childItemIndicatorsChanged.connect(self.setRootIsDecorated)
globalObject.widgetScreenshotQuery.emit()
示例2: onGlobalObjectInitSettingsFinished
# 需要导入模块: import Tc2Config [as 别名]
# 或者: from Tc2Config import readPersistentItems [as 别名]
def onGlobalObjectInitSettingsFinished(self, globalObject):
self.setUpdatesEnabled(False)
self.clear()
hotkey = None
for hotkey in Tc2Config.readPersistentItems(
self.SettingsKeyHotkeys,
maxItems=Tc2Config.MaxHotkeys,
itemProtos=Tc2ConfigHotkeys.Hotkeys
):
self.addTopLevelItem(hotkey)
# set at least one hotkey as default
if hotkey is None:
hotkey = Tc2ConfigHotkeys.HotkeyScreenshot(key='<F1+LeftControl>')
self.addTopLevelItem(hotkey)
self.setCurrentItem( self.topLevelItem(0) )
self.setUpdatesEnabled(True)
self.adjustHotkeys()
self.adjustActions()
self.setAlternatingRowColors(globalObject.settingsGlobal.alternatingRowColors())
globalObject.settingsGlobal.alternatingRowColorsChanged.connect(self.setAlternatingRowColors)