From 1099cfe32f8b1aa1fcee74f4ebbb483cb5add9e5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 19 Nov 2022 04:14:51 -0500 Subject: [PATCH] Re-enable buttons after delay --- src/AutoSplit.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/AutoSplit.py b/src/AutoSplit.py index aada59fc..86bab32b 100644 --- a/src/AutoSplit.py +++ b/src/AutoSplit.py @@ -582,16 +582,23 @@ def __auto_splitter(self): if split_delay > 0 and not self.waiting_for_split_delay: split_time = round(time() + split_delay * 1000) self.waiting_for_split_delay = True - self.next_image_button.setEnabled(False) - self.previous_image_button.setEnabled(False) - self.undo_split_button.setEnabled(False) - self.skip_split_button.setEnabled(False) + buttons_to_disable = [ + self.next_image_button, + self.previous_image_button, + self.undo_split_button, + self.skip_split_button, + ] + for button in buttons_to_disable: + button.setEnabled(False) self.current_image_file_label.clear() # check for reset while delayed and display a counter of the remaining split delay time if self.__pause_loop(split_delay, "Delayed Split:"): return + for button in buttons_to_disable: + button.setEnabled(True) + self.waiting_for_split_delay = False # if {p} flag hit pause key, otherwise hit split hotkey