Fix macOS Preferences menu hijacking

This commit is contained in:
Larry Shaffer 2016-12-27 19:25:31 -07:00
parent 12a4a9c9bd
commit 94dd1f4456
3 changed files with 8 additions and 2 deletions

View File

@ -96,6 +96,8 @@ class ProcessingPlugin(object):
QIcon(os.path.join(cmd_folder, 'images', 'config.png')),
self.tr('&Options...'), self.iface.mainWindow())
self.configAction.setObjectName('configAction')
self.configAction.setMenuRole(QAction.NoRole)
self.configAction.triggered.connect(self.openConfig)
self.iface.registerMainWindowAction(self.configAction, 'Ctrl+Alt+C')
self.menu.addAction(self.configAction)

View File

@ -2028,7 +2028,11 @@ void QgisApp::createMenus()
// keep plugins from hijacking About and Preferences application menus
// these duplicate actions will be moved to application menus by Qt
mProjectMenu->addAction( mActionAbout );
mProjectMenu->addAction( mActionOptions );
QAction* actionPrefs = new QAction( tr( "Preferences..." ), this );
actionPrefs->setMenuRole( QAction::PreferencesRole );
actionPrefs->setIcon( mActionOptions->icon() );
connect( actionPrefs, SIGNAL( triggered() ), this, SLOT( options() ) );
mProjectMenu->addAction( actionPrefs );
// Window Menu

View File

@ -1583,7 +1583,7 @@
<string>&amp;Options...</string>
</property>
<property name="menuRole">
<enum>QAction::PreferencesRole</enum>
<enum>QAction::NoRole</enum>
</property>
</action>
<action name="mActionCustomProjection">