def onQuit(self, event): ok = True msg = "Do you want to save the current state of the module?" dlg = wx.MessageDialog(self, msg, "Quit Cecilia5...", style=wx.YES_NO | wx.CANCEL | wx.STAY_ON_TOP) ret = dlg.ShowModal() if ret == wx.ID_YES: CeciliaLib.saveCeciliaFile(self, showDialog=False) elif ret == wx.ID_CANCEL: ok = False dlg.Destroy() if not ok: return if not CeciliaLib.closeCeciliaFile(self): return try: self.prefs.onClose(event) except: pass if CeciliaLib.getVar("audioServer").isAudioServerRunning(): CeciliaLib.getVar("audioServer").stop() time.sleep(.2) if CeciliaLib.getVar('spectrumFrame') is not None: try: CeciliaLib.getVar('spectrumFrame')._destroy(None) except: pass finally: CeciliaLib.setVar('spectrumFrame', None) self.api_doc_frame.Destroy() self.mod_doc_frame.Destroy() self.closeInterface() CeciliaLib.writeVarToDisk() self.Destroy()
def onClose(self, event=None): CeciliaLib.writeVarToDisk() self.Destroy()