Skip to content

Commit

Permalink
fix #2950
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14414 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 19, 2010
1 parent fd0e3e3 commit e09db1d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
13 changes: 8 additions & 5 deletions src/app/qgsattributedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
40 changes: 23 additions & 17 deletions src/app/qgsidentifyresults.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit e09db1d

Please sign in to comment.