add a special value to update threshold spinbox (follows e09683b1)

This commit is contained in:
Juergen E. Fischer 2013-06-14 19:57:00 +02:00
parent 7cceaaf73b
commit 08fc298f85
3 changed files with 6 additions and 5 deletions

View File

@ -360,7 +360,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
#endif
// set the display update threshold
spinBoxUpdateThreshold->setValue( settings.value( "/Map/updateThreshold" ).toInt() );
spinBoxUpdateThreshold->setSpecialValueText( tr( "All" ) );
spinBoxUpdateThreshold->setMinimum( 999 );
spinBoxUpdateThreshold->setValue( qMax( 999, settings.value( "/Map/updateThreshold" ).toInt() ) );
// log rendering events, for userspace debugging
mLogCanvasRefreshChkBx->setChecked( settings.value( "/Map/logCanvasRefreshEvent", false ).toBool() );
@ -1051,7 +1053,8 @@ void QgsOptions::saveOptions()
settings.setValue( "/Raster/cumulativeCutUpper", mRasterCumulativeCutUpperDoubleSpinBox->value() / 100.0 );
settings.setValue( "/Map/enableBackbuffer", chkEnableBackbuffer->isChecked() );
settings.setValue( "/Map/updateThreshold", spinBoxUpdateThreshold->value() );
int threshold = spinBoxUpdateThreshold->value();
settings.setValue( "/Map/updateThreshold", threshold < 1000 ? 0 : threshold );
// log rendering events, for userspace debugging
settings.setValue( "/Map/logCanvasRefreshEvent", mLogCanvasRefreshChkBx->isChecked() );

View File

@ -655,8 +655,6 @@ bool QgsVectorLayer::draw( QgsRenderContext& rendererContext )
mUpdateThreshold = settings.value( "Map/updateThreshold", 0 ).toInt();
// users could accidently set updateThreshold threshold to a small value
// and complain about bad performance -> force min 1000 here
// TODO: improve GUI (checkbox?) to make obvious the min value (cannot set min
// on spinbox because 0 as used for no refresh)
if ( mUpdateThreshold > 0 && mUpdateThreshold < 1000 )
{
mUpdateThreshold = 1000;

View File

@ -1645,7 +1645,7 @@
<item row="3" column="0" colspan="2">
<widget class="QLabel" name="textLabel3">
<property name="text">
<string>&lt;b&gt;Note:&lt;/b&gt; Use zero to prevent display updates until all features have been rendered</string>
<string>&lt;b&gt;Note:&lt;/b&gt; Set below 1000 to prevent display updates until all features have been rendered</string>
</property>
</widget>
</item>