Skip to content

Commit

Permalink
add a special value to update threshold spinbox (follows e09683b)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 14, 2013
1 parent 7cceaaf commit 08fc298
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 5 additions & 2 deletions src/app/qgsoptions.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -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() );
Expand Down
2 changes: 0 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -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>
Expand Down

0 comments on commit 08fc298

Please sign in to comment.