Skip to content
Permalink
Browse files

attribute table: ShowVisible behaviour mode

* change 'show all' action text
* add note to the window title
* also ignore mode for geometryless tables

(fixes #12318)
  • Loading branch information
jef-n committed Mar 10, 2015
1 parent 306a53b commit 2a5d59e872f91de16eed73aab218aed46a71ec58
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/app/qgsattributetabledialog.cpp
@@ -90,7 +90,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
context.setVectorLayerTools( QgisApp::instance()->vectorLayerTools() );

QgsFeatureRequest r;
if ( settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible )
if ( mLayer->geometryType() != QGis::NoGeometry &&
settings.value( "/qgis/attributeTableBehaviour", QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible )
{
QgsMapCanvas *mc = QgisApp::instance()->mapCanvas();
QgsRectangle extent( mc->mapSettings().mapToLayerCoordinates( theLayer, mc->extent() ) );
@@ -100,6 +101,8 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
mRubberBand = new QgsRubberBand( mc, true );
mRubberBand->setToGeometry( g, theLayer );
delete g;

mActionShowAllFilter->setText( tr( "Show All Features In Initial Canvas Extent" ) );
}

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

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

0 comments on commit 2a5d59e

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