Skip to content
Permalink
Browse files

Show actions menu in feature form

Fix #16889
  • Loading branch information
m-kuhn committed Oct 2, 2017
1 parent 471204d commit 11eb9cfe57e95b722ccee49a93d25e521dbc4853
@@ -58,7 +58,7 @@ QgsAttributeActionPropertiesDialog::QgsAttributeActionPropertiesDialog( QgsVecto
QSet<QString> defaultActionScopes;
defaultActionScopes << QStringLiteral( "Canvas" )
<< QStringLiteral( "FieldSpecific" )
<< QStringLiteral( "AttributeTableRow" )
<< QStringLiteral( "Feature" )
<< QStringLiteral( "FeatureForm" );

init( defaultActionScopes );
@@ -185,7 +185,7 @@ QWidget *QgsAttributeTableView::createActionWidget( QgsFeatureId fid )
connect( act, &QAction::triggered, this, &QgsAttributeTableView::actionTriggered );
actionList << act;

if ( mFilterModel->layer()->actions()->defaultAction( QStringLiteral( "AttributeTableRow" ) ).id() == action.id() )
if ( mFilterModel->layer()->actions()->defaultAction( QStringLiteral( "Feature" ) ).id() == action.id() )
defaultAction = act;
}

@@ -297,7 +297,7 @@ void QgsFeatureListView::contextMenuEvent( QContextMenuEvent *event )
{
QgsFeature feature = mModel->data( index, QgsFeatureListModel::FeatureRole ).value<QgsFeature>();

QgsActionMenu *menu = new QgsActionMenu( mModel->layerCache()->layer(), feature, QStringLiteral( "AttributeTableRow" ), this );
QgsActionMenu *menu = new QgsActionMenu( mModel->layerCache()->layer(), feature, QStringLiteral( "Feature" ), this );
menu->exec( event->globalPos() );
}
}
@@ -102,7 +102,7 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsAttributeDialog::accept );
connect( layer, &QObject::destroyed, this, &QWidget::close );

QgsActionMenu *menu = new QgsActionMenu( layer, mAttributeForm->feature(), QStringLiteral( "AttributeTableRow" ), this );
QgsActionMenu *menu = new QgsActionMenu( layer, mAttributeForm->feature(), QStringLiteral( "Feature" ), this );
if ( !menu->actions().isEmpty() )
{
QMenuBar *menuBar = new QMenuBar( this );
@@ -259,7 +259,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
createMenu = !mCustomActionRegistry.mapLayerActions( layer, QgsMapLayerAction::SingleFeature ).isEmpty();
if ( !createMenu && mShowFeatureActions )
{
QgsActionMenu *featureActionMenu = new QgsActionMenu( layer, results[0].mFeature, QStringLiteral( "AttributeTableRow" ), this );
QgsActionMenu *featureActionMenu = new QgsActionMenu( layer, results[0].mFeature, QStringLiteral( "Feature" ), this );
createMenu = !featureActionMenu->actions().isEmpty();
delete featureActionMenu;
}
@@ -344,7 +344,7 @@ void QgsIdentifyMenu::addVectorLayer( QgsVectorLayer *layer, const QList<QgsMapT
QList<QgsMapLayerAction *> customFeatureActions = mCustomActionRegistry.mapLayerActions( layer, QgsMapLayerAction::SingleFeature );
if ( mShowFeatureActions )
{
featureActionMenu = new QgsActionMenu( layer, result.mFeature, QStringLiteral( "AttributeTableRow" ), layerMenu );
featureActionMenu = new QgsActionMenu( layer, result.mFeature, QStringLiteral( "Feature" ), layerMenu );
}

// feature title

0 comments on commit 11eb9cf

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