Skip to content

Commit

Permalink
Renaming of Beata* classes to QgsAttributeTable* classes done.
Browse files Browse the repository at this point in the history
Happy easter ;-)


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10553 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Apr 13, 2009
1 parent 32e61b7 commit 6a8386e
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 138 deletions.
69 changes: 34 additions & 35 deletions src/app/attributetable/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/***************************************************************************
BeataDialog.cpp
BEtter Attribute TAble
QgsAttributeTableDialog.cpp
-------------------
date : Feb 2009
copyright : Vita Cizek
Expand All @@ -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>
Expand All @@ -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
Expand All @@ -48,7 +47,7 @@ class QBeataTableDock : public QDockWidget
};


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;
Expand All @@ -61,8 +60,8 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
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;
Expand All @@ -72,7 +71,7 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
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 );
Expand Down Expand Up @@ -111,11 +110,11 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
updateSelectionFromLayer();
}

BeataDialog::~BeataDialog()
QgsAttributeTableDialog::~QgsAttributeTableDialog()
{
}

void BeataDialog::closeEvent( QCloseEvent* event )
void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
{
QDialog::closeEvent( event );

Expand All @@ -127,7 +126,7 @@ void BeataDialog::closeEvent( QCloseEvent* event )
}


QIcon BeataDialog::getThemeIcon( const QString theName )
QIcon QgsAttributeTableDialog::getThemeIcon( const QString theName )
{
// copied from QgisApp::getThemeIcon. To be removed when merged to SVN

Expand All @@ -149,12 +148,12 @@ QIcon BeataDialog::getThemeIcon( const QString theName )
}
}

void BeataDialog::showAdvanced()
void QgsAttributeTableDialog::showAdvanced()
{
mMenuActions->exec( QCursor::pos() );
}

void BeataDialog::on_mSelectedToTopButton_clicked()
void QgsAttributeTableDialog::on_mSelectedToTopButton_clicked()
{
int freeIndex = 0;

Expand Down Expand Up @@ -194,35 +193,35 @@ void BeataDialog::on_mSelectedToTopButton_clicked()
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();
//TODO: weird
//mModel->changeLayout();
}

void BeataDialog::columnBoxInit()
void QgsAttributeTableDialog::columnBoxInit()
{
QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
QgsFieldMap::Iterator it = fieldMap.begin();
Expand All @@ -231,7 +230,7 @@ void BeataDialog::columnBoxInit()
mColumnBox->addItem( it.value().name() );
}

int BeataDialog::columnBoxColumnId()
int QgsAttributeTableDialog::columnBoxColumnId()
{
QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
QgsFieldMap::Iterator it = fieldMap.begin();
Expand All @@ -243,7 +242,7 @@ int BeataDialog::columnBoxColumnId()
return 0;
}

void BeataDialog::updateSelection()
void QgsAttributeTableDialog::updateSelection()
{
QModelIndex index;
mView->setSelectionMode( QAbstractItemView::MultiSelection );
Expand Down Expand Up @@ -272,7 +271,7 @@ void BeataDialog::updateSelection()
*/
}

void BeataDialog::updateRowSelection( int index )
void QgsAttributeTableDialog::updateRowSelection( int index )
{
// map index to filter model
//index = mFilterModel->mapFromSource(mModel->index(index, 0)).row();
Expand Down Expand Up @@ -326,7 +325,7 @@ void BeataDialog::updateRowSelection( int index )
}

// 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() ) );

Expand Down Expand Up @@ -398,14 +397,14 @@ void BeataDialog::updateRowSelection( int first, int last, bool startNewSelectio
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;
Expand Down Expand Up @@ -462,7 +461,7 @@ void BeataDialog::doSearch( QString searchString )
QMessageBox::information( this, tr( "Search results" ), str );
}

void BeataDialog::search()
void QgsAttributeTableDialog::search()
{

QString str = mColumnBox->currentText();
Expand All @@ -483,7 +482,7 @@ void BeataDialog::search()
doSearch( str );
}

void BeataDialog::on_mAdvancedSearchButton_clicked()
void QgsAttributeTableDialog::on_mAdvancedSearchButton_clicked()
{
QgsSearchQueryBuilder dlg( mLayer, this );
dlg.setSearchString( mQuery->displayText() );
Expand All @@ -492,12 +491,12 @@ void BeataDialog::on_mAdvancedSearchButton_clicked()
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() );

Expand All @@ -509,19 +508,19 @@ void BeataDialog::editingToggled()
}

// 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();
Expand Down
25 changes: 12 additions & 13 deletions src/app/attributetable/qgsattributetabledialog.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/***************************************************************************
BeataDialog.h
BEtter Attribute TAble
QgsAttributeTableDialog.h - dialog for attribute table
-------------------
date : Feb 2009
copyright : Vita Cizek
Expand All @@ -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;
Expand All @@ -37,17 +36,17 @@ class QComboBox;
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();
Expand Down Expand Up @@ -93,8 +92,8 @@ class BeataDialog : public QDialog, private Ui::BeataDialogGui
QMenu* mMenuActions;
QAction* mActionToggleEditing;

BeataModel *mModel;
BeataFilterModel *mFilterModel;
QgsAttributeTableModel *mModel;
QgsAttributeTableFilterModel *mFilterModel;
QgsVectorLayer *mLayer;
QgsFeatureIds mSelectedFeatures;

Expand Down
Loading

0 comments on commit 6a8386e

Please sign in to comment.