Skip to content
Permalink
Browse files

Cleaning

  • Loading branch information
pblottiere authored and nyalldawson committed May 21, 2018
1 parent 64d52ff commit 8ecc5b90470d8080621219353ec0adaae2232c09
@@ -627,7 +627,6 @@
<file>themes/default/mIconSnappingSegment.svg</file>
<file>themes/default/mIconTopologicalEditing.svg</file>
<file>themes/default/mIconSnappingIntersection.svg</file>
<file>themes/default/mIconEditVerticesAllLayers.svg</file>
<file>themes/default/mActionMoveFeatureCopy.svg</file>
<file>themes/default/mActionMoveFeatureCopyLine.svg</file>
<file>themes/default/mActionMoveFeatureCopyPoint.svg</file>

This file was deleted.

@@ -191,10 +191,6 @@ Returns if the snapping on intersection is enabled
Sets if the snapping on intersection is enabled
%End

bool editVerticesOnAllLayers() const;

void setEditVerticesOnAllLayers( bool enabled );

SIP_PYDICT individualLayerSettings() const;
%Docstring
Returns individual snapping settings for all layers
@@ -969,7 +969,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti

//default snap mode
mSnappingEnabledDefault->setChecked( mSettings->value( QStringLiteral( "/qgis/digitizing/default_snap_enabled" ), false ).toBool() );
mEditVerticesOnAllLayersDefault->setChecked( mSettings->value( QStringLiteral( "/qgis/digitizing/default_edit_vertices_on_all_layers_enabled" ), true ).toBool() );
mDefaultSnapModeComboBox->addItem( tr( "Vertex" ), QgsSnappingConfig::Vertex );
mDefaultSnapModeComboBox->addItem( tr( "Vertex and segment" ), QgsSnappingConfig::VertexAndSegment );
mDefaultSnapModeComboBox->addItem( tr( "Segment" ), QgsSnappingConfig::Segment );
@@ -1518,7 +1517,6 @@ void QgsOptions::saveOptions()
//default snap mode
mSettings->setValue( QStringLiteral( "/qgis/digitizing/default_snap_enabled" ), mSnappingEnabledDefault->isChecked() );
mSettings->setEnumValue( QStringLiteral( "/qgis/digitizing/default_snap_type" ), ( QgsSnappingConfig::SnappingType )mDefaultSnapModeComboBox->currentData().toInt() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/default_edit_vertices_on_all_layers_enabled" ), mEditVerticesOnAllLayersDefault->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance" ), mDefaultSnappingToleranceSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/search_radius_vertex_edit" ), mSearchRadiusVertexEditSpinBox->value() );
mSettings->setEnumValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ),
@@ -194,14 +194,6 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
tracingMenu->addAction( widgetAction );
mEnableTracingAction->setMenu( tracingMenu );

// vertex tool may select vertices from all layers
mEditVerticesAllLayersAction = new QAction( tr( "Edit vertices of all editable layers at once" ), this );
mEditVerticesAllLayersAction->setCheckable( true );
mEditVerticesAllLayersAction->setIcon( QIcon( QgsApplication::getThemeIcon( "/mIconEditVerticesAllLayers.svg" ) ) );
mEditVerticesAllLayersAction->setToolTip( tr( "The vertex editor tool allows to edit vertices from many layers at once. This option allows to restore previous behavior, ie only edit active layer. Useful with transaction groups and database trigger design interfering with multi layer editing" ) );
mEditVerticesAllLayersAction->setObjectName( QStringLiteral( "EditVerticesAllLayersAction" ) );
connect( mEditVerticesAllLayersAction, &QAction::toggled, this, &QgsSnappingWidget::enableEditVerticesOnAllLayers );

// layout
if ( mDisplayMode == ToolBar )
{
@@ -229,7 +221,6 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
tb->addAction( mTopologicalEditingAction );
tb->addAction( mIntersectionSnappingAction );
tb->addAction( mEnableTracingAction );
tb->addAction( mEditVerticesAllLayersAction );
}
else
{
@@ -258,12 +249,6 @@ QgsSnappingWidget::QgsSnappingWidget( QgsProject *project, QgsMapCanvas *canvas,
interButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
layout->addWidget( interButton );

QToolButton *editButton = new QToolButton();
editButton->addAction( mEditVerticesAllLayersAction );
editButton->setDefaultAction( mEditVerticesAllLayersAction );
editButton->setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
layout->addWidget( editButton );

layout->setContentsMargins( 0, 0, 0, 0 );
layout->setAlignment( Qt::AlignRight );
layout->setSpacing( mDisplayMode == Widget ? 3 : 0 );
@@ -358,11 +343,6 @@ void QgsSnappingWidget::projectSnapSettingsChanged()
mIntersectionSnappingAction->setChecked( config.intersectionSnapping() );
}

if ( config.editVerticesOnAllLayers() != mEditVerticesAllLayersAction->isChecked() )
{
mEditVerticesAllLayersAction->setChecked( config.editVerticesOnAllLayers() );
}

toggleSnappingWidgets( config.enabled() );
}

@@ -421,12 +401,6 @@ void QgsSnappingWidget::enableIntersectionSnapping( bool enabled )
mProject->setSnappingConfig( mConfig );
}

void QgsSnappingWidget::enableEditVerticesOnAllLayers( bool enabled )
{
mConfig.setEditVerticesOnAllLayers( enabled );
mProject->setSnappingConfig( mConfig );
}

void QgsSnappingWidget::onSnappingTreeLayersChanged()
{
mLayerTreeView->expandAll();
@@ -106,8 +106,6 @@ class APP_EXPORT QgsSnappingWidget : public QWidget

void enableIntersectionSnapping( bool enabled );

void enableEditVerticesOnAllLayers( bool enabled );

void modeButtonTriggered( QAction *action );
void typeButtonTriggered( QAction *action );

@@ -154,8 +152,6 @@ class APP_EXPORT QgsSnappingWidget : public QWidget
QTreeView *mLayerTreeView = nullptr;
QgsFloatingWidget *mAdvancedConfigContainer = nullptr;

QAction *mEditVerticesAllLayersAction = nullptr;

void cleanGroup( QgsLayerTreeNode *node );
};

@@ -111,15 +111,13 @@ bool QgsSnappingConfig::operator==( const QgsSnappingConfig &other ) const
&& mTolerance == other.mTolerance
&& mUnits == other.mUnits
&& mIntersectionSnapping == other.mIntersectionSnapping
&& mEditVerticesOnAllLayers == other.mEditVerticesOnAllLayers
&& mIndividualLayerSettings == other.mIndividualLayerSettings;
}

void QgsSnappingConfig::reset()
{
// get defaults values. They are both used for standard and advanced configuration (per layer)
bool enabled = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_snap_enabled" ), false ).toBool();
const bool editAllLayers = QgsSettings().value( QStringLiteral( "/qgis/digitizing/default_edit_vertices_on_all_layers_enabled" ), true ).toBool();
SnappingMode mode = QgsSettings().enumValue( QStringLiteral( "/qgis/digitizing/default_snap_mode" ), AllLayers );
if ( mode == 0 )
{
@@ -132,7 +130,6 @@ void QgsSnappingConfig::reset()
QgsTolerance::UnitType units = QgsSettings().enumValue( QStringLiteral( "/qgis/digitizing/default_snapping_tolerance_unit" ), Qgis::DEFAULT_SNAP_UNITS );

// assign main (standard) config
mEditVerticesOnAllLayers = editAllLayers;
mEnabled = enabled;
mMode = mode;
mType = type;
@@ -240,16 +237,6 @@ void QgsSnappingConfig::setIntersectionSnapping( bool enabled )
mIntersectionSnapping = enabled;
}

bool QgsSnappingConfig::editVerticesOnAllLayers() const
{
return mEditVerticesOnAllLayers;
}

void QgsSnappingConfig::setEditVerticesOnAllLayers( bool enabled )
{
mEditVerticesOnAllLayers = enabled;
}

QHash<QgsVectorLayer *, QgsSnappingConfig::IndividualLayerSettings> QgsSnappingConfig::individualLayerSettings() const
{
return mIndividualLayerSettings;
@@ -284,7 +271,6 @@ bool QgsSnappingConfig::operator!=( const QgsSnappingConfig &other ) const
|| mType != other.mType
|| mTolerance != other.mTolerance
|| mUnits != other.mUnits
|| mEditVerticesOnAllLayers != other.mEditVerticesOnAllLayers
|| mIndividualLayerSettings != other.mIndividualLayerSettings;
}

@@ -315,9 +301,6 @@ void QgsSnappingConfig::readProject( const QDomDocument &doc )
if ( snapSettingsElem.hasAttribute( QStringLiteral( "intersection-snapping" ) ) )
mIntersectionSnapping = snapSettingsElem.attribute( QStringLiteral( "intersection-snapping" ) ) == QLatin1String( "1" );

if ( snapSettingsElem.hasAttribute( QStringLiteral( "edit-vertices-on-all-layers" ) ) )
mEditVerticesOnAllLayers = snapSettingsElem.attribute( QStringLiteral( "edit-vertices-on-all-layers" ) ) == QLatin1String( "1" );

// do not clear the settings as they must be automatically synchronized with current layers
QDomNodeList nodes = snapSettingsElem.elementsByTagName( QStringLiteral( "individual-layer-settings" ) );
if ( nodes.count() )
@@ -361,7 +344,6 @@ void QgsSnappingConfig::writeProject( QDomDocument &doc )
snapSettingsElem.setAttribute( QStringLiteral( "tolerance" ), mTolerance );
snapSettingsElem.setAttribute( QStringLiteral( "unit" ), ( int )mUnits );
snapSettingsElem.setAttribute( QStringLiteral( "intersection-snapping" ), QString::number( mIntersectionSnapping ) );
snapSettingsElem.setAttribute( QStringLiteral( "edit-vertices-on-all-layers" ), QString::number( mEditVerticesOnAllLayers ) );

QDomElement ilsElement = doc.createElement( QStringLiteral( "individual-layer-settings" ) );
QHash<QgsVectorLayer *, IndividualLayerSettings>::const_iterator layerIt = mIndividualLayerSettings.constBegin();
@@ -296,7 +296,6 @@ class CORE_EXPORT QgsSnappingConfig
double mTolerance = 0.0;
QgsTolerance::UnitType mUnits = QgsTolerance::ProjectUnits;
bool mIntersectionSnapping = false;
bool mEditVerticesOnAllLayers = true;

QHash<QgsVectorLayer *, IndividualLayerSettings> mIndividualLayerSettings;

@@ -4207,28 +4207,6 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_30">
<property name="title">
<string>Vertex tool</string>
</property>
<layout class="QGridLayout" name="_13">
<item row="0" column="0">
<widget class="QCheckBox" name="mEditVerticesOnAllLayersDefault">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The vertex editor tool allows to edit vertices from many layers at once. This option allows to restore previous behavior, ie only edit active layer. Useful with transaction groups and database trigger design interfering with multi layer editing&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Edit vertices of all editable layers at once by default</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="mVertexMarkerGroupBox">
<property name="title">

0 comments on commit 8ecc5b9

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