mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2024-11-15 17:40:52 +00:00
on_close_window() callback added.
cleanly shuts down vban connection on windows close if vban connected.
This commit is contained in:
parent
6222ab1e62
commit
bfb0482c32
@ -50,6 +50,7 @@ class App(tk.Tk):
|
||||
self.minsize(275, False)
|
||||
self.subject = Subject()
|
||||
self._configs = None
|
||||
self.protocol("WM_DELETE_WINDOW", self.on_close_window)
|
||||
self.menu = self["menu"] = Menus(self, vmr)
|
||||
self.styletable = ttk.Style()
|
||||
if _configuration.config:
|
||||
@ -182,6 +183,11 @@ class App(tk.Tk):
|
||||
self.destroy()
|
||||
self.after(250, self.healthcheck_step)
|
||||
|
||||
def on_close_window(self):
|
||||
if _base_values.vban_connected:
|
||||
self._vban.logout()
|
||||
self.destroy()
|
||||
|
||||
|
||||
_apps = {kind.name: App.make(kind) for kind in _kinds_all}
|
||||
|
||||
|
@ -227,7 +227,7 @@ class Menus(tk.Menu):
|
||||
if fn := getattr(self.target.command, cmd):
|
||||
fn()
|
||||
if cmd == "shutdown":
|
||||
self.parent.destroy()
|
||||
self.parent.on_close_window()
|
||||
|
||||
def action_set_voicemeeter(self, cmd, val=True):
|
||||
if cmd == "lock":
|
||||
|
Loading…
Reference in New Issue
Block a user