Skip to content

Commit

Permalink
Move remove layer/group to legend dock. Remove from toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Sep 10, 2014
1 parent 17767ba commit 34f147b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -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 * ) ) );

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand Down
8 changes: 5 additions & 3 deletions src/ui/qgisapp.ui
Expand Up @@ -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">
Expand Down Expand Up @@ -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">
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 34f147b

Please sign in to comment.