Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Made QgsVectorLayerProperties a modal dialog, use QTreeWidgetItem::se…
…lectedItems() instead of QTreeWidget::currentItem() to determine the current legend layer

git-svn-id: http://svn.osgeo.org/qgis/trunk@4827 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Feb 11, 2006
1 parent d530c48 commit 2bc184a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/legend/qgslegend.cpp
Expand Up @@ -472,11 +472,19 @@ void QgsLegend::addLayer( QgsMapLayer * layer )
{
setItemHidden(llfgroup, true);
}
setCurrentItem(llayer);
}

QgsMapLayer* QgsLegend::currentLayer()
{
QgsLegendItem* citem=dynamic_cast<QgsLegendItem*>(currentItem());
QList<QTreeWidgetItem*> selItems = selectedItems();
if(selItems.size() > 1)
{
return 0;
}
QList<QTreeWidgetItem*>::iterator it = selItems.begin();
QgsLegendItem* citem=dynamic_cast<QgsLegendItem*>(*it);

if(citem)
{
QgsLegendLayerFile* llf=dynamic_cast<QgsLegendLayerFile*>(citem);
Expand Down
3 changes: 3 additions & 0 deletions src/ui/qgsvectorlayerpropertiesbase.ui
Expand Up @@ -24,6 +24,9 @@
<property name="windowIcon" >
<iconset/>
</property>
<property name="modal" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
Expand Down

0 comments on commit 2bc184a

Please sign in to comment.