Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for issues #5753 and #5754 #165

Merged
merged 2 commits into from
Jun 10, 2012
Merged

Fixes for issues #5753 and #5754 #165

merged 2 commits into from
Jun 10, 2012

Conversation

dakcarto
Copy link
Member

Additional info is in the commit messages. No new strings added.

Commit f01c6ad only fixes the issue as far as QGIS src code is concerned. It doesn't keep plugins, that are added by user, from hijacking the About or Preferences... menu actions, under QGIS application menu on Mac.

For example, SEXTANTE hijacks the About menu, if installed. The last plugin to load that has a QAction with a name that starts with 'about*' will be the winning hijacker. This is only if the plugin installs its own top-level menu in the menu bar; submenus are ignored by Qt for the Mac-only merge 'feature'.

To fix this issue, a function needs added that can be called whenever/wherever a plugin is added to a top-level menubar menu. It should check if any of the QActions added has a role of QAction::TextHeuristicRole and, if so, set it to QAction::NoRole, as all menu roles are already explicitly defined for AboutRole and PreferencesRole (in src/ui/qgisapp.ui). Any new QAction's menu role, excepting maybe in the future ApplicationSpecificRole, should not be allowed to heuristically hijack the QGIS.app's main application menu actions, just because their action's title starts with a particular text.

QAction::TextHeuristicRole is basically a bad idea and its functionality should be removed from Qt, or least Qt should offer a way to turn it off from being the default role.

…ke a method that set all QAction additions to base menus (submenus ok) to QAction::NoRole. This would keep any new action from hijacking the Mac app's About or Preferences… menus.

See: http://doc.qt.nokia.com/4.7.1/qmenubar.html#qmenubar-on-mac-os-x
Does not address third-party plugins that add their own menus. They should use (here for Python):

menu_bar = self.iface.mainWindow().menuBar()
menu_bar.insertMenu( self.iface.firstRightStandardMenu().menuAction(), self.my_plugins_menu )

Ideally, a new QgisInterface public slot pair of addMenuToMenuBar(QMenu)/removeMenuFromMenuBar(QMenu) should be added, to help plugin developers put their menus in the correct place.

Deletion in GdalTools.py is redundant add-to-menu code. It moved the Raster menu to -1 on the menubar (between Window and Help on Mac).
jef-n added a commit that referenced this pull request Jun 10, 2012
@jef-n jef-n merged commit d77ce93 into qgis:master Jun 10, 2012
yjacolin pushed a commit to yjacolin/QGIS that referenced this pull request Oct 4, 2014
Offline editing and EVIS plugin screenshots for users manual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants