Skip to content

Commit

Permalink
Fix macOS Preferences menu hijacking
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Dec 28, 2016
1 parent 12a4a9c commit 94dd1f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python/plugins/processing/ProcessingPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def initGui(self):
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)
Expand Down
6 changes: 5 additions & 1 deletion src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) );

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Dec 28, 2016

Collaborator

cough new style connects cough ;)

This comment has been minimized.

Copy link
@dakcarto

dakcarto Dec 28, 2016

Author Member

Should be fixed in 95ff9a1. Thanks!

mProjectMenu->addAction( actionPrefs );

// Window Menu

Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgisapp.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 94dd1f4

Please sign in to comment.