Skip to content

Commit 2a5d59e

Browse files
committed
attribute table: ShowVisible behaviour mode
* change 'show all' action text * add note to the window title * also ignore mode for geometryless tables (fixes #12318)
1 parent 306a53b commit 2a5d59e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/app/qgsattributetabledialog.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
9090
context.setVectorLayerTools( QgisApp::instance()->vectorLayerTools() );
9191

9292
QgsFeatureRequest r;
93-
if ( settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible )
93+
if ( mLayer->geometryType() != QGis::NoGeometry &&
94+
settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible )
9495
{
9596
QgsMapCanvas *mc = QgisApp::instance()->mapCanvas();
9697
QgsRectangle extent( mc->mapSettings().mapToLayerCoordinates( theLayer, mc->extent() ) );
@@ -100,6 +101,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
100101
mRubberBand = new QgsRubberBand( mc, true );
101102
mRubberBand->setToGeometry( g, theLayer );
102103
delete g;
104+
105+
mActionShowAllFilter->setText( tr( "Show All Features In Initial Canvas Extent" ) );
103106
}
104107

105108
// Initialize dual view
@@ -236,11 +239,12 @@ QgsAttributeTableDialog::~QgsAttributeTableDialog()
236239
void QgsAttributeTableDialog::updateTitle()
237240
{
238241
QWidget *w = mDock ? qobject_cast<QWidget*>( mDock ) : qobject_cast<QWidget*>( this );
239-
w->setWindowTitle( tr( "Attribute table - %1 :: Features total: %2, filtered: %3, selected: %4" )
242+
w->setWindowTitle( tr( "Attribute table - %1 :: Features total: %2, filtered: %3, selected: %4%5" )
240243
.arg( mLayer->name() )
241244
.arg( mMainView->featureCount() )
242245
.arg( mMainView->filteredFeatureCount() )
243246
.arg( mLayer->selectedFeatureCount() )
247+
.arg( mRubberBand ? tr( ", spatially limited" ) : "" )
244248
);
245249

246250
if ( mMainView->filterMode() == QgsAttributeTableFilterModel::ShowAll )

0 commit comments

Comments
 (0)