예제 #1
0
파일: Preset.py 프로젝트: wxthon/cecilia5
    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)