@@ -482,14 +482,24 @@ def start(self) -> None:
482
482
window_menu .addAction (check_action )
483
483
484
484
# Tools Menu ===========================================================
485
+ def create_fix_unlinked_entries_modal ():
486
+ """Postpone the creation of the modal until it is needed."""
487
+ if not hasattr (self , "unlinked_modal" ):
488
+ self .unlinked_modal = FixUnlinkedEntriesModal (self .lib , self )
489
+ self .unlinked_modal .show ()
490
+
485
491
fix_unlinked_entries_action = QAction ("Fix &Unlinked Entries" , menu_bar )
486
- fue_modal = FixUnlinkedEntriesModal (self .lib , self )
487
- fix_unlinked_entries_action .triggered .connect (lambda : fue_modal .show ())
492
+ fix_unlinked_entries_action .triggered .connect (create_fix_unlinked_entries_modal )
488
493
tools_menu .addAction (fix_unlinked_entries_action )
489
494
495
+ def create_dupe_files_modal ():
496
+ """Postpone the creation of the modal until it is needed."""
497
+ if not hasattr (self , "dupe_modal" ):
498
+ self .dupe_modal = FixDupeFilesModal (self .lib , self )
499
+ self .dupe_modal .show ()
500
+
490
501
fix_dupe_files_action = QAction ("Fix Duplicate &Files" , menu_bar )
491
- fdf_modal = FixDupeFilesModal (self .lib , self )
492
- fix_dupe_files_action .triggered .connect (lambda : fdf_modal .show ())
502
+ fix_dupe_files_action .triggered .connect (create_dupe_files_modal )
493
503
tools_menu .addAction (fix_dupe_files_action )
494
504
495
505
create_collage_action = QAction ("Create Collage" , menu_bar )
@@ -540,9 +550,14 @@ def start(self) -> None:
540
550
)
541
551
window_menu .addAction (show_libs_list_action )
542
552
553
+ def create_folders_tags_modal ():
554
+ """Postpone the creation of the modal until it is needed."""
555
+ if not hasattr (self , "folders_modal" ):
556
+ self .folders_modal = FoldersToTagsModal (self .lib , self )
557
+ self .folders_modal .show ()
558
+
543
559
folders_to_tags_action = QAction ("Folders to Tags" , menu_bar )
544
- ftt_modal = FoldersToTagsModal (self .lib , self )
545
- folders_to_tags_action .triggered .connect (lambda : ftt_modal .show ())
560
+ folders_to_tags_action .triggered .connect (create_folders_tags_modal )
546
561
macros_menu .addAction (folders_to_tags_action )
547
562
548
563
# Help Menu ============================================================
0 commit comments