Skip to content
Permalink
Browse files

Allow plugins to add actions to top level of raster/vector/db/web menus

Provides a way to avoid plugins creating submenus with a single
action - e.g. "DB Manager" -> "DB Manager". It's a violation of
HIG to have a submenu with a single action contained in it.
  • Loading branch information
nyalldawson committed May 15, 2018
1 parent d0c14ef commit 87c3a86874aa345c67aba4d175861b2115854b3b
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/app/qgisapp.cpp
@@ -10963,6 +10963,9 @@ void QgisApp::removePluginMenu( const QString &name, QAction *action )

QMenu *QgisApp::getDatabaseMenu( const QString &menuName )
{
if ( menuName.isEmpty() )
return mDatabaseMenu;

QString cleanedMenuName = menuName;
#ifdef Q_OS_MAC
// Mac doesn't have '&' keyboard shortcuts.
@@ -11004,6 +11007,9 @@ QMenu *QgisApp::getDatabaseMenu( const QString &menuName )

QMenu *QgisApp::getRasterMenu( const QString &menuName )
{
if ( menuName.isEmpty() )
return mRasterMenu;

QString cleanedMenuName = menuName;
#ifdef Q_OS_MAC
// Mac doesn't have '&' keyboard shortcuts.
@@ -11055,6 +11061,9 @@ QMenu *QgisApp::getRasterMenu( const QString &menuName )

QMenu *QgisApp::getVectorMenu( const QString &menuName )
{
if ( menuName.isEmpty() )
return mVectorMenu;

QString cleanedMenuName = menuName;
#ifdef Q_OS_MAC
// Mac doesn't have '&' keyboard shortcuts.
@@ -11096,6 +11105,9 @@ QMenu *QgisApp::getVectorMenu( const QString &menuName )

QMenu *QgisApp::getWebMenu( const QString &menuName )
{
if ( menuName.isEmpty() )
return mWebMenu;

QString cleanedMenuName = menuName;
#ifdef Q_OS_MAC
// Mac doesn't have '&' keyboard shortcuts.

0 comments on commit 87c3a86

Please sign in to comment.
You can’t perform that action at this time.