Skip to content
Permalink
Browse files
[needs-docs] Remove duplicate Add Layer option from browser context menu
Instead of two actions: Add Layer & Add Selected Layers, just have
a single Add Selected Layers action which works on either multiple
selections or single selections
  • Loading branch information
nyalldawson committed Jan 23, 2017
1 parent 9124100 commit a0166d94c7dc8cad8c9540ae86cb68352b04a7f8
Showing with 1 addition and 8 deletions.
  1. +1 −7 src/app/qgsbrowserdockwidget.cpp
  2. +0 −1 src/app/qgsbrowserdockwidget.h
@@ -405,8 +405,7 @@ void QgsBrowserDockWidget::showContextMenu( QPoint pt )
}
else if ( item->type() == QgsDataItem::Layer )
{
menu->addAction( tr( "Add Layer" ), this, SLOT( addCurrentLayer() ) );
menu->addAction( tr( "Add Selected Layers" ), this, SLOT( addSelectedLayers() ) );
menu->addAction( tr( "Add Selected Layer(s)" ), this, SLOT( addSelectedLayers() ) );
menu->addAction( tr( "Properties..." ), this, SLOT( showProperties() ) );
}
else if ( item->type() == QgsDataItem::Favorites )
@@ -547,11 +546,6 @@ void QgsBrowserDockWidget::addLayerAtIndex( const QModelIndex& index )
}
}

void QgsBrowserDockWidget::addCurrentLayer()
{
addLayerAtIndex( mBrowserView->currentIndex() );
}

void QgsBrowserDockWidget::addSelectedLayers()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
@@ -126,7 +126,6 @@ class APP_EXPORT QgsBrowserDockWidget : public QgsDockWidget, private Ui::QgsBro
void setFilter();

// layer menu items
void addCurrentLayer();
void addSelectedLayers();
void showProperties();
void hideItem();

0 comments on commit a0166d9

Please sign in to comment.