✨ Add sessions
This commit was merged in pull request #27.
This commit is contained in:
@@ -8,6 +8,7 @@ from src.util import Util
|
||||
|
||||
class Toolbar:
|
||||
def __init__(self, image_window, timer):
|
||||
self.timers = []
|
||||
self.current_image = None
|
||||
self.current_original_image = None
|
||||
self.image_window = image_window
|
||||
@@ -47,6 +48,7 @@ class Toolbar:
|
||||
self.timer_label.pack(side=RIGHT, ipadx=20)
|
||||
|
||||
def display_new_timer(self):
|
||||
self.timer = self.timers.pop(0)
|
||||
self.timer_label.configure(text=Util.format_seconds(self.timer))
|
||||
self.timer_check = self.image_window.window.after(1000, self.update_timer, self.timer)
|
||||
|
||||
@@ -59,7 +61,7 @@ class Toolbar:
|
||||
self.timer_check = self.image_window.window.after(1000, self.update_timer, current)
|
||||
else:
|
||||
self.image_window.window.after_cancel(self.timer_check)
|
||||
if len(self.image_window.images) == 0:
|
||||
if len(self.image_window.image.images) == 0 or len(self.timers) == 0:
|
||||
self.image_window.window.destroy()
|
||||
self.image_window.window.update()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user