Skip to content
Permalink
Browse files

Move remove layer/group to legend dock. Remove from toolbar

  • Loading branch information
NathanW2 committed Sep 10, 2014
1 parent 17767ba commit 34f147b261dfaad62cba844019b71d6815706f83
Showing with 11 additions and 5 deletions.
  1. +6 −2 src/app/qgisapp.cpp
  2. +5 −3 src/ui/qgisapp.ui
@@ -1651,7 +1651,7 @@ void QgisApp::createToolBars()
case 1: defNewLayerAction = mActionNewVectorLayer; break;
}
bt->setDefaultAction( defNewLayerAction );
QAction* newLayerAction = mLayerToolBar->insertWidget( mActionRemoveLayer, bt );
QAction* newLayerAction = mLayerToolBar->insertWidget( mActionAddDelimitedText, bt );
newLayerAction->setObjectName( "ActionNewLayer" );
connect( bt, SIGNAL( triggered( QAction * ) ), this, SLOT( toolButtonActionTriggered( QAction * ) ) );

@@ -2344,12 +2344,17 @@ void QgisApp::initLayerTreeView()
btnCollapseAll->setToolTip( tr( "Collapse All" ) );
connect( btnCollapseAll, SIGNAL( clicked() ), mLayerTreeView, SLOT( collapseAll() ) );

QToolButton* btnRemoveItem = new QToolButton;
btnRemoveItem->setDefaultAction( this->mActionRemoveLayer );
btnRemoveItem->setAutoRaise( true );

QHBoxLayout* toolbarLayout = new QHBoxLayout;
toolbarLayout->setContentsMargins( QMargins( 5, 0, 5, 0 ) );
toolbarLayout->addWidget( btnAddGroup );
toolbarLayout->addWidget( btnVisibilityGroups );
toolbarLayout->addWidget( btnExpandAll );
toolbarLayout->addWidget( btnCollapseAll );
toolbarLayout->addWidget( btnRemoveItem );
toolbarLayout->addStretch();

QVBoxLayout* vboxLayout = new QVBoxLayout;
@@ -8768,7 +8773,6 @@ void QgisApp::legendLayerSelectionChanged( void )
{
QList<QgsLayerTreeLayer*> selectedLayers = mLayerTreeView ? mLayerTreeView->selectedLayerNodes() : QList<QgsLayerTreeLayer*>();

mActionRemoveLayer->setEnabled( selectedLayers.count() > 0 );
mActionDuplicateLayer->setEnabled( selectedLayers.count() > 0 );
mActionSetLayerScaleVisibility->setEnabled( selectedLayers.count() > 0 );
mActionSetLayerCRS->setEnabled( selectedLayers.count() > 0 );
@@ -17,7 +17,7 @@
<x>0</x>
<y>0</y>
<width>1050</width>
<height>18</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="mProjectMenu">
@@ -320,7 +320,6 @@
<addaction name="mActionAddWcsLayer"/>
<addaction name="mActionAddWfsLayer"/>
<addaction name="mActionAddDelimitedText"/>
<addaction name="mActionRemoveLayer"/>
</widget>
<widget class="QToolBar" name="mDigitizeToolBar">
<property name="windowTitle">
@@ -1322,7 +1321,10 @@
<normaloff>:/images/themes/default/mActionRemoveLayer.svg</normaloff>:/images/themes/default/mActionRemoveLayer.svg</iconset>
</property>
<property name="text">
<string>Remove Layer(s)</string>
<string>Remove Layer/Group</string>
</property>
<property name="toolTip">
<string>Remove Layer/Group</string>
</property>
<property name="shortcut">
<string>Ctrl+D</string>

0 comments on commit 34f147b

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