also add Pan to Selected button to the attribute table dialog

This commit is contained in:
Alexander Bruy 2012-01-25 11:44:31 +02:00
parent dd5f934b67
commit 318a827b22
3 changed files with 36 additions and 0 deletions

View File

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

View File

@ -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
*/

View File

@ -229,6 +229,32 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mPanMapToSelectedRowsButton">
<property name="toolTip">
<string>Zoom map to the selected rows (Ctrl+J)</string>
</property>
<property name="whatsThis">
<string/>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normaloff>../../images/themes/default/mActionPanToSelected.png</normaloff>../../images/themes/default/mActionPanToSelected.png</iconset>
</property>
<property name="iconSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="shortcut">
<string>Ctrl+J</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mToggleEditingButton">
<property name="toolTip">