Skip to content

Commit

Permalink
[FEATURE] open layer properties from identify results
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Oct 6, 2012
1 parent 9da9d6b commit 06d91a5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/app/qgsidentifyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,11 @@ void QgsIdentifyResults::contextMenuEvent( QContextMenuEvent* event )
mActionPopup->addAction( tr( "Clear highlights" ), this, SLOT( clearHighlights() ) );
mActionPopup->addAction( tr( "Highlight all" ), this, SLOT( highlightAll() ) );
mActionPopup->addAction( tr( "Highlight layer" ), this, SLOT( highlightLayer() ) );
mActionPopup->addAction( tr( "Layer properties..." ), this, SLOT( layerProperties() ) );
mActionPopup->addSeparator();
mActionPopup->addAction( tr( "Expand all" ), this, SLOT( expandAll() ) );
mActionPopup->addAction( tr( "Collapse all" ), this, SLOT( collapseAll() ) );
mActionPopup->addSeparator();

if ( featItem && vlayer->actions()->size() > 0 )
{
Expand Down Expand Up @@ -938,6 +940,19 @@ void QgsIdentifyResults::highlightLayer( QTreeWidgetItem *item )
}
}

void QgsIdentifyResults::layerProperties()
{
layerProperties( lstResults->currentItem() );
}

void QgsIdentifyResults::layerProperties( QTreeWidgetItem *item )
{
QgsVectorLayer *vlayer = vectorLayer( item );
if( !vlayer )
return;

QgisApp::instance()->showLayerProperties( vlayer );
}

void QgsIdentifyResults::expandAll()
{
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsidentifyresults.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
void copyFeatureAttributes();
void highlightAll();
void highlightLayer();
void layerProperties();
void clearHighlights();
void expandAll();
void collapseAll();
Expand Down Expand Up @@ -126,6 +127,7 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
QTreeWidgetItem *layerItem( QObject *layer );

void highlightLayer( QTreeWidgetItem *object );
void layerProperties( QTreeWidgetItem *object );
void disconnectLayer( QObject *object );

void setColumnText( int column, const QString & label );
Expand Down

0 comments on commit 06d91a5

Please sign in to comment.