Skip to content
Permalink
Browse files

fix #2950

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14414 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Oct 19, 2010
1 parent fd0e3e3 commit e09db1dbdc92babf529e6880ad14ea05d6e0bd27
Showing with 31 additions and 22 deletions.
  1. +8 −5 src/app/qgsattributedialog.cpp
  2. +23 −17 src/app/qgsidentifyresults.cpp
@@ -303,11 +303,14 @@ int QgsAttributeDialog::exec()

void QgsAttributeDialog::show()
{
mDialog->setAttribute( Qt::WA_DeleteOnClose );
mDialog->show();
mDialog->raise();
mDialog->activateWindow();
mDialog->installEventFilter( this );
if ( mDialog )
{
mDialog->setAttribute( Qt::WA_DeleteOnClose );
mDialog->show();
mDialog->raise();
mDialog->activateWindow();
mDialog->installEventFilter( this );
}
}

void QgsAttributeDialog::saveGeometry()
@@ -214,27 +214,33 @@ void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer, int fid,
}
}

QTreeWidgetItem *actionItem = new QTreeWidgetItem( QStringList() << tr( "(Actions)" ) );
actionItem->setData( 0, Qt::UserRole, "actions" );
featItem->addChild( actionItem );
if ( vlayer->pendingFields().size() > 0 || vlayer->actions()->size() )
{
QTreeWidgetItem *actionItem = new QTreeWidgetItem( QStringList() << tr( "(Actions)" ) );
actionItem->setData( 0, Qt::UserRole, "actions" );
featItem->addChild( actionItem );

QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setData( 0, Qt::UserRole, "edit" );
actionItem->addChild( editItem );
if ( vlayer->pendingFields().size() > 0 )
{
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setData( 0, Qt::UserRole, "edit" );
actionItem->addChild( editItem );
}

for ( int i = 0; i < vlayer->actions()->size(); i++ )
{
const QgsAction &action = vlayer->actions()->at( i );
for ( int i = 0; i < vlayer->actions()->size(); i++ )
{
const QgsAction &action = vlayer->actions()->at( i );

if ( !action.runable() )
continue;
if ( !action.runable() )
continue;

QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
twi->setData( 0, Qt::UserRole, "action" );
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
actionItem->addChild( twi );
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
twi->setData( 0, Qt::UserRole, "action" );
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
actionItem->addChild( twi );
}
}

highlightFeature( featItem );

0 comments on commit e09db1d

Please sign in to comment.
You can’t perform that action at this time.