mirror of
https://github.com/Anjok07/ultimatevocalremovergui.git
synced 2025-02-26 06:38:47 +01:00
macOS: handle quit event properly
quit currently exits without saving settings, this fixes that issue
This commit is contained in:
parent
eeb24fcf61
commit
3777346aa0
11
UVR.py
11
UVR.py
@ -2247,6 +2247,12 @@ class MainWindow(TkinterDnD.Tk if is_dnd_compatible else tk.Tk):
|
||||
if confirm:
|
||||
self.save_values(app_close=True, is_restart=True)
|
||||
|
||||
|
||||
def quit(self):
|
||||
self.save_values(app_close=True)
|
||||
super().quit()
|
||||
|
||||
|
||||
def delete_temps(self, is_start_up=False):
|
||||
"""Deletes temp files"""
|
||||
|
||||
@ -7195,6 +7201,11 @@ if __name__ == "__main__":
|
||||
root.is_root_defined_var.set(True)
|
||||
root.is_check_splash = True
|
||||
|
||||
# macOS - intercept the Quit event to make sure we save our preferences
|
||||
# the default implementation completely shortcuts python and directly exits the process
|
||||
# even atexit handlers are not called!
|
||||
root.createcommand('tk::mac::Quit', root.quit)
|
||||
|
||||
root.update() if is_windows else root.update_idletasks()
|
||||
root.deiconify()
|
||||
root.configure(bg=BG_COLOR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user