Skip to content

Commit

Permalink
Allow plugins to add actions to top level of raster/vector/db/web menus
Browse files Browse the repository at this point in the history
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 16, 2018
1 parent d0c14ef commit 87c3a86
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 87c3a86

Please sign in to comment.