From 9faf8ae10ca5d392e38efe906750f97ea1d5b8b8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Tue, 11 Jul 2023 01:27:05 +0100 Subject: [PATCH] easier to read --- vmcompact/menu.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vmcompact/menu.py b/vmcompact/menu.py index a9af0bc..a68ee4d 100644 --- a/vmcompact/menu.py +++ b/vmcompact/menu.py @@ -224,7 +224,10 @@ class Menus(tk.Menu): ] def action_invoke_voicemeeter(self, cmd): - getattr(self.target.command, cmd)() + if fn := getattr(self.target.command, cmd): + fn() + if cmd == "shutdown": + self.parent.destroy() def action_set_voicemeeter(self, cmd, val=True): if cmd == "lock": @@ -398,7 +401,7 @@ class Menus(tk.Menu): self.vban.logout() # build new app frames according to a kind kind = kind_get(self.vmr.type) - self.parent.build_app(kind, None) + self.parent.build_app(kind) target_menu = getattr(self, f"menu_vban_{i+1}") target_menu.entryconfig(0, state="normal") target_menu.entryconfig(1, state="disabled")