Skip to content

Commit 94dd1f4

Browse files
committedDec 28, 2016
Fix macOS Preferences menu hijacking
1 parent 12a4a9c commit 94dd1f4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
 

‎python/plugins/processing/ProcessingPlugin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def initGui(self):
9696
QIcon(os.path.join(cmd_folder, 'images', 'config.png')),
9797
self.tr('&Options...'), self.iface.mainWindow())
9898
self.configAction.setObjectName('configAction')
99+
self.configAction.setMenuRole(QAction.NoRole)
100+
99101
self.configAction.triggered.connect(self.openConfig)
100102
self.iface.registerMainWindowAction(self.configAction, 'Ctrl+Alt+C')
101103
self.menu.addAction(self.configAction)

‎src/app/qgisapp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,11 @@ void QgisApp::createMenus()
20282028
// keep plugins from hijacking About and Preferences application menus
20292029
// these duplicate actions will be moved to application menus by Qt
20302030
mProjectMenu->addAction( mActionAbout );
2031-
mProjectMenu->addAction( mActionOptions );
2031+
QAction* actionPrefs = new QAction( tr( "Preferences..." ), this );
2032+
actionPrefs->setMenuRole( QAction::PreferencesRole );
2033+
actionPrefs->setIcon( mActionOptions->icon() );
2034+
connect( actionPrefs, SIGNAL( triggered() ), this, SLOT( options() ) );
Code has comments. Press enter to view.
2035+
mProjectMenu->addAction( actionPrefs );
20322036

20332037
// Window Menu
20342038

‎src/ui/qgisapp.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@
15831583
<string>&amp;Options...</string>
15841584
</property>
15851585
<property name="menuRole">
1586-
<enum>QAction::PreferencesRole</enum>
1586+
<enum>QAction::NoRole</enum>
15871587
</property>
15881588
</action>
15891589
<action name="mActionCustomProjection">

0 commit comments

Comments
 (0)
Please sign in to comment.