Skip to content

Commit

Permalink
fix bug with predetermined time intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
mk1123 committed Jan 3, 2022
1 parent f6f905c commit 592ee2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion timebox.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,11 @@ def __init__(self, timer_interval=1):
title = str(i) + " Minutes"
def callback(_, j=i):
self.set_mins(_, j)
for btn in [*self.things_buttons.values(), *self.buttons.values()]:
btn.set_callback(None)
self.timer.count = 0
self.timer.end = j
self.timer.end = self.interval
self.start_pause_button.title = "Pause Timer"
self.timer.start()
self.buttons["btn_" + str(i)] = rumps.MenuItem(
title=title, callback=callback
Expand Down Expand Up @@ -184,6 +187,7 @@ def set_mins(self, sender, interval):
for btn in [*self.things_buttons.values(), *self.buttons.values()]:
if sender.title == btn.title:
self.interval = interval * SEC_TO_MIN
print(f"here: {self.interval}")
cleaned_title = " ".join(sender.title.split()[2:])
self.menu_title = (
" ".join(cleaned_title.split()[:4])
Expand Down

0 comments on commit 592ee2d

Please sign in to comment.