mirror of
https://github.com/onyx-and-iris/voicemeeter-compact.git
synced 2024-11-21 12:20:56 +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.minsize(275, False)
|
||||||
self.subject = Subject()
|
self.subject = Subject()
|
||||||
self._configs = None
|
self._configs = None
|
||||||
|
self.protocol("WM_DELETE_WINDOW", self.on_close_window)
|
||||||
self.menu = self["menu"] = Menus(self, vmr)
|
self.menu = self["menu"] = Menus(self, vmr)
|
||||||
self.styletable = ttk.Style()
|
self.styletable = ttk.Style()
|
||||||
if _configuration.config:
|
if _configuration.config:
|
||||||
@ -182,6 +183,11 @@ class App(tk.Tk):
|
|||||||
self.destroy()
|
self.destroy()
|
||||||
self.after(250, self.healthcheck_step)
|
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}
|
_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):
|
if fn := getattr(self.target.command, cmd):
|
||||||
fn()
|
fn()
|
||||||
if cmd == "shutdown":
|
if cmd == "shutdown":
|
||||||
self.parent.destroy()
|
self.parent.on_close_window()
|
||||||
|
|
||||||
def action_set_voicemeeter(self, cmd, val=True):
|
def action_set_voicemeeter(self, cmd, val=True):
|
||||||
if cmd == "lock":
|
if cmd == "lock":
|
||||||
|
Loading…
Reference in New Issue
Block a user