54
54
SliceAboutDialog ,
55
55
SliceErrorDialog ,
56
56
SliceOpenFileDialog ,
57
+ SliceProgressDialog ,
57
58
SliceSaveFileDialog ,
58
59
)
59
60
from .ui .widgets import DragDropLineEdit
@@ -531,9 +532,7 @@ def menu_clicked_source(self):
531
532
QDesktopServices .openUrl (QUrl ("https://github.com/source-foundry/Slice" ))
532
533
533
534
def menu_clicked_updatecheck (self ):
534
- QDesktopServices .openUrl (
535
- QUrl ("https://github.com/source-foundry/Slice/releases" )
536
- )
535
+ QDesktopServices .openUrl (QUrl ("https://github.com/source-foundry/Slice/releases" ))
537
536
538
537
#
539
538
# Button click events
@@ -584,6 +583,7 @@ def btn_clicked_slice(self):
584
583
self .collect_head_bit_checkbox_fields (),
585
584
)
586
585
try :
586
+ # set up instance worker
587
587
instance_worker = InstanceWorker (
588
588
outpath ,
589
589
self .font_model ,
@@ -592,6 +592,11 @@ def btn_clicked_slice(self):
592
592
bit_model ,
593
593
)
594
594
595
+ # launch progress bar dialog
596
+ self .progress_dialog = SliceProgressDialog (
597
+ instance_worker .signals .finished
598
+ )
599
+
595
600
# attach InstanceWorker signals / slots
596
601
instance_worker .signals .result .connect (self ._instance_worker_output )
597
602
instance_worker .signals .finished .connect (
@@ -603,8 +608,9 @@ def btn_clicked_slice(self):
603
608
self .threadpool .start (instance_worker )
604
609
self .statusbar .showMessage ("Slicing..." )
605
610
self .sliceButton .setDisabled (True )
606
-
607
611
except Exception as e :
612
+ # hide progress dialog if exception occurred
613
+ self .progress_dialog .hide ()
608
614
SliceErrorDialog (
609
615
"Font processing failed with an error. See details below." ,
610
616
detailed_text = str (e ),
@@ -654,6 +660,8 @@ def _instance_worker_complete(self):
654
660
self .statusbar .showMessage ("Complete" )
655
661
656
662
def _instance_worker_error (self , error_string ):
663
+ # hide progress dialog before presentation of error dialog
664
+ self .progress_dialog .hide ()
657
665
# Instance worker errored
658
666
# Propagate the exception to an error dialog
659
667
SliceErrorDialog (
@@ -692,9 +700,7 @@ def load_font(self, filepath):
692
700
axis_value_table_was_set = self .fvar_table_model .load_font (self .font_model )
693
701
694
702
self .fvar_table_view .resizeColumnToContents (0 )
695
- self .fvar_table_view .verticalHeader ().resizeSections (
696
- QHeaderView .ResizeToContents
697
- )
703
+ self .fvar_table_view .verticalHeader ().resizeSections (QHeaderView .ResizeToContents )
698
704
699
705
# uncheck all bit flag setting check boxes
700
706
self .os2_fsselection_bit_0_checkbox .setChecked (False )
0 commit comments