Skip to content

Commit fae6ee4

Browse files
committed
Make styling widget live apply remember setting
1 parent a592167 commit fae6ee4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/app/qgsmapstylingwidget.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ QgsMapStylingWidget::QgsMapStylingWidget( QgsMapCanvas* canvas, QList<QgsMapStyl
5757

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

60+
QSettings settings;
61+
mLiveApplyCheck->setChecked( settings.value( "UI/autoApplyStyling", true ).toBool() );
62+
6063
mAutoApplyTimer = new QTimer( this );
6164
mAutoApplyTimer->setSingleShot( true );
6265

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

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

373+
void QgsMapStylingWidget::liveApplyToggled( bool value )
374+
{
375+
QSettings settings;
376+
settings.setValue( "UI/autoApplyStyling", value );
377+
}
378+
369379
void QgsMapStylingWidget::pushUndoItem( const QString &name )
370380
{
371381
QString errorMsg;

src/app/qgsmapstylingwidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class APP_EXPORT QgsMapStylingWidget : public QWidget, private Ui::QgsMapStyling
8585
private slots:
8686
void updateCurrentWidgetLayer();
8787
void layerAboutToBeRemoved( QgsMapLayer* layer );
88+
void liveApplyToggled( bool value );
8889

8990
private:
9091
void pushUndoItem( const QString& name );

0 commit comments

Comments
 (0)