Fix menus for 5754, 5753 and address feature request for 5516 #164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Info is in the commit messages. Commit 10fe387 should probably be reviewed by core developers, as it changes functionality of menus. 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, CadTools and SEXTANTE hijack 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 last Mac-only 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.