Skip to content

Commit

Permalink
Add select all button to the attribute table dialog
Browse files Browse the repository at this point in the history
As suggested by @nyalldawson in #2727.
  • Loading branch information
Patrick Valsecchi committed Feb 1, 2016
1 parent 8dafa63 commit f8a50b5
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -166,6 +166,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
updateTitle();

mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectAllButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectAll.png" ) );
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) );
Expand Down Expand Up @@ -626,6 +627,11 @@ void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
mLayer->removeSelection();
}

void QgsAttributeTableDialog::on_mSelectAllButton_clicked()
{
mLayer->selectAll();
}

void QgsAttributeTableDialog::on_mDeleteSelectedButton_clicked()
{
QgisApp::instance()->deleteSelected( mLayer, this );
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsattributetabledialog.h
Expand Up @@ -98,6 +98,10 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
* Clears selection
*/
void on_mRemoveSelectionButton_clicked();
/**
* Select all
*/
void on_mSelectAllButton_clicked();
/**
* Zooms to selected features
*/
Expand Down
27 changes: 27 additions & 0 deletions src/ui/qgsattributetabledialog.ui
Expand Up @@ -232,6 +232,32 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mSelectAllButton">
<property name="toolTip">
<string>Select all (Ctrl+A)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionSelectAll.png</normaloff>:/images/themes/default/mActionSelectAll.png</iconset>
</property>
<property name="iconSize">
<size>
<width>18</width>
<height>18</height>
</size>
</property>
<property name="shortcut">
<string>Ctrl+A</string>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mSelectedToTopButton">
<property name="toolTip">
Expand Down Expand Up @@ -814,6 +840,7 @@
</customwidgets>
<tabstops>
<tabstop>mRemoveSelectionButton</tabstop>
<tabstop>mSelectAllButton</tabstop>
<tabstop>mSelectedToTopButton</tabstop>
<tabstop>mInvertSelectionButton</tabstop>
<tabstop>mCopySelectedRowsButton</tabstop>
Expand Down

0 comments on commit f8a50b5

Please sign in to comment.