Skip to content

Commit f144553

Browse files
authored
Merge pull request #6399 from nyalldawson/hide_dupe
Hide 'duplicate features' actions by default
2 parents 835cca7 + 43350a9 commit f144553

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

resources/qgis_global_settings.ini

+5
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ connections-xyz\OpenStreetMap\zmin=0
3333
# Default help location to include
3434
# for now this is online version of the User Guide for latest (LTR) release
3535
helpSearchPath=https://docs.qgis.org/$qgis_short_version/$qgis_locale/docs/user_manual/
36+
37+
[app]
38+
39+
# If true, the experimental "duplicate feature" actions will be shown in the QGIS UI
40+
tools\showDuplicateFeatureActions=false

src/app/qgisapp.cpp

+21-17
Original file line numberDiff line numberDiff line change
@@ -7489,27 +7489,31 @@ void QgisApp::setupLayoutManagerConnections()
74897489

74907490
void QgisApp::setupDuplicateFeaturesAction()
74917491
{
7492-
mDuplicateFeatureAction.reset( new QgsMapLayerAction( tr( "Duplicate feature" ),
7493-
nullptr, QgsMapLayerAction::SingleFeature,
7494-
QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateFeature.svg" ) ) ) );
7495-
7496-
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mDuplicateFeatureAction.get() );
7497-
connect( mDuplicateFeatureAction.get(), &QgsMapLayerAction::triggeredForFeature, this, [this]( QgsMapLayer * layer, const QgsFeature & feat )
7492+
QgsSettings settings;
7493+
if ( settings.value( QStringLiteral( "tools/showDuplicateFeatureActions" ), false, QgsSettings::App ).toBool() )
74987494
{
7499-
duplicateFeatures( layer, feat );
7500-
}
7501-
);
7495+
mDuplicateFeatureAction.reset( new QgsMapLayerAction( tr( "Duplicate feature" ),
7496+
nullptr, QgsMapLayerAction::SingleFeature,
7497+
QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateFeature.svg" ) ) ) );
75027498

7503-
mDuplicateFeatureDigitizeAction.reset( new QgsMapLayerAction( tr( "Duplicate feature and digitize" ),
7504-
nullptr, QgsMapLayerAction::SingleFeature,
7505-
QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateFeatureDigitized.svg" ) ) ) );
7499+
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mDuplicateFeatureAction.get() );
7500+
connect( mDuplicateFeatureAction.get(), &QgsMapLayerAction::triggeredForFeature, this, [this]( QgsMapLayer * layer, const QgsFeature & feat )
7501+
{
7502+
duplicateFeatures( layer, feat );
7503+
}
7504+
);
75067505

7507-
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mDuplicateFeatureDigitizeAction.get() );
7508-
connect( mDuplicateFeatureDigitizeAction.get(), &QgsMapLayerAction::triggeredForFeature, this, [this]( QgsMapLayer * layer, const QgsFeature & feat )
7509-
{
7510-
duplicateFeatureDigitized( layer, feat );
7506+
mDuplicateFeatureDigitizeAction.reset( new QgsMapLayerAction( tr( "Duplicate feature and digitize" ),
7507+
nullptr, QgsMapLayerAction::SingleFeature,
7508+
QgsApplication::getThemeIcon( QStringLiteral( "/mActionDuplicateFeatureDigitized.svg" ) ) ) );
7509+
7510+
QgsGui::mapLayerActionRegistry()->addMapLayerAction( mDuplicateFeatureDigitizeAction.get() );
7511+
connect( mDuplicateFeatureDigitizeAction.get(), &QgsMapLayerAction::triggeredForFeature, this, [this]( QgsMapLayer * layer, const QgsFeature & feat )
7512+
{
7513+
duplicateFeatureDigitized( layer, feat );
7514+
}
7515+
);
75117516
}
7512-
);
75137517
}
75147518

75157519
void QgisApp::setupAtlasMapLayerAction( QgsPrintLayout *layout, bool enableAction )

0 commit comments

Comments
 (0)