Skip to content
Snippets Groups Projects
Commit 89f35aab authored by Loïc Lehnhoff's avatar Loïc Lehnhoff
Browse files

Added saving of parameters & improved popup clarity

parent 3ea89a17
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment