[QGIS Commit] r13074 - trunk/qgis/src/app/attributetable
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Mar 19 05:29:10 EDT 2010
Author: jef
Date: 2010-03-19 05:28:59 -0400 (Fri, 19 Mar 2010)
New Revision: 13074
Modified:
trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
Log:
show feature count in attribute table title
Modified: trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp 2010-03-18 23:41:45 UTC (rev 13073)
+++ trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp 2010-03-19 09:28:59 UTC (rev 13074)
@@ -75,14 +75,14 @@
bool myDockFlag = mySettings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
- mDock = new QgsAttributeTableDock( tr( "Attribute table - %1" ).arg( mLayer->name() ), QgisApp::instance() );
+ mDock = new QgsAttributeTableDock( tr( "Attribute table - %1 (%n Feature(s))", "feature count", mModel->rowCount() ).arg( mLayer->name() ), QgisApp::instance() );
mDock->setAllowedAreas( Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea );
mDock->setWidget( this );
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
}
- setWindowTitle( tr( "Attribute table - %1" ).arg( mLayer->name() ) );
+ setWindowTitle( tr( "Attribute table - %1 (%n Feature(s))", "feature count", mModel->rowCount() ).arg( mLayer->name() ) );
mRemoveSelectionButton->setIcon( getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectedToTopButton->setIcon( getThemeIcon( "/mActionSelectedToTop.png" ) );
@@ -578,12 +578,15 @@
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateSelectionFromLayer() ) );
QString str;
+ QWidget *w = mDock ? qobject_cast<QWidget*>( mDock ) : qobject_cast<QWidget*>( this );
if ( mSelectedFeatures.size() )
- str.sprintf( tr( "Found %d matching features.", "", mSelectedFeatures.size() ).toUtf8(), mSelectedFeatures.size() );
+ {
+ w->setWindowTitle( tr( "Attribute table - %1 (%n matching features)", "matching features", mSelectedFeatures.size() ).arg( mLayer->name() ) );
+ }
else
- str = tr( "No matching features found." );
-
- QgisApp::instance()->statusBar()->showMessage( str );
+ {
+ w->setWindowTitle( tr( "Attribute table - %1 (No matching features)" ).arg( mLayer->name() ) );
+ }
}
void QgsAttributeTableDialog::search()
Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp 2010-03-18 23:41:45 UTC (rev 13073)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp 2010-03-19 09:28:59 UTC (rev 13074)
@@ -220,7 +220,7 @@
}
// not needed when we have featureAdded signal
- mFeatureCount = pendingFeatureCount;
+ mFeatureCount = mLayer->pendingFeatureCount();
mFieldCount = mAttributes.size();
if ( ins )
More information about the QGIS-commit
mailing list