Skip to content
Permalink
Browse files

Fix updates of preset combo box when presets get changed

  • Loading branch information
wonder-sk committed May 18, 2016
1 parent 7eb05e2 commit 292a8a4fc175f2fcae20e290ea56bcfea3dc55ab
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/app/composer/qgscomposermapwidget.cpp
@@ -332,6 +332,9 @@ void QgsComposerMapWidget::followVisibilityPresetSelected( int currentIndex )
if ( !mComposerMap )
return;

if ( currentIndex == -1 )
return; // doing combo box model reset

QString presetName;
if ( currentIndex != 0 )
{
@@ -378,6 +381,12 @@ void QgsComposerMapWidget::onPresetsChanged()
lst.append( tr( "(none)" ) );
lst += QgsProject::instance()->visibilityPresetCollection()->presets();
model->setStringList( lst );

// select the previously selected item again
int presetModelIndex = mFollowVisibilityPresetCombo->findText( mComposerMap->followVisibilityPresetName() );
mFollowVisibilityPresetCombo->blockSignals( true );
mFollowVisibilityPresetCombo->setCurrentIndex( presetModelIndex != -1 ? presetModelIndex : 0 ); // 0 == none
mFollowVisibilityPresetCombo->blockSignals( false );
}
}

@@ -840,6 +849,8 @@ void QgsComposerMapWidget::blockAllSignals( bool b )
mAtlasMarginSpinBox->blockSignals( b );
mAtlasFixedScaleRadio->blockSignals( b );
mAtlasMarginRadio->blockSignals( b );
mFollowVisibilityPresetCheckBox->blockSignals( b );
mFollowVisibilityPresetCombo->blockSignals( b );
mKeepLayerListCheckBox->blockSignals( b );
mKeepLayerStylesCheckBox->blockSignals( b );
mSetToMapCanvasExtentButton->blockSignals( b );

0 comments on commit 292a8a4

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