gui: improved throughputs start/stop to coincide with session start and stop based on a tracked variable

This commit is contained in:
Blake Harnden 2022-10-12 20:53:59 -07:00
parent 03775c2c3c
commit e0a21fb099
2 changed files with 17 additions and 7 deletions

View file

@ -235,7 +235,11 @@ class Menubar(tk.Menu):
menu.add_command(
label="Configure Throughput", command=self.click_config_throughput
)
menu.add_checkbutton(label="Enable Throughput?", command=self.click_throughput)
menu.add_checkbutton(
label="Enable Throughput?",
command=self.click_throughput,
variable=self.core.show_throughputs,
)
widget_menu.add_cascade(label="Throughput", menu=menu)
def draw_widgets_menu(self) -> None:
@ -393,7 +397,7 @@ class Menubar(tk.Menu):
dialog.show()
def click_throughput(self) -> None:
if not self.core.handling_throughputs:
if self.core.show_throughputs.get():
self.core.enable_throughputs()
else:
self.core.cancel_throughputs()