def onDeletePreset(self): if self.currentPreset in CeciliaLib.getVar("presets"): dlg = wx.MessageDialog(self, 'Preset %s will be deleted. Are you sure?' % self.currentPreset, 'Warning!', wx.YES_NO | wx.NO_DEFAULT | wx.ICON_INFORMATION) if dlg.ShowModal() == wx.ID_NO: ok = False else: ok = True dlg.Destroy() if ok: CeciliaLib.deletePreset(self.currentPreset) self.presetChoice.setChoice(self.orderingPresetNames(), False) self.presetChoice.setStringSelection("") CeciliaLib.saveCeciliaFile(self, showDialog=False)