Skip to content
Permalink
Browse files
Moved all digitizing settings except Enums and Flags
  • Loading branch information
domi4484 committed Apr 26, 2021
1 parent 4fb0ab2 commit eaf18f606012397f8cb4d3931048e6323a14d296
Showing with 261 additions and 308 deletions.
  1. +0 −13 python/core/auto_generated/settings/qgssettingsregistrycore.sip.in
  2. +2 −2 src/analysis/vector/geometry_checker/qgsgeometryisvalidcheck.cpp
  3. +5 −6 src/app/labeling/qgsmaptoollabel.cpp
  4. +3 −6 src/app/maptools/qgsappmaptools.cpp
  5. +69 −72 src/app/options/qgsoptions.cpp
  6. +4 −5 src/app/qgisapp.cpp
  7. +1 −1 src/app/qgsdisplayangle.cpp
  8. +3 −4 src/app/qgsfeatureaction.cpp
  9. +2 −2 src/app/qgsmaptooladdellipse.h
  10. +13 −15 src/app/qgsmaptooloffsetcurve.cpp
  11. +1 −1 src/app/qgsmeasuredialog.cpp
  12. +2 −3 src/app/qgssnappingwidget.cpp
  13. +3 −4 src/app/vertextool/qgslockedfeature.cpp
  14. +3 −5 src/app/vertextool/qgsvertextool.cpp
  15. +5 −5 src/core/qgssnappingconfig.cpp
  16. +4 −4 src/core/qgstolerance.cpp
  17. +2 −2 src/core/qgstracer.cpp
  18. +1 −1 src/core/settings/qgssettingsregistrycore.h
  19. +4 −5 src/core/vector/qgsvectorlayerrenderer.cpp
  20. +4 −4 src/gui/qgsmapcanvassnappingutils.cpp
  21. +2 −2 src/gui/qgsmapcanvastracer.cpp
  22. +8 −12 src/gui/qgsmaptoolcapture.cpp
  23. +17 −27 src/gui/qgsmaptooledit.cpp
  24. +3 −5 src/gui/qgssnapindicator.cpp
  25. +2 −3 src/gui/vector/qgsattributesformproperties.cpp
  26. +2 −1 tests/src/app/testqgsgpsinformationwidget.cpp
  27. +14 −15 tests/src/app/testqgsmaptooladdfeatureline.cpp
  28. +3 −3 tests/src/app/testqgsmaptooladdfeaturepoint.cpp
  29. +13 −13 tests/src/app/testqgsmaptoolcircle.cpp
  30. +11 −11 tests/src/app/testqgsmaptoolcircularstring.cpp
  31. +17 −17 tests/src/app/testqgsmaptoolellipse.cpp
  32. +17 −17 tests/src/app/testqgsmaptoolrectangle.cpp
  33. +13 −13 tests/src/app/testqgsmaptoolregularpolygon.cpp
  34. +3 −3 tests/src/app/testqgsmaptoolreshape.cpp
  35. +2 −2 tests/src/app/testqgsvertextool.cpp
  36. +3 −4 tests/src/gui/testqgsmaptooledit.cpp
@@ -72,19 +72,6 @@ Add ``settingsEntry`` to the register.

const QgsSettingsEntryBool settingsDigitizingDefaultSnapEnabled;

class QgsSettingsEntryEnumFlag_settingsDigitizingDefaultSnapType
{
%TypeHeaderCode
#include "qgssettingsregistrycore.h"
#include "qgssettingsentry.h"
typedef QgsSettingsEntryEnumFlag<QgsSnappingConfig::SnappingTypes> QgsSettingsEntryEnumFlag_settingsDigitizingDefaultSnapType;
%End
public:
QgsSettingsEntryEnumFlag_settingsDigitizingDefaultSnapType( const QString &key, QgsSettings::Section section, const QgsSnappingConfig::SnappingTypes &defaultValue, const QString &description = QString() );
QString key( const QString &dynamicKeyPart = QString() ) const;
QgsSnappingConfig::SnappingTypes value( const QString &dynamicKeyPart = QString(), bool useDefaultValueOverride = false, const QgsSnappingConfig::SnappingTypes &defaultValueOverride = QgsSnappingConfig::SnappingTypes() ) const;
};
const QgsSettingsEntryEnumFlag_settingsDigitizingDefaultSnapType settingsDigitizingDefaultSnapType;

const QgsSettingsEntryDouble settingsDigitizingDefaultSnappingTolerance;

@@ -15,7 +15,7 @@ email : matthias@opengis.ch

#include "qgsgeometryisvalidcheck.h"
#include "qgsfeature.h"
#include "qgssettings.h"
#include "qgssettingsregistrycore.h"
#include "qgsgeos.h"
#include "qgsgeometryvalidator.h"

@@ -33,7 +33,7 @@ QList<QgsSingleGeometryCheckError *> QgsGeometryIsValidCheck::processGeometry( c
QVector<QgsGeometry::Error> errors;

QgsGeometry::ValidationMethod method = QgsGeometry::ValidatorQgisInternal;
if ( QgsSettings().value( QStringLiteral( "qgis/digitizing/validate_geometries" ), 1 ).toInt() == 2 )
if ( QgsSettingsRegistryCore::settingsDigitizingValidateGeometries.value() == 2 )
method = QgsGeometry::ValidatorGeos;

QgsGeometryValidator validator( geometry, &errors, method );
@@ -24,7 +24,7 @@
#include "qgsvectorlayer.h"
#include "qgsvectorlayerlabeling.h"
#include "qgsdiagramrenderer.h"
#include "qgssettings.h"
#include "qgssettingsregistrycore.h"
#include "qgsvectorlayerjoininfo.h"
#include "qgsvectorlayerjoinbuffer.h"
#include "qgsauxiliarystorage.h"
@@ -189,11 +189,10 @@ void QgsMapToolLabel::createRubberBands()
// instead, just use the boundary of the polygon for the rubber band
geom = QgsGeometry( geom.constGet()->boundary() );
}
QgsSettings settings;
int r = settings.value( QStringLiteral( "qgis/digitizing/line_color_red" ), 255 ).toInt();
int g = settings.value( QStringLiteral( "qgis/digitizing/line_color_green" ), 0 ).toInt();
int b = settings.value( QStringLiteral( "qgis/digitizing/line_color_blue" ), 0 ).toInt();
int a = settings.value( QStringLiteral( "qgis/digitizing/line_color_alpha" ), 200 ).toInt();
int r = QgsSettingsRegistryCore::settingsDigitizingLineColorRed.value();
int g = QgsSettingsRegistryCore::settingsDigitizingLineColorGreen.value();
int b = QgsSettingsRegistryCore::settingsDigitizingLineColorBlue.value();
int a = QgsSettingsRegistryCore::settingsDigitizingLineColorAlpha.value();
mFeatureRubberBand = new QgsRubberBand( mCanvas, geom.type() );
mFeatureRubberBand->setColor( QColor( r, g, b, a ) );
mFeatureRubberBand->setToGeometry( geom, vlayer );
@@ -69,6 +69,7 @@
#include "qgsmaptoolpinlabels.h"
#include "qgsmaptooloffsetpointsymbol.h"
#include "qgsspinbox.h"
#include "qgssettingsregistrycore.h"

//
// QgsStreamDigitizingSettingsAction
@@ -80,25 +81,21 @@ QgsStreamDigitizingSettingsAction::QgsStreamDigitizingSettingsAction( QWidget *p
QGridLayout *gLayout = new QGridLayout();
gLayout->setContentsMargins( 3, 2, 3, 2 );

QgsSettings settings;
int defaultTolerance = settings.value( QStringLiteral( "/qgis/digitizing/stream_tolerance" ), 2 ).toInt();

mStreamToleranceSpinBox = new QgsSpinBox();
mStreamToleranceSpinBox->setSuffix( tr( "px" ) );
mStreamToleranceSpinBox->setKeyboardTracking( false );
mStreamToleranceSpinBox->setRange( 1, 200 );
mStreamToleranceSpinBox->setWrapping( false );
mStreamToleranceSpinBox->setSingleStep( 1 );
mStreamToleranceSpinBox->setClearValue( 2 );
mStreamToleranceSpinBox->setValue( defaultTolerance );
mStreamToleranceSpinBox->setValue( QgsSettingsRegistryCore::settingsDigitizingStreamTolerance.value() );

QLabel *label = new QLabel( tr( "Streaming Tolerance" ) );
gLayout->addWidget( label, 1, 0 );
gLayout->addWidget( mStreamToleranceSpinBox, 1, 1 );
connect( mStreamToleranceSpinBox, qOverload<int>( &QgsSpinBox::valueChanged ), this, [ = ]( int value )
{
QgsSettings settings;
settings.setValue( QStringLiteral( "/qgis/digitizing/stream_tolerance" ), value );
QgsSettingsRegistryCore::settingsDigitizingStreamTolerance.setValue( value );
} );

QWidget *w = new QWidget();

0 comments on commit eaf18f6

Please sign in to comment.