From 318a827b2212a6c9b3cb36df53109098aad77f5f Mon Sep 17 00:00:00 2001 From: Alexander Bruy Date: Wed, 25 Jan 2012 11:44:31 +0200 Subject: [PATCH] also add Pan to Selected button to the attribute table dialog --- src/app/qgsattributetabledialog.cpp | 6 ++++++ src/app/qgsattributetabledialog.h | 4 ++++ src/ui/qgsattributetabledialog.ui | 26 ++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/src/app/qgsattributetabledialog.cpp b/src/app/qgsattributetabledialog.cpp index c8c2fc7bd41..253ebf053af 100644 --- a/src/app/qgsattributetabledialog.cpp +++ b/src/app/qgsattributetabledialog.cpp @@ -90,6 +90,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid mSelectedToTopButton->setIcon( QgisApp::getThemeIcon( "/mActionSelectedToTop.png" ) ); mCopySelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionCopySelected.png" ) ); mZoomMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionZoomToSelected.png" ) ); + mPanMapToSelectedRowsButton->setIcon( QgisApp::getThemeIcon( "/mActionPanToSelected.png" ) ); mInvertSelectionButton->setIcon( QgisApp::getThemeIcon( "/mActionInvertSelection.png" ) ); mToggleEditingButton->setIcon( QgisApp::getThemeIcon( "/mActionToggleEditing.png" ) ); mSaveEditsButton->setIcon( QgisApp::getThemeIcon( "/mActionSaveEdits.png" ) ); @@ -228,6 +229,11 @@ void QgsAttributeTableDialog::on_mZoomMapToSelectedRowsButton_clicked() QgisApp::instance()->mapCanvas()->zoomToSelected( mLayer ); } +void QgsAttributeTableDialog::on_mPanMapToSelectedRowsButton_clicked() +{ + QgisApp::instance()->mapCanvas()->panToSelected( mLayer ); +} + void QgsAttributeTableDialog::on_mInvertSelectionButton_clicked() { mLayer->invertSelection(); diff --git a/src/app/qgsattributetabledialog.h b/src/app/qgsattributetabledialog.h index fd46bc5104e..ad042ead37d 100644 --- a/src/app/qgsattributetabledialog.h +++ b/src/app/qgsattributetabledialog.h @@ -136,6 +136,10 @@ class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDia * Zooms to selected features */ void on_mZoomMapToSelectedRowsButton_clicked(); + /** + * Pans to selected features + */ + void on_mPanMapToSelectedRowsButton_clicked(); /** * Moves selected lines to the top */ diff --git a/src/ui/qgsattributetabledialog.ui b/src/ui/qgsattributetabledialog.ui index 8b230b96dc1..9c63154133e 100644 --- a/src/ui/qgsattributetabledialog.ui +++ b/src/ui/qgsattributetabledialog.ui @@ -229,6 +229,32 @@ + + + + Zoom map to the selected rows (Ctrl+J) + + + + + + + + + + ../../images/themes/default/mActionPanToSelected.png../../images/themes/default/mActionPanToSelected.png + + + + 18 + 18 + + + + Ctrl+J + + +