Skip to content

Commit

Permalink
also add Pan to Selected button to the attribute table dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jan 25, 2012
1 parent dd5f934 commit 318a827
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ) );
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsattributetabledialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
26 changes: 26 additions & 0 deletions src/ui/qgsattributetabledialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down

0 comments on commit 318a827

Please sign in to comment.