Change how we define which menu items are included in the main menu on Mac OS X

This commit is contained in:
Jonathan Springer 2014-04-16 16:26:49 -04:00
parent f7a23737f2
commit aa6b756956

View File

@ -320,12 +320,12 @@ class Ui_MainWindow(object):
# i18n add Language Actions # i18n add Language Actions
add_actions(self.settings_language_menu, (self.auto_language_item, None)) add_actions(self.settings_language_menu, (self.auto_language_item, None))
add_actions(self.settings_language_menu, self.language_group.actions()) add_actions(self.settings_language_menu, self.language_group.actions())
# Order things differently in OS X so that Preferences menu item in the # Qt on OS X look for keywords in the menu items title to determine which menu items get added to the main menu.
# app menu is correct (this gets picked up automatically by Qt). # If we are running on Mac OS X the menu items whose title contains those keywords but don't belong in the main
# menu need to be marked as such with QAction.NoRole.
if sys.platform == 'darwin': if sys.platform == 'darwin':
add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(), self.settings_shortcuts_item.setMenuRole(QtGui.QAction.NoRole)
None, self.settings_configure_item, self.settings_shortcuts_item, self.formatting_tag_item)) self.formatting_tag_item.setMenuRole(QtGui.QAction.NoRole)
else:
add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(), add_actions(self.settings_menu, (self.settings_plugin_list_item, self.settings_language_menu.menuAction(),
None, self.formatting_tag_item, self.settings_shortcuts_item, self.settings_configure_item)) None, self.formatting_tag_item, self.settings_shortcuts_item, self.settings_configure_item))
add_actions(self.tools_menu, (self.tools_add_tool_item, None)) add_actions(self.tools_menu, (self.tools_add_tool_item, None))