Skip to content
Permalink
Browse files
Option for raster icon in legend
git-svn-id: http://svn.osgeo.org/qgis/trunk@13904 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jul 11, 2010
1 parent f1c9014 commit f9ae9e804f48c9a290ffd2f3864fba44a71b0311
Showing with 21 additions and 7 deletions.
  1. +12 −7 src/app/legend/qgslegendlayer.cpp
  2. +2 −0 src/app/qgsoptions.cpp
  3. +7 −0 src/ui/qgsoptionsbase.ui
@@ -365,13 +365,18 @@ QPixmap QgsLegendLayer::getOriginalPixmap()
}
else if ( theLayer->type() == QgsMapLayer::RasterLayer )
{
#if 0 //MH100708: disabled for 1.5 release because of performance problems
QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( theLayer );
QPixmap myPixmap( 32, 32 );
rlayer->thumbnailAsPixmap( &myPixmap );
return myPixmap;
#endif //0
return QPixmap();
QSettings s;
if( s.value( "/qgis/createRasterLegendIcons", true ).toBool() )
{
QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( theLayer );
QPixmap myPixmap( 32, 32 );
rlayer->thumbnailAsPixmap( &myPixmap );
return myPixmap;
}
else
{
return QPixmap();
}
}
}

@@ -235,6 +235,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
cbxIdentifyResultsDocked->setChecked( settings.value( "/qgis/dockIdentifyResults", false ).toBool() );
cbxAddPostgisDC->setChecked( settings.value( "/qgis/addPostgisDC", false ).toBool() );
cbxAddNewLayersToCurrentGroup->setChecked( settings.value( "/qgis/addNewLayersToCurrentGroup", false ).toBool() );
cbxCreateRasterLegendIcons->setChecked( settings.value( "/qgis/createRasterLegendIcons", true ).toBool() );

//set the color for selections
int myRed = settings.value( "/qgis/default_selection_color_red", 255 ).toInt();
@@ -489,6 +490,7 @@ void QgsOptions::saveOptions()
settings.setValue( "/qgis/dockIdentifyResults", cbxIdentifyResultsDocked->isChecked() );
settings.setValue( "/qgis/addPostgisDC", cbxAddPostgisDC->isChecked() );
settings.setValue( "/qgis/addNewLayersToCurrentGroup", cbxAddNewLayersToCurrentGroup->isChecked() );
settings.setValue( "/qgis/createRasterLegendIcons", cbxCreateRasterLegendIcons->isChecked() );
settings.setValue( "/qgis/new_layers_visible", chkAddedVisibility->isChecked() );
settings.setValue( "/qgis/enable_anti_aliasing", chkAntiAliasing->isChecked() );
settings.setValue( "/qgis/enable_render_caching", chkUseRenderCaching->isChecked() );
@@ -379,6 +379,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons in legend</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbxHideSplash">
<property name="text">

0 comments on commit f9ae9e8

Please sign in to comment.