Skip to content
Permalink
Browse files

Make styling widget live apply remember setting

  • Loading branch information
nyalldawson committed Jun 10, 2016
1 parent a592167 commit fae6ee4a94fdc5cb9a2273a7a64b3435f2996c61
Showing with 11 additions and 0 deletions.
  1. +10 −0 src/app/qgsmapstylingwidget.cpp
  2. +1 −0 src/app/qgsmapstylingwidget.h
@@ -57,6 +57,9 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QList<QgsMapStyl

connect( QgsMapLayerRegistry::instance(), SIGNAL( layerWillBeRemoved( QgsMapLayer* ) ), this, SLOT( layerAboutToBeRemoved( QgsMapLayer* ) ) );

QSettings settings;
mLiveApplyCheck->setChecked( settings.value( "UI/autoApplyStyling", true ).toBool() );

mAutoApplyTimer = new QTimer( this );
mAutoApplyTimer->setSingleShot( true );

@@ -74,6 +77,7 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QList<QgsMapStyl
connect( mOptionsListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( updateCurrentWidgetLayer() ) );
connect( mButtonBox->button( QDialogButtonBox::Apply ), SIGNAL( clicked() ), this, SLOT( apply() ) );
connect( mLayerCombo, SIGNAL( layerChanged( QgsMapLayer* ) ), this, SLOT( setLayer( QgsMapLayer* ) ) );
connect( mLiveApplyCheck, SIGNAL( toggled( bool ) ), this, SLOT( liveApplyToggled( bool ) ) );

mStackedWidget->setCurrentIndex( 0 );
}
@@ -366,6 +370,12 @@ void QgsMapStylingWidget::layerAboutToBeRemoved( QgsMapLayer* layer )
}
}

void QgsMapStylingWidget::liveApplyToggled( bool value )
{
QSettings settings;
settings.setValue( "UI/autoApplyStyling", value );
}

void QgsMapStylingWidget::pushUndoItem( const QString &name )
{
QString errorMsg;
@@ -85,6 +85,7 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget, private Ui::QgsMapStyling
private slots:
void updateCurrentWidgetLayer();
void layerAboutToBeRemoved( QgsMapLayer* layer );
void liveApplyToggled( bool value );

private:
void pushUndoItem( const QString& name );

0 comments on commit fae6ee4

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