diff --git a/interface.py b/interface.py index 2d982ad82a02273918bf6b4b63080f3a558ab177..a6c01f1f0b86b7c2214ffa6546cb9b5cc6dff175 100644 --- a/interface.py +++ b/interface.py @@ -299,10 +299,10 @@ class App(object): self.root.mainloop() def on_close(self): - save = Popup(prompt="Save and exit?", options=["Yes", "No", "Cancel"]).pressed + save = Popup(prompt="Save and exit?", options=["Yes", "Exit without saving", "Cancel"]).pressed if save == "Yes": self._quit() - if save == "No": + if save == "Exit without saving": self.root.quit() self.root.destroy() else: @@ -763,10 +763,25 @@ class App(object): ------- None : Saves coords in a json file, quits and destroys root. """ + # save results save_dict( self.klicker.coords, self.DIR_OUT, os.path.basename(self.WAVEFILE)[:-4]+"-contours.json") - + + # save parameters + save_dict( + { + "PCEN": (self.switch_view_button['text'] == "Switch to PCEN"), + "SR": self.NEW_SR, + "NFFT":self.NFFT, + "HOP_LENGTH":self.HOP_LENGTH, + "CLIPPING":self.CLIPPING + }, + os.path.join(self.DIR_OUT, "parameters"), + os.path.basename(self.WAVEFILE)[:-4]+"-params.json" + ) + + # quit window self.root.quit() self.root.destroy() \ No newline at end of file