File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -722,14 +722,16 @@ def __setup_global_actions(self) -> None:
722722 else :
723723 quit_text = _ ("Quit" )
724724 quit_tip = _ ("Quit application" )
725- self .quit_action = create_action (
726- self ,
727- quit_text ,
728- shortcut = QG .QKeySequence (QG .QKeySequence .Quit ),
729- icon = get_icon ("libre-gui-close.svg" ),
730- tip = quit_tip ,
731- triggered = self .close ,
732- )
725+ if sys .platform != 'darwin' :
726+ # On macOS, the "Quit" action is automatically added to the application menu
727+ self .quit_action = create_action (
728+ self ,
729+ quit_text ,
730+ shortcut = QG .QKeySequence (QG .QKeySequence .Quit ),
731+ icon = get_icon ("libre-gui-close.svg" ),
732+ tip = quit_tip ,
733+ triggered = self .close ,
734+ )
733735 # View menu actions
734736 self .auto_refresh_action = create_action (
735737 self ,
@@ -1104,10 +1106,10 @@ def __update_file_menu(self) -> None:
11041106 self .browseh5_action ,
11051107 None ,
11061108 self .settings_action ,
1107- None ,
1108- self .quit_action ,
1109- ],
1109+ ]
11101110 )
1111+ if self .quit_action is not None :
1112+ add_actions (self .file_menu , [None , self .quit_action ])
11111113
11121114 def __update_view_menu (self ) -> None :
11131115 """Update view menu before showing up"""
You can’t perform that action at this time.
0 commit comments