feature/session #27

Merged
Shikiryu merged 7 commits from feature/session into main 2023-06-02 12:24:15 +02:00
2 changed files with 11 additions and 5 deletions
Showing only changes of commit e2546c7bfb - Show all commits

View File

@ -12,7 +12,9 @@ from src.window.session import SessionWindow
class App:
def __init__(self, root):
super().__init__()
self.custom = False
self.config = Config()
self.session = None
self.session_window = None
self.image_window = None
self.root = root
@ -41,7 +43,6 @@ class App:
t = i
new_button = Button(self.button_frame, text=Util.format_seconds(t),
command=partial(self.set_timer_in_seconds, t))
self.buttons.append(new_button)
self.button_frame.columnconfigure(i, weight=1)
new_button.grid(row=0, column=i, sticky=W + E)
@ -72,7 +73,7 @@ class App:
self.check_lets_draw()
def check_lets_draw(self):
if self.selected_folder != "" and len(self.found_images) > 0 and self.timer != 0:
if self.selected_folder != "" and len(self.found_images) > 0 and (self.timer != 0 or self.custom):
self.launch_button.config(state="normal")
else:
self.launch_button.config(state="disabled")
@ -85,3 +86,7 @@ class App:
else:
button.config(bg="gray85")
self.check_lets_draw()
def set_custom(self, list_in_session):
self.custom = True
self.list_in_session = list_in_session

View File

@ -58,8 +58,8 @@ class SessionWindow:
self.down_button = Button(button_frame, text="v", command=self.down_element)
self.down_button.pack(side=LEFT, padx=0, pady=0)
self.save_session_button = Button(button_frame, text="v", command=self.save_session)
self.save_session_button.pack(side=LEFT, padx=0, pady=0)
save_session_button = Button(button_frame, text="v", command=self.save_session)
save_session_button.pack(side=LEFT, padx=0, pady=0)
button_frame.grid()
def reset_element(self):
@ -156,6 +156,7 @@ class SessionWindow:
def save_session(self):
for element in self.list_in_session:
Config._CONFIG['session'].append(element)
Config._CONFIG['session'].append(element.__dict__)
Config.save()
self.app.set_custom(self.list_in_session)
self.window.destroy()