Navigation Menu

Skip to content

Commit

Permalink
Enable/disable raster icons based on context of which layer is active
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15433 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Mar 11, 2011
1 parent e49a148 commit bf6cb2e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -5709,6 +5709,9 @@ void QgisApp::activateDeactivateLayerRelatedActions( QgsMapLayer* layer )
mActionRotateLabel->setEnabled( false );
mActionChangeLabelProperties->setEnabled( false );

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

return;
}

Expand All @@ -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 );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit bf6cb2e

Please sign in to comment.