[QGIS Commit] r10553 - in trunk/qgis/src/app: . attributetable legend

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Apr 13 05:44:20 EDT 2009


Author: wonder
Date: 2009-04-13 05:44:20 -0400 (Mon, 13 Apr 2009)
New Revision: 10553

Modified:
   trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
   trunk/qgis/src/app/attributetable/qgsattributetabledialog.h
   trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
   trunk/qgis/src/app/attributetable/qgsattributetablemodel.h
   trunk/qgis/src/app/attributetable/qgsattributetableview.cpp
   trunk/qgis/src/app/attributetable/qgsattributetableview.h
   trunk/qgis/src/app/legend/qgslegend.cpp
   trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
   trunk/qgis/src/app/qgisapp.cpp
Log:
Renaming of Beata* classes to QgsAttributeTable* classes done.

Happy easter ;-)


Modified: trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetabledialog.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,6 +1,5 @@
 /***************************************************************************
-  BeataDialog.cpp
-  BEtter Attribute TAble
+  QgsAttributeTableDialog.cpp
   -------------------
          date                 : Feb 2009
          copyright            : Vita Cizek
@@ -17,9 +16,9 @@
 
 #include <QtGui>
 
-#include "BeataDialog.h"
-#include "BeataModel.h"
-#include "BeataView.h"
+#include "qgsattributetabledialog.h"
+#include "qgsattributetablemodel.h"
+#include "qgsattributetableview.h"
 
 #include <qgsapplication.h>
 #include <qgsvectordataprovider.h>
@@ -32,10 +31,10 @@
 #include "qgslogger.h"
 
 
-class QBeataTableDock : public QDockWidget
+class QgsAttributeTableTableDock : public QDockWidget
 {
   public:
-    QBeataTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
+    QgsAttributeTableTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
         : QDockWidget( title, parent, flags )
     {
       setObjectName( "AttributeTable" ); // set object name so the position can be saved
@@ -48,7 +47,7 @@
 };
 
 
-BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
+QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
     : QDialog( parent, flags ), mDock( NULL )
 {
   mLayer = theLayer;
@@ -61,8 +60,8 @@
   restoreGeometry( settings.value( "/Windows/BetterAttributeTable/geometry" ).toByteArray() );
 
   mView->setLayer( mLayer );
-  mFilterModel = ( BeataFilterModel * ) mView->model();
-  mModel = ( BeataModel * )(( BeataFilterModel * )mView->model() )->sourceModel();
+  mFilterModel = ( QgsAttributeTableFilterModel * ) mView->model();
+  mModel = ( QgsAttributeTableModel * )(( QgsAttributeTableFilterModel * )mView->model() )->sourceModel();
 
   mQuery = query;
   mColumnBox = columnBox;
@@ -72,7 +71,7 @@
   bool myDockFlag = mySettings.value( "/qgis/dockAttributeTable", false ).toBool();
   if ( myDockFlag )
   {
-    mDock = new QBeataTableDock( tr( "Attribute table - %1" ).arg( mLayer->name() ), QgisApp::instance() );
+    mDock = new QgsAttributeTableTableDock( tr( "Attribute table - %1" ).arg( mLayer->name() ), QgisApp::instance() );
     mDock->setAllowedAreas( Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea );
     mDock->setWidget( this );
     QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
@@ -111,11 +110,11 @@
   updateSelectionFromLayer();
 }
 
-BeataDialog::~BeataDialog()
+QgsAttributeTableDialog::~QgsAttributeTableDialog()
 {
 }
 
-void BeataDialog::closeEvent( QCloseEvent* event )
+void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
 {
   QDialog::closeEvent( event );
 
@@ -127,7 +126,7 @@
 }
 
 
-QIcon BeataDialog::getThemeIcon( const QString theName )
+QIcon QgsAttributeTableDialog::getThemeIcon( const QString theName )
 {
   // copied from QgisApp::getThemeIcon. To be removed when merged to SVN
 
@@ -149,12 +148,12 @@
   }
 }
 
-void BeataDialog::showAdvanced()
+void QgsAttributeTableDialog::showAdvanced()
 {
   mMenuActions->exec( QCursor::pos() );
 }
 
-void BeataDialog::on_mSelectedToTopButton_clicked()
+void QgsAttributeTableDialog::on_mSelectedToTopButton_clicked()
 {
   int freeIndex = 0;
 
@@ -194,27 +193,27 @@
   updateSelection();
 }
 
-void BeataDialog::on_mCopySelectedRowsButton_clicked()
+void QgsAttributeTableDialog::on_mCopySelectedRowsButton_clicked()
 {
   QgisApp::instance()->editCopy( mLayer );
 }
 
-void BeataDialog::on_mZoomMapToSelectedRowsButton_clicked()
+void QgsAttributeTableDialog::on_mZoomMapToSelectedRowsButton_clicked()
 {
   QgisApp::instance()->zoomToSelected();
 }
 
-void BeataDialog::on_mInvertSelectionButton_clicked()
+void QgsAttributeTableDialog::on_mInvertSelectionButton_clicked()
 {
   mLayer->invertSelection();
 }
 
-void BeataDialog::on_mRemoveSelectionButton_clicked()
+void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
 {
   mLayer->removeSelection();
 }
 
-void BeataDialog::on_cbxShowSelectedOnly_toggled( bool theFlag )
+void QgsAttributeTableDialog::on_cbxShowSelectedOnly_toggled( bool theFlag )
 {
   mFilterModel->mHideUnselected = theFlag;
   mFilterModel->invalidate();
@@ -222,7 +221,7 @@
   //mModel->changeLayout();
 }
 
-void BeataDialog::columnBoxInit()
+void QgsAttributeTableDialog::columnBoxInit()
 {
   QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
   QgsFieldMap::Iterator it = fieldMap.begin();
@@ -231,7 +230,7 @@
     mColumnBox->addItem( it.value().name() );
 }
 
-int BeataDialog::columnBoxColumnId()
+int QgsAttributeTableDialog::columnBoxColumnId()
 {
   QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
   QgsFieldMap::Iterator it = fieldMap.begin();
@@ -243,7 +242,7 @@
   return 0;
 }
 
-void BeataDialog::updateSelection()
+void QgsAttributeTableDialog::updateSelection()
 {
   QModelIndex index;
   mView->setSelectionMode( QAbstractItemView::MultiSelection );
@@ -272,7 +271,7 @@
   */
 }
 
-void BeataDialog::updateRowSelection( int index )
+void QgsAttributeTableDialog::updateRowSelection( int index )
 {
   // map index to filter model
   //index = mFilterModel->mapFromSource(mModel->index(index, 0)).row();
@@ -326,7 +325,7 @@
 }
 
 // fast row deselection needed
-void BeataDialog::updateRowSelection( int first, int last, bool startNewSelection )
+void QgsAttributeTableDialog::updateRowSelection( int first, int last, bool startNewSelection )
 {
   disconnect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateSelectionFromLayer() ) );
 
@@ -398,14 +397,14 @@
   connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateSelectionFromLayer() ) );
 }
 
-void BeataDialog::updateSelectionFromLayer()
+void QgsAttributeTableDialog::updateSelectionFromLayer()
 {
   QgsDebugMsg( "updateFromLayer" );
   mSelectedFeatures = mLayer->selectedFeaturesIds();
   updateSelection();
 }
 
-void BeataDialog::doSearch( QString searchString )
+void QgsAttributeTableDialog::doSearch( QString searchString )
 {
   // parse search string and build parsed tree
   QgsSearchString search;
@@ -462,7 +461,7 @@
   QMessageBox::information( this, tr( "Search results" ), str );
 }
 
-void BeataDialog::search()
+void QgsAttributeTableDialog::search()
 {
 
   QString str = mColumnBox->currentText();
@@ -483,7 +482,7 @@
   doSearch( str );
 }
 
-void BeataDialog::on_mAdvancedSearchButton_clicked()
+void QgsAttributeTableDialog::on_mAdvancedSearchButton_clicked()
 {
   QgsSearchQueryBuilder dlg( mLayer, this );
   dlg.setSearchString( mQuery->displayText() );
@@ -492,12 +491,12 @@
     doSearch( dlg.searchString() );
 }
 
-void BeataDialog::on_mToggleEditingButton_toggled()
+void QgsAttributeTableDialog::on_mToggleEditingButton_toggled()
 {
   emit editingToggled( mLayer );
 }
 
-void BeataDialog::editingToggled()
+void QgsAttributeTableDialog::editingToggled()
 {
   mToggleEditingButton->setChecked( mLayer->isEditable() );
 
@@ -509,19 +508,19 @@
 }
 
 // not used now
-void BeataDialog::startEditing()
+void QgsAttributeTableDialog::startEditing()
 {
   mLayer->startEditing();
 }
 
 // not used now
-void BeataDialog::submit()
+void QgsAttributeTableDialog::submit()
 {
   mLayer->commitChanges();
 }
 
 // not used now
-void BeataDialog::revert()
+void QgsAttributeTableDialog::revert()
 {
   mLayer->rollBack();
   mModel->revert();

Modified: trunk/qgis/src/app/attributetable/qgsattributetabledialog.h
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetabledialog.h	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetabledialog.h	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,6 +1,5 @@
 /***************************************************************************
-  BeataDialog.h
-  BEtter Attribute TAble
+  QgsAttributeTableDialog.h - dialog for attribute table
   -------------------
          date                 : Feb 2009
          copyright            : Vita Cizek
@@ -15,15 +14,15 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef BEATADIALOG_H_
-#define BEATADIALOG_H_
+#ifndef QGSATTRIBUTETABLEDIALOG_H_
+#define QGSATTRIBUTETABLEDIALOG_H_
 
 #include <QDialog>
 #include <QModelIndex>
 #include <QItemSelectionModel>
 #include <QMutex>
 
-#include "ui_BeataGui.h"
+#include "ui_qgsattributetabledialog.h"
 
 class QgsMapLayer;
 class QgsVectorLayer;
@@ -37,17 +36,17 @@
 class QMenu;
 class QDockWidget;
 
-class BeataModel;
-class BeataFilterModel;
-class BeataView;
+class QgsAttributeTableModel;
+class QgsAttributeTableFilterModel;
+class QgsAttributeTableView;
 
-class BeataDialog : public QDialog, private Ui::BeataDialogGui
+class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDialog
 {
     Q_OBJECT
 
   public:
-    BeataDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
-    ~BeataDialog();
+    QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
+    ~QgsAttributeTableDialog();
 
   public slots:
     void editingToggled();
@@ -93,8 +92,8 @@
     QMenu* mMenuActions;
     QAction* mActionToggleEditing;
 
-    BeataModel *mModel;
-    BeataFilterModel *mFilterModel;
+    QgsAttributeTableModel *mModel;
+    QgsAttributeTableFilterModel *mFilterModel;
     QgsVectorLayer *mLayer;
     QgsFeatureIds mSelectedFeatures;
 

Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,5 +1,5 @@
 /***************************************************************************
-     BeataModel.cpp
+     QgsAttributeTableModel.cpp
      --------------------------------------
     Date                 : Feb 2009
     Copyright            : (C) 2009 Vita Cizek
@@ -13,8 +13,8 @@
  *                                                                         *
  ***************************************************************************/
 
-#include "BeataModel.h"
-#include "BeataView.h"
+#include "qgsattributetablemodel.h"
+//#include "qgsattributetableview.h"
 
 #include "qgsvectordataprovider.h"
 #include "qgsfield.h"
@@ -44,44 +44,44 @@
 // Filter Model //
 //////////////////
 
-void BeataFilterModel::sort( int column, Qt::SortOrder order )
+void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
 {
-  (( BeataModel * )sourceModel() )->sort( column, order );
+  (( QgsAttributeTableModel * )sourceModel() )->sort( column, order );
 }
 
-BeataFilterModel::BeataFilterModel( QgsVectorLayer* theLayer )
+QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsVectorLayer* theLayer )
 {
   mLayer = theLayer;
   mHideUnselected = false;
   setDynamicSortFilter( true );
 }
 
-bool BeataFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
+bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
 {
   if ( mHideUnselected )
     // unreadable? yes, i agree :-)
-    return mLayer->selectedFeaturesIds().contains((( BeataModel * )sourceModel() )->rowToId( sourceRow ) );
+    return mLayer->selectedFeaturesIds().contains((( QgsAttributeTableModel * )sourceModel() )->rowToId( sourceRow ) );
 
   return true;
 }
 
 /*
-QModelIndex BeataFilterModel::mapFromSource ( const QModelIndex& sourceIndex ) const
+QModelIndex QgsAttributeTableFilterModel::mapFromSource ( const QModelIndex& sourceIndex ) const
 {
   return sourceIndex;
 }
 
-QModelIndex BeataFilterModel::mapToSource ( const QModelIndex& filterIndex ) const
+QModelIndex QgsAttributeTableFilterModel::mapToSource ( const QModelIndex& filterIndex ) const
 {
   return filterIndex;
 }
 */
 
-////////////////
-// BeataModel //
-////////////////
+////////////////////////////
+// QgsAttributeTableModel //
+////////////////////////////
 
-BeataModel::BeataModel( QgsVectorLayer *theLayer, QObject *parent )
+QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent )
     : QAbstractTableModel( parent )
 {
   mLastRowId = -1;
@@ -101,7 +101,7 @@
   loadLayer();
 }
 
-void BeataModel::featureDeleted( int fid )
+void QgsAttributeTableModel::featureDeleted( int fid )
 {
   QgsDebugMsg( "entered." );
 
@@ -147,7 +147,7 @@
 
 }
 
-void BeataModel::featureAdded( int fid )
+void QgsAttributeTableModel::featureAdded( int fid )
 {
   QgsDebugMsg( "BM feature added" );
   ++mFeatureCount;
@@ -157,7 +157,7 @@
   reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
 }
 
-void BeataModel::attributeAdded( int idx )
+void QgsAttributeTableModel::attributeAdded( int idx )
 {
   QgsDebugMsg( "BM attribute added" );
   loadLayer();
@@ -166,7 +166,7 @@
   emit modelChanged();
 }
 
-void BeataModel::attributeDeleted( int idx )
+void QgsAttributeTableModel::attributeDeleted( int idx )
 {
   QgsDebugMsg( "BM attribute deleted" );
   loadLayer();
@@ -175,7 +175,7 @@
   emit modelChanged();
 }
 
-void BeataModel::layerDeleted()
+void QgsAttributeTableModel::layerDeleted()
 {
   QgsDebugMsg( "entered." );
   mIdRowMap.clear();
@@ -185,13 +185,13 @@
 }
 
 //TODO: check whether caching in data()/setData() doesn't cache old value
-void BeataModel::attributeValueChanged( int fid, int idx, const QVariant &value )
+void QgsAttributeTableModel::attributeValueChanged( int fid, int idx, const QVariant &value )
 {
   QgsDebugMsg( "entered." );
   reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
 }
 
-void BeataModel::layerModified( bool onlyGeometry )
+void QgsAttributeTableModel::layerModified( bool onlyGeometry )
 {
   if ( onlyGeometry )
     return;
@@ -200,7 +200,7 @@
   emit modelChanged();
 }
 
-void BeataModel::loadLayer()
+void QgsAttributeTableModel::loadLayer()
 {
   QgsDebugMsg( "entered." );
 
@@ -261,7 +261,7 @@
 #endif
 }
 
-void BeataModel::swapRows( int a, int b )
+void QgsAttributeTableModel::swapRows( int a, int b )
 {
   if ( a == b )
     return;
@@ -284,7 +284,7 @@
   //emit layoutChanged();
 }
 
-int BeataModel::idToRow( const int id ) const
+int QgsAttributeTableModel::idToRow( const int id ) const
 {
   if ( !mIdRowMap.contains( id ) )
   {
@@ -295,7 +295,7 @@
   return mIdRowMap[id];
 }
 
-int BeataModel::rowToId( const int id ) const
+int QgsAttributeTableModel::rowToId( const int id ) const
 {
   if ( !mRowIdMap.contains( id ) )
   {
@@ -306,17 +306,17 @@
   return mRowIdMap[id];
 }
 
-int BeataModel::rowCount( const QModelIndex &parent ) const
+int QgsAttributeTableModel::rowCount( const QModelIndex &parent ) const
 {
   return mFeatureCount;
 }
 
-int BeataModel::columnCount( const QModelIndex &parent ) const
+int QgsAttributeTableModel::columnCount( const QModelIndex &parent ) const
 {
   return mFieldCount;
 }
 
-QVariant BeataModel::headerData( int section, Qt::Orientation orientation, int role ) const
+QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orientation, int role ) const
 {
   if ( role == Qt::DisplayRole )
   {
@@ -333,7 +333,7 @@
   else return QVariant();
 }
 
-void BeataModel::sort( int column, Qt::SortOrder order )
+void QgsAttributeTableModel::sort( int column, Qt::SortOrder order )
 {
   QgsAttributeMap row;
   idColumnPair pair;
@@ -380,7 +380,7 @@
   emit modelChanged();
 }
 
-QVariant BeataModel::data( const QModelIndex &index, int role ) const
+QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) const
 {
   if ( !index.isValid() || ( role != Qt::TextAlignmentRole && role != Qt::DisplayRole && role != Qt::EditRole ) )
     return QVariant();
@@ -433,7 +433,7 @@
   return val.toString();
 }
 
-bool BeataModel::setData( const QModelIndex &index, const QVariant &value, int role )
+bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &value, int role )
 {
   if ( !index.isValid() || role != Qt::EditRole )
     return false;
@@ -458,7 +458,7 @@
   return true;
 }
 
-Qt::ItemFlags BeataModel::flags( const QModelIndex &index ) const
+Qt::ItemFlags QgsAttributeTableModel::flags( const QModelIndex &index ) const
 {
   if ( !index.isValid() )
     return Qt::ItemIsEnabled;
@@ -471,22 +471,22 @@
   return flags;
 }
 
-void BeataModel::reload( const QModelIndex &index1, const QModelIndex &index2 )
+void QgsAttributeTableModel::reload( const QModelIndex &index1, const QModelIndex &index2 )
 {
   emit dataChanged( index1, index2 );
 }
 
-void BeataModel::resetModel()
+void QgsAttributeTableModel::resetModel()
 {
   reset();
 }
 
-void BeataModel::changeLayout()
+void QgsAttributeTableModel::changeLayout()
 {
   emit layoutChanged();
 }
 
-void BeataModel::incomingChangeLayout()
+void QgsAttributeTableModel::incomingChangeLayout()
 {
   emit layoutAboutToBeChanged();
 }
@@ -495,9 +495,9 @@
 // In-Memory model //
 /////////////////////
 
-void BeataMemModel::loadLayer()
+void QgsAttributeTableMemModel::loadLayer()
 {
-  BeataModel::loadLayer();
+  QgsAttributeTableModel::loadLayer();
   mLayer->select( mLayer->pendingAllAttributesList(), QgsRectangle(), false );
 
   QgsFeature f;
@@ -505,14 +505,14 @@
     mFeatureMap.insert( f.id(), f );
 }
 
-BeataMemModel::BeataMemModel
+QgsAttributeTableMemModel::QgsAttributeTableMemModel
 ( QgsVectorLayer *theLayer )
-    : BeataModel( theLayer )
+    : QgsAttributeTableModel( theLayer )
 {
   loadLayer();
 }
 
-QVariant BeataMemModel::data( const QModelIndex &index, int role ) const
+QVariant QgsAttributeTableMemModel::data( const QModelIndex &index, int role ) const
 {
   if ( !index.isValid() || ( role != Qt::TextAlignmentRole && role != Qt::DisplayRole && role != Qt::EditRole ) )
     return QVariant();
@@ -567,7 +567,7 @@
   return val.toString();
 }
 
-bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, int role )
+bool QgsAttributeTableMemModel::setData( const QModelIndex &index, const QVariant &value, int role )
 {
   if ( !index.isValid() || role != Qt::EditRole )
     return false;
@@ -598,31 +598,31 @@
   return true;
 }
 
-void BeataMemModel::featureDeleted( int fid )
+void QgsAttributeTableMemModel::featureDeleted( int fid )
 {
   QgsDebugMsg( "entered." );
   mFeatureMap.remove( fid );
-  BeataModel::featureDeleted( fid );
+  QgsAttributeTableModel::featureDeleted( fid );
 }
 
-void BeataMemModel::featureAdded( int fid )
+void QgsAttributeTableMemModel::featureAdded( int fid )
 {
   QgsDebugMsg( "entered." );
   QgsFeature f;
   mLayer->featureAtId( fid, f, false, true );
   mFeatureMap.insert( fid, f );
-  BeataModel::featureAdded( fid );
+  QgsAttributeTableModel::featureAdded( fid );
 }
 
 #if 0
-void BeataMemModel::attributeAdded( int idx )
+void QgsAttributeTableMemModel::attributeAdded( int idx )
 {
   QgsDebugMsg( "entered." );
   loadLayer();
   reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
 }
 
-void BeataMemModel::attributeDeleted( int idx )
+void QgsAttributeTableMemModel::attributeDeleted( int idx )
 {
   QgsDebugMsg( "entered." );
   loadLayer();
@@ -630,14 +630,14 @@
 }
 #endif
 
-void BeataMemModel::layerDeleted()
+void QgsAttributeTableMemModel::layerDeleted()
 {
   QgsDebugMsg( "entered." );
   mFeatureMap.clear();
-  BeataModel::layerDeleted();
+  QgsAttributeTableModel::layerDeleted();
 }
 
-void BeataMemModel::attributeValueChanged( int fid, int idx, const QVariant &value )
+void QgsAttributeTableMemModel::attributeValueChanged( int fid, int idx, const QVariant &value )
 {
   QgsDebugMsg( "entered." );
   mFeatureMap[fid].changeAttribute( idx, value );

Modified: trunk/qgis/src/app/attributetable/qgsattributetablemodel.h
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetablemodel.h	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetablemodel.h	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,6 +1,5 @@
 /***************************************************************************
-  BeataModel.h
-  BEtter Attribute TAble
+  QgsAttributeTableModel.h - Models for attribute table
   -------------------
          date                 : Feb 2009
          copyright            : Vita Cizek
@@ -15,8 +14,8 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef BEATAMODEL_H
-#define BEATAMODEL_H
+#ifndef QGSATTRIBUTETABKEMODEL_H
+#define QGSATTRIBUTETABKEMODEL_H
 
 #include <QAbstractTableModel>
 #include <QSortFilterProxyModel>
@@ -37,10 +36,10 @@
     bool operator<( const idColumnPair &b ) const;
 };
 
-class BeataFilterModel: public QSortFilterProxyModel
+class QgsAttributeTableFilterModel: public QSortFilterProxyModel
 {
   public:
-    BeataFilterModel( QgsVectorLayer* theLayer );
+    QgsAttributeTableFilterModel( QgsVectorLayer* theLayer );
     //QModelIndex mapToSource ( const QModelIndex & filterIndex ) const;
     //QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
     bool mHideUnselected;
@@ -52,12 +51,12 @@
 };
 
 
-class BeataModel: public QAbstractTableModel
+class QgsAttributeTableModel: public QAbstractTableModel
 {
     Q_OBJECT
 
   public:
-    BeataModel( QgsVectorLayer *theLayer, QObject *parent = 0 );
+    QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent = 0 );
 
     int rowCount( const QModelIndex &parent = QModelIndex() ) const;
     int columnCount( const QModelIndex &parent = QModelIndex() ) const;
@@ -112,12 +111,12 @@
 
 };
 
-class BeataMemModel: public BeataModel
+class QgsAttributeTableMemModel: public QgsAttributeTableModel
 {
     Q_OBJECT
 
   public:
-    BeataMemModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);
+    QgsAttributeTableMemModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);
 
   protected slots:
     virtual void featureDeleted( int fid );

Modified: trunk/qgis/src/app/attributetable/qgsattributetableview.cpp
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetableview.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetableview.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,5 +1,5 @@
 /***************************************************************************
-     BeataView.cpp
+     QgsAttributeTableView.cpp
      --------------------------------------
     Date                 : Feb 2009
     Copyright            : (C) 2009 Vita Cizek
@@ -21,18 +21,18 @@
 #include <QPainter>
 #include <QKeyEvent>
 
-#include "BeataView.h"
-#include "BeataModel.h"
+#include "qgsattributetableview.h"
+#include "qgsattributetablemodel.h"
 
 #include "qgslogger.h"
 #include "qgsvectorlayer.h"
 #include "qgsvectordataprovider.h"
 
 
-class BeataDelegate : public QItemDelegate
+class QgsAttributeTableDelegate : public QItemDelegate
 {
   public:
-    BeataDelegate( QObject* parent = NULL ) : QItemDelegate( parent ) {}
+    QgsAttributeTableDelegate( QObject* parent = NULL ) : QItemDelegate( parent ) {}
 
     QWidget * createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
     {
@@ -41,7 +41,7 @@
       QLineEdit *le = dynamic_cast<QLineEdit*>( editor );
       if ( !le ) return editor;
 
-      const BeataModel* m = dynamic_cast<const BeataModel*>( index.model() );
+      const QgsAttributeTableModel* m = dynamic_cast<const QgsAttributeTableModel*>( index.model() );
       if ( !m ) return editor;
 
       int col = index.column();
@@ -77,7 +77,7 @@
 
 };
 
-BeataView::BeataView( QWidget* parent )
+QgsAttributeTableView::QgsAttributeTableView( QWidget* parent )
     : QTableView( parent )
 {
   QSettings settings;
@@ -86,7 +86,7 @@
   verticalHeader()->setDefaultSectionSize( 20 );
   horizontalHeader()->setHighlightSections( false );
 
-  setItemDelegate( new BeataDelegate( this ) );
+  setItemDelegate( new QgsAttributeTableDelegate( this ) );
 
   setSelectionBehavior( QAbstractItemView::SelectRows );
   setSelectionMode( QAbstractItemView::NoSelection );
@@ -96,32 +96,32 @@
   ctrlPressed = false;
 }
 
-void BeataView::setLayer( QgsVectorLayer* layer )
+void QgsAttributeTableView::setLayer( QgsVectorLayer* layer )
 {
-  BeataModel *bModel;
+  QgsAttributeTableModel *bModel;
 
   if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::RandomSelectGeometryAtId )
-    bModel = new BeataModel( layer );
+    bModel = new QgsAttributeTableModel( layer );
   else
-    bModel = new BeataMemModel( layer );
+    bModel = new QgsAttributeTableMemModel( layer );
 
-  BeataFilterModel* bfModel = new BeataFilterModel( layer );
+  QgsAttributeTableFilterModel* bfModel = new QgsAttributeTableFilterModel( layer );
   bfModel->setSourceModel( bModel );
 
   setModel( bfModel );
 }
 
-BeataView::~BeataView()
+QgsAttributeTableView::~QgsAttributeTableView()
 {
 }
 
-void BeataView::closeEvent( QCloseEvent *event )
+void QgsAttributeTableView::closeEvent( QCloseEvent *event )
 {
   QSettings settings;
   settings.setValue( "/BetterAttributeTable/geometry", QVariant( saveGeometry() ) );
 }
 
-void BeataView::keyPressEvent( QKeyEvent *event )
+void QgsAttributeTableView::keyPressEvent( QKeyEvent *event )
 {
   // shift pressed
   if ( event->key() == Qt::Key_Shift )// && event->modifiers() & Qt::ShiftModifier)
@@ -132,7 +132,7 @@
     QTableView::keyPressEvent( event );
 }
 
-void BeataView::keyReleaseEvent( QKeyEvent *event )
+void QgsAttributeTableView::keyReleaseEvent( QKeyEvent *event )
 {
   // workaround for some Qt bug
   if ( event->key() == Qt::Key_Shift || event->key() == -1 )

Modified: trunk/qgis/src/app/attributetable/qgsattributetableview.h
===================================================================
--- trunk/qgis/src/app/attributetable/qgsattributetableview.h	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/attributetable/qgsattributetableview.h	2009-04-13 09:44:20 UTC (rev 10553)
@@ -1,5 +1,5 @@
 /***************************************************************************
-     BeataView.h
+     QgsAttributeTableView.h
      --------------------------------------
     Date                 : Feb 2009
     Copyright            : (C) 2009 Vita Cizek
@@ -13,22 +13,22 @@
  *                                                                         *
  ***************************************************************************/
 
-#ifndef BEATAVIEW_H_
-#define BEATAVIEW_H_
+#ifndef QGSATTRIBUTETABLEVIEW_H_
+#define QGSATTRIBUTETABLEVIEW_H_
 
 #include <QTableView>
 
 class QgsVectorLayer;
 
 
-class BeataView: public QTableView
+class QgsAttributeTableView: public QTableView
 {
 //private slots:
     //void setRows(int rows);
 
   public:
-    BeataView( QWidget* parent = NULL );
-    virtual ~BeataView();
+    QgsAttributeTableView( QWidget* parent = NULL );
+    virtual ~QgsAttributeTableView();
 
     void setLayer( QgsVectorLayer* layer );
 

Modified: trunk/qgis/src/app/legend/qgslegend.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegend.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/legend/qgslegend.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -38,7 +38,7 @@
 #include "qgsrasterlayerproperties.h"
 #include "qgsvectorlayerproperties.h"
 
-#include "BeataDialog.h"
+#include "qgsattributetabledialog.h"
 
 #include <cfloat>
 #include <iostream>
@@ -1860,7 +1860,7 @@
 
   if ( vlayer )
   {
-    BeataDialog *mDialog = new BeataDialog( vlayer );
+    QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( vlayer );
     mDialog->show();
     // the dialog will be deleted by itself on close
   }

Modified: trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -32,7 +32,7 @@
 #include "qgsgenericprojectionselector.h"
 
 // attribute table
-#include "BeataDialog.h"
+#include "qgsattributetabledialog.h"
 
 
 #include "qgsencodingfiledialog.h"
@@ -218,7 +218,7 @@
 void QgsLegendLayerFile::table()
 {
   QgsVectorLayer * myLayer = dynamic_cast<QgsVectorLayer *>( mLyr.layer() );
-  BeataDialog *mDialog = new BeataDialog( myLayer );
+  QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( myLayer );
   mDialog->show();
   // the dialog will be deleted by itself on close
 }

Modified: trunk/qgis/src/app/qgisapp.cpp
===================================================================
--- trunk/qgis/src/app/qgisapp.cpp	2009-04-13 09:41:48 UTC (rev 10552)
+++ trunk/qgis/src/app/qgisapp.cpp	2009-04-13 09:44:20 UTC (rev 10553)
@@ -132,7 +132,7 @@
 #include "qgsvectordataprovider.h"
 #include "qgsvectorlayer.h"
 #include "ogr/qgsopenvectorlayerdialog.h"
-#include "BeataDialog.h"
+#include "qgsattributetabledialog.h"
 //
 // Gdal/Ogr includes
 //
@@ -3886,7 +3886,7 @@
   }
 
   QgsVectorLayer * myLayer = dynamic_cast<QgsVectorLayer *>( mMapLegend->currentLayer() );
-  BeataDialog *mDialog = new BeataDialog( myLayer );
+  QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( myLayer );
   mDialog->show();
   // the dialog will be deleted by itself on close
 }



More information about the QGIS-commit mailing list