Skip to content
Permalink
Browse files

Save/restore GPS interval settings

  • Loading branch information
nyalldawson committed Jun 29, 2018
1 parent a8d933e commit 2beee20f2a35b0ce76a5f67427538c35dd6b1098
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/app/gps/qgsgpsinformationwidget.cpp
@@ -280,16 +280,18 @@ QgsGpsInformationWidget::QgsGpsInformationWidget( QgsMapCanvas *thepCanvas, QWid
mCboDistanceThreshold->addItem( QStringLiteral( "5" ), 5 );
mCboDistanceThreshold->addItem( QStringLiteral( "10" ), 10 );
mCboDistanceThreshold->addItem( QStringLiteral( "15" ), 15 );
mCboAcquisitionInterval->setCurrentIndex( 0 );
mCboAcquisitionInterval->setCurrentIndex( 0 );

mCboAcquisitionInterval->setValidator( mAcquisitionIntValidator );
mCboDistanceThreshold->setValidator( mDistanceThresholdValidator );
mCboAcquisitionInterval->setCurrentText( mySettings.value( QStringLiteral( "gps/acquisitionInterval" ), 0 ).toString() );
mCboDistanceThreshold->setCurrentText( mySettings.value( QStringLiteral( "gps/distanceThreshold" ), 0 ).toString() );

connect( mAcquisitionTimer.get(), &QTimer::timeout,
this, &QgsGpsInformationWidget::switchAcquisition );
connect( mCboAcquisitionInterval, qgis::overload< const QString & >::of( &QComboBox::currentTextChanged ),
this, &QgsGpsInformationWidget::cboAcquisitionIntervalEdited );
connect( mCboDistanceThreshold, qgis::overload< const QString & >::of( &QComboBox::currentTextChanged ),
this, &QgsGpsInformationWidget::cboDistanceThresholdEdited );
mCboAcquisitionInterval->setValidator( mAcquisitionIntValidator );
mCboDistanceThreshold->setValidator( mDistanceThresholdValidator );
}

QgsGpsInformationWidget::~QgsGpsInformationWidget()
@@ -314,6 +316,8 @@ QgsGpsInformationWidget::~QgsGpsInformationWidget()
mySettings.setValue( QStringLiteral( "gps/showMarker" ), mGroupShowMarker->isChecked() );
mySettings.setValue( QStringLiteral( "gps/autoAddVertices" ), mCbxAutoAddVertices->isChecked() );
mySettings.setValue( QStringLiteral( "gps/autoCommit" ), mCbxAutoCommit->isChecked() );
mySettings.setValue( QStringLiteral( "gps/acquisitionInterval" ), mCboAcquisitionInterval->currentText() );
mySettings.setValue( QStringLiteral( "gps/distanceThreshold" ), mCboDistanceThreshold->currentText() );

mySettings.setValue( QStringLiteral( "gps/mapExtentMultiplier" ), mSpinMapExtentMultiplier->value() );

0 comments on commit 2beee20

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