本文整理汇总了Python中CeciliaLib.getPresets方法的典型用法代码示例。如果您正苦于以下问题:Python CeciliaLib.getPresets方法的具体用法?Python CeciliaLib.getPresets怎么用?Python CeciliaLib.getPresets使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CeciliaLib
的用法示例。
在下文中一共展示了CeciliaLib.getPresets方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onPresetSelect
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPresets [as 别名]
def onPresetSelect(self, idxPreset, newPreset):
if CeciliaLib.getPresets().has_key(newPreset):
if newPreset != 'init':
CeciliaLib.loadPresetFromDict(newPreset)
for preset in CeciliaLib.getPresets():
if preset != newPreset:
CeciliaLib.getPresets()[preset]['active'] = False
CeciliaLib.getPresets()[newPreset]['active'] = True
self.currentPreset = newPreset
elif newPreset == 'init':
CeciliaLib.getCeciliaEditor().onUpdateInterface(wx.MenuEvent())
示例2: onSavePreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPresets [as 别名]
def onSavePreset(self):
dlg = wx.TextEntryDialog(self, 'Enter preset name:','Saving Preset', self.currentPreset)
if dlg.ShowModal() == wx.ID_OK:
newPreset = CeciliaLib.ensureNFD(dlg.GetValue())
else:
return
dlg.Destroy()
if newPreset == '':
CeciliaLib.showErrorDialog('Failed saving preset', 'You must give a name to your preset!')
return
if newPreset == 'init':
CeciliaLib.showErrorDialog('Failed saving preset', '"init" is reserved. You must give another name to your preset!')
return
if newPreset in CeciliaLib.getPresets().keys():
dlg2 = wx.MessageDialog(self, 'The preset you entered already exists. Are you sure you want to overwrite it?',
'Existing preset!',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
if dlg2.ShowModal() == wx.ID_NO:
return
dlg2.Destroy()
self.currentPreset = newPreset
CeciliaLib.savePresetToDict(self.currentPreset)
self.presetChoice.setChoice(self.orderingPresetNames(), False)
self.presetChoice.setStringSelection(self.currentPreset)
示例3: onDeletePreset
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPresets [as 别名]
def onDeletePreset(self):
if CeciliaLib.getPresets().has_key(self.currentPreset):
dlg2 = wx.MessageDialog(self, 'Preset %s will be deleted. Are you sure?' % self.currentPreset,
'Warning!',
wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION)
if dlg2.ShowModal() == wx.ID_NO: ok = False
else: ok = True
dlg2.Destroy()
if ok:
CeciliaLib.deletePreset(self.currentPreset)
self.presetChoice.setChoice(self.orderingPresetNames(), False)
self.presetChoice.setStringSelection("")
示例4: orderingPresetNames
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPresets [as 别名]
def orderingPresetNames(self):
presets = CeciliaLib.getPresets().keys()
presets.sort()
presets.insert(0,'init')
return presets
示例5: setLabel
# 需要导入模块: import CeciliaLib [as 别名]
# 或者: from CeciliaLib import getPresets [as 别名]
def setLabel(self, label):
if label in CeciliaLib.getPresets().keys():
self.presetChoice.setLabel(label, False)