def __init__(self): # Hatari and configuration self.hatari = Hatari() error = self.hatari.is_compatible() if error: ErrorDialog(None).run(error) sys.exit(1) self.config = HatariConfigMapping(self.hatari) try: self.config.validate() except (KeyError, AttributeError): NoteDialog(None).run( "Hatari configuration validation failed!\nRetrying after saving Hatari configuration." ) error = self.hatari.save_config() if error: ErrorDialog(None).run( "Hatari configuration saving failed (code: %d), quitting!" % error) sys.exit(error) self.config = HatariConfigMapping(self.hatari) try: self.config.validate() except (KeyError, AttributeError): ErrorDialog(None).run( "Invalid Hatari configuration, quitting!") sys.exit(1) self.config.init_compat() # windows are created when needed self.mainwin = None self.hatariwin = None self.debugui = None self.panels = {} # dialogs are created when needed self.aboutdialog = None self.inputdialog = None self.tracedialog = None self.resetdialog = None self.quitdialog = None self.killdialog = None self.floppydialog = None self.harddiskdialog = None self.displaydialog = None self.joystickdialog = None self.machinedialog = None self.peripheraldialog = None self.sounddialog = None self.pathdialog = None # used by run() self.memstate = None self.floppy = None self.io_id = None # TODO: Hatari UI own configuration settings save/load self.tracepoints = None
def TakeNote(self, code, volume, page, idx): note, state = self._model.GetNote(idx) dialog = NoteDialog(self._view, note, state) dialog.Center() if dialog.ShowModal() == wx.ID_OK: self._model.TakeNote(idx, dialog.GetNote(), dialog.GetState(), code) dialog.Destroy()