Skip to content
Permalink
Browse files

Merge branch 'fix-menu-ordering-2' of https://github.com/dakcarto/Qua…

…ntum-GIS into 5753
  • Loading branch information
timlinux committed Jun 21, 2012
2 parents 02b1324 + de6f642 commit 1d8ed46a7ff4913569011c26af62a2236f858f17
Showing with 37 additions and 10 deletions.
  1. +37 −10 src/app/qgisapp.cpp
@@ -5953,22 +5953,31 @@ void QgisApp::addPluginToDatabaseMenu( QString name, QAction* action )
{
if ( actions.at( i )->menu() == mDatabaseMenu )
return;

// goes before Web menu, if present
if ( actions.at( i )->menu() == mWebMenu )
{
before = actions.at( i );
break;
}
else if ( actions.at( i )->menu() == firstRightStandardMenu() )
}
for ( int i = 0; i < actions.count(); i++ )
{
// defaults to after Raster menu, which is already in qgisapp.ui
if ( actions.at( i )->menu() == mRasterMenu )
{
before = actions.at( i );
break;
if ( !before )
{
before = actions.at( i += 1 );
break;
}
}
}

if ( before )
menuBar()->insertMenu( before, mDatabaseMenu );
else
menuBar()->addMenu( mDatabaseMenu );
// fallback insert
menuBar()->insertMenu( firstRightStandardMenu()->menuAction(), mDatabaseMenu );
}

void QgisApp::addPluginToRasterMenu( QString name, QAction* action )
@@ -5992,6 +6001,8 @@ void QgisApp::addPluginToVectorMenu( QString name, QAction* action )
{
if ( actions.at( i )->menu() == mVectorMenu )
return;

// goes before Raster menu, which is already in qgisapp.ui
if ( actions.at( i )->menu() == mRasterMenu )
{
before = actions.at( i );
@@ -6002,7 +6013,8 @@ void QgisApp::addPluginToVectorMenu( QString name, QAction* action )
if ( before )
menuBar()->insertMenu( before, mVectorMenu );
else
menuBar()->addMenu( mVectorMenu );
// fallback insert
menuBar()->insertMenu( firstRightStandardMenu()->menuAction(), mVectorMenu );
}

void QgisApp::addPluginToWebMenu( QString name, QAction* action )
@@ -6018,19 +6030,34 @@ void QgisApp::addPluginToWebMenu( QString name, QAction* action )
QList<QAction*> actions = menuBar()->actions();
for ( int i = 0; i < actions.count(); i++ )
{
// goes after Database menu, if present
if ( actions.at( i )->menu() == mDatabaseMenu )
{
before = actions.at( i += 1 );
// don't break here
}

if ( actions.at( i )->menu() == mWebMenu )
return;
if ( actions.at( i )->menu() == firstRightStandardMenu() )
}
for ( int i = 0; i < actions.count(); i++ )
{
// defaults to after Raster menu, which is already in qgisapp.ui
if ( actions.at( i )->menu() == mRasterMenu )
{
before = actions.at( i );
break;
if ( !before )
{
before = actions.at( i += 1 );
break;
}
}
}

if ( before )
menuBar()->insertMenu( before, mWebMenu );
else
menuBar()->addMenu( mWebMenu );
// fallback insert
menuBar()->insertMenu( firstRightStandardMenu()->menuAction(), mWebMenu );
}

void QgisApp::removePluginDatabaseMenu( QString name, QAction* action )

0 comments on commit 1d8ed46

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