Skip to content
Permalink
Browse files

Enable/disable raster icons based on context of which layer is active

git-svn-id: http://svn.osgeo.org/qgis/trunk@15433 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Mar 11, 2011
1 parent c1df06c commit 47a69a9af8f890661f59134dd03e93969d7b465d
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/app/qgisapp.cpp
@@ -5709,6 +5709,9 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionRotateLabel->setEnabled( false );
mActionChangeLabelProperties->setEnabled( false );

mActionLocalHistogramStretch->setEnabled( false );
mActionFullHistogramStretch->setEnabled( false );

return;
}

@@ -5722,6 +5725,9 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
QgsVectorDataProvider* dprovider = vlayer->dataProvider();
bool layerHasSelection = vlayer->selectedFeatureCount() != 0;

mActionLocalHistogramStretch->setEnabled( false );
mActionFullHistogramStretch->setEnabled( false );

mActionSelect->setEnabled( true );
mActionSelectRectangle->setEnabled( true );
mActionSelectPolygon->setEnabled( true );
@@ -5945,10 +5951,12 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
}

mActionLayerSubsetString->setEnabled( false );
}
}//end vector layer block
/*************Raster layers*************/
else if ( layer->type() == QgsMapLayer::RasterLayer )
{
mActionLocalHistogramStretch->setEnabled( true );
mActionFullHistogramStretch->setEnabled( true );
mActionLayerSubsetString->setEnabled( false );
mActionSelect->setEnabled( false );
mActionSelectRectangle->setEnabled( false );

0 comments on commit 47a69a9

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