@@ -183,15 +183,29 @@ QgsAppGpsSettingsMenu::QgsAppGpsSettingsMenu( QWidget *parent )
183
183
mAutoAddTrackVerticesAction = new QAction ( tr ( " Automatically Add Track Vertices" ), this );
184
184
mAutoAddTrackVerticesAction ->setCheckable ( true );
185
185
mAutoAddTrackVerticesAction ->setChecked ( QgsProject::instance ()->gpsSettings ()->automaticallyAddTrackVertices () );
186
- connect ( mAutoAddTrackVerticesAction , &QAction::toggled, QgsProject::instance ()->gpsSettings (), &QgsProjectGpsSettings::setAutomaticallyAddTrackVertices );
186
+ connect ( mAutoAddTrackVerticesAction , &QAction::toggled, this , [ = ]( bool checked )
187
+ {
188
+ if ( checked != QgsProject::instance ()->gpsSettings ()->automaticallyAddTrackVertices () )
189
+ {
190
+ QgsProject::instance ()->gpsSettings ()->setAutomaticallyAddTrackVertices ( checked );
191
+ QgsProject::instance ()->setDirty ();
192
+ }
193
+ } );
187
194
connect ( QgsProject::instance ()->gpsSettings (), &QgsProjectGpsSettings::automaticallyAddTrackVerticesChanged, mAutoAddTrackVerticesAction , &QAction::setChecked );
188
195
189
196
addAction ( mAutoAddTrackVerticesAction );
190
197
191
198
mAutoSaveAddedFeatureAction = new QAction ( tr ( " Automatically Save Added Feature" ), this );
192
199
mAutoSaveAddedFeatureAction ->setCheckable ( true );
193
200
mAutoSaveAddedFeatureAction ->setChecked ( QgsProject::instance ()->gpsSettings ()->automaticallyCommitFeatures () );
194
- connect ( mAutoSaveAddedFeatureAction , &QAction::toggled, QgsProject::instance ()->gpsSettings (), &QgsProjectGpsSettings::setAutomaticallyCommitFeatures );
201
+ connect ( mAutoSaveAddedFeatureAction , &QAction::toggled, this , [ = ]( bool checked )
202
+ {
203
+ if ( checked != QgsProject::instance ()->gpsSettings ()->automaticallyCommitFeatures () )
204
+ {
205
+ QgsProject::instance ()->gpsSettings ()->setAutomaticallyCommitFeatures ( checked );
206
+ QgsProject::instance ()->setDirty ();
207
+ }
208
+ } );
195
209
connect ( QgsProject::instance ()->gpsSettings (), &QgsProjectGpsSettings::automaticallyCommitFeaturesChanged, mAutoSaveAddedFeatureAction , &QAction::setChecked );
196
210
197
211
addAction ( mAutoSaveAddedFeatureAction );
0 commit comments