File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 11
11
from mcta_processing import transform_and_save_mcta_output
12
12
import scoring
13
13
import user_interface
14
+ import sys
14
15
15
16
user_input = user_interface .MainWindow ()
17
+ if (user_input .cancelled ):
18
+ sys .exit (0 )
19
+
16
20
input_folder = user_input .input_folder
17
21
image_paths = file_handling .filter_images (
18
22
file_handling .list_file_paths (input_folder ))
Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ class MainWindow:
453
453
output_mcta : bool
454
454
debug_mode : bool = False
455
455
form_variant : FormVariantSelection
456
+ cancelled : bool = False
456
457
457
458
def __init__ (self ):
458
459
app : tk .Tk = tk .Tk ()
@@ -462,6 +463,8 @@ def __init__(self):
462
463
iconpath = str (Path (__file__ ).parent / "assets" / "icon.ico" )
463
464
app .iconbitmap (iconpath )
464
465
466
+ app .protocol ("WM_DELETE_WINDOW" , self .__on_close )
467
+
465
468
self .__input_folder_picker = InputFolderPickerWidget (
466
469
app , self .__on_update )
467
470
self .__answer_key_picker = AnswerKeyPickerWidget (app , self .__on_update )
@@ -616,5 +619,10 @@ def __show_sheet(self):
616
619
"multiple_choice_sheet_150q.pdf" )
617
620
subprocess .Popen ([helpfile ], shell = True )
618
621
622
+ def __on_close (self ):
623
+ self .__app .destroy ()
624
+ self .__ready_to_continue .set (1 )
625
+ self .cancelled = True
626
+
619
627
def create_and_pack_progress (self , maximum : int ) -> ProgressTrackerWidget :
620
628
return ProgressTrackerWidget (self .__app , maximum )
You can’t perform that action at this time.
0 commit comments