Skip to content
Permalink
Browse files

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

  • Loading branch information
jef-n committed Jun 14, 2013
1 parent 7cceaaf commit 08fc298f8579921871b36b8ad6e96e2b2b60935e
Showing with 6 additions and 5 deletions.
  1. +5 −2 src/app/qgsoptions.cpp
  2. +0 −2 src/core/qgsvectorlayer.cpp
  3. +1 −1 src/ui/qgsoptionsbase.ui
@@ -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() );
@@ -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;
@@ -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>

0 comments on commit 08fc298

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