Cancel export if esc used

This commit is contained in:
ABelliqueux 2024-02-27 11:50:28 +01:00
parent 1856d42ab4
commit 588d301f13
1 changed files with 5 additions and 1 deletions

View File

@ -724,8 +724,12 @@ class KISStopmo(tk.Tk):
def trigger_export_animation(self, event):
# ~ output_folder = filedialog.askdirectory()
# ~ self.export_filename = "{folder}{sep}{filename}".format(folder=output_folder, sep=os.sep, filename=self.output_filename)
# TODO : Check what happens when closing the window without entering a name
self.export_filename = ()
self.export_filename = filedialog.asksaveasfilename(defaultextension='.mp4', filetypes=((_("Mp4 files"), '*.mp4'),))
if not self.export_filename:
# ~ self.export_filename = "{folder}{sep}{filename}".format(folder=os.getcwd(), sep=os.sep, filename=self.output_filename)
return False
print(_("Exporting to {}").format(self.export_filename))
self.export_task = asyncio.run(self.export_animation())
# check with self.export_task.done() == True ? https://stackoverflow.com/questions/69350645/proper-way-to-retrieve-the-result-of-tasks-in-asyncio