Navigation Menu

Skip to content

Commit

Permalink
Fix for ticket #402 (add a zoom to selected button to the attribute
Browse files Browse the repository at this point in the history
table).


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@7654 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Nov 24, 2007
1 parent 459284e commit df22ca4
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 99 deletions.
7 changes: 7 additions & 0 deletions src/app/qgsattributetabledisplay.cpp
Expand Up @@ -49,6 +49,7 @@ QgsAttributeTableDisplay::QgsAttributeTableDisplay(QgsVectorLayer* layer, QgisAp
connect(mSelectedToTopButton, SIGNAL(clicked()), this, SLOT(selectedToTop()));
connect(mInvertSelectionButton, SIGNAL(clicked()), this, SLOT(invertSelection()));
connect(mCopySelectedRowsButton, SIGNAL(clicked()), this, SLOT(copySelectedRowsToClipboard()));
connect(mZoomMapToSelectedRowsButton, SIGNAL(clicked()), this, SLOT(zoomMapToSelectedRows()));
connect(mAddAttributeButton, SIGNAL(clicked()), this, SLOT(addAttribute()));
connect(mDeleteAttributeButton, SIGNAL(clicked()), this, SLOT(deleteAttributes()));
connect(btnStartEditing, SIGNAL(clicked()), this, SLOT(startEditing()));
Expand Down Expand Up @@ -108,6 +109,7 @@ void QgsAttributeTableDisplay::setTheme()
mSelectedToTopButton->setPixmap(QPixmap(myIconPath+"/mActionSelectedToTop.png"));
mInvertSelectionButton->setPixmap(QPixmap(myIconPath+"/mActionInvertSelection.png"));
mCopySelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionCopySelected.png"));
mZoomMapToSelectedRowsButton->setPixmap(QPixmap(myIconPath+"/mActionZoomToSelected.png"));
mAddAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionNewAttribute.png"));
mDeleteAttributeButton->setPixmap(QPixmap(myIconPath+"/mActionDeleteAttribute.png"));
}
Expand Down Expand Up @@ -243,6 +245,11 @@ void QgsAttributeTableDisplay::copySelectedRowsToClipboard()
mQgisApp->editCopy(mLayer);
}

void QgsAttributeTableDisplay::zoomMapToSelectedRows()
{
mQgisApp->zoomToSelected();
}

void QgsAttributeTableDisplay::search()
{
// if selected field is numeric, numeric comparison will be used
Expand Down
1 change: 1 addition & 0 deletions src/app/qgsattributetabledisplay.h
Expand Up @@ -67,6 +67,7 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
void invertSelection();
void removeSelection();
void copySelectedRowsToClipboard();
void zoomMapToSelectedRows();
void search();
void advancedSearch();
void searchShowResultsChanged(int item);
Expand Down
222 changes: 123 additions & 99 deletions src/ui/qgsattributetablebase.ui
Expand Up @@ -22,103 +22,6 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnHelp" >
<property name="text" >
<string>&amp;Help</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Search for:</string>
</property>
<property name="buddy" >
<cstring>mSearchText</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mSearchText" />
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>in</string>
</property>
<property name="buddy" >
<cstring>mSearchColumns</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchColumns" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mSearchButton" >
<property name="text" >
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchShowResults" />
</item>
<item>
<widget class="QPushButton" name="btnAdvancedSearch" >
<property name="text" >
<string>Adva&amp;nced...</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnClose" >
<property name="text" >
<string>&amp;Close</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
Expand Down Expand Up @@ -194,8 +97,32 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mZoomMapToSelectedRowsButton" >
<property name="toolTip" >
<string>Zoom map to the selected rows (Ctrl-F)</string>
</property>
<property name="whatsThis" >
<string>Zoom map to the selected rows</string>
</property>
<property name="text" >
<string/>
</property>
<property name="shortcut" >
<string>Ctrl+F</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="mAddAttributeButton" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip" >
<string>New column</string>
</property>
Expand Down Expand Up @@ -236,8 +163,8 @@
</property>
<property name="sizeHint" >
<size>
<width>210</width>
<height>20</height>
<width>271</width>
<height>25</height>
</size>
</property>
</spacer>
Expand All @@ -261,6 +188,103 @@
</item>
</layout>
</item>
<item row="1" column="0" >
<widget class="QgsAttributeTable" native="1" name="tblAttributes" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="2" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="btnHelp" >
<property name="text" >
<string>&amp;Help</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel1" >
<property name="text" >
<string>Search for:</string>
</property>
<property name="buddy" >
<cstring>mSearchText</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mSearchText" />
</item>
<item>
<widget class="QLabel" name="textLabel2" >
<property name="text" >
<string>in</string>
</property>
<property name="buddy" >
<cstring>mSearchColumns</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchColumns" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mSearchButton" >
<property name="text" >
<string>Search</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSearchShowResults" />
</item>
<item>
<widget class="QPushButton" name="btnAdvancedSearch" >
<property name="text" >
<string>Adva&amp;nced...</string>
</property>
<property name="shortcut" >
<string>Alt+N</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnClose" >
<property name="text" >
<string>&amp;Close</string>
</property>
<property name="shortcut" >
<string>Alt+C</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11" />
Expand Down

0 comments on commit df22ca4

Please sign in to comment.