Skip to content

Commit

Permalink
identify: fix form button icon & tooltip, remove close button
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Apr 25, 2014
1 parent ea98608 commit 7203cff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
14 changes: 10 additions & 4 deletions src/app/qgsidentifyresultsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void QgsIdentifyResultsDialog::addFeature( QgsVectorLayer *vlayer, const QgsFeat
if ( vlayer->pendingFields().size() > 0 )
{
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setIcon( 0, QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) );
editItem->setData( 0, Qt::UserRole, "edit" );
actionItem->addChild( editItem );
}
Expand Down Expand Up @@ -634,8 +634,8 @@ void QgsIdentifyResultsDialog::editingToggled()
continue;

QTreeWidgetItem *editItem = actions->child( j );
editItem->setIcon( 0, QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
editItem->setText( 1, vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
mOpenFormButton->setToolTip( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
editItem->setText( 1, mOpenFormButton->toolTip() );
}
}

Expand Down Expand Up @@ -758,7 +758,7 @@ void QgsIdentifyResultsDialog::contextMenuEvent( QContextMenuEvent* event )
if ( vlayer )
{
mActionPopup->addAction(
QgsApplication::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ),
QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ),
vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ),
this, SLOT( featureForm() ) );
}
Expand Down Expand Up @@ -1099,6 +1099,12 @@ void QgsIdentifyResultsDialog::handleCurrentItemChanged( QTreeWidgetItem *curren
mCopyToolButton->setEnabled( featItem && featItem->feature().isValid() );
mOpenFormButton->setEnabled( featItem && featItem->feature().isValid() );

QgsVectorLayer *vlayer = vectorLayer( current );
if( vlayer )
{
mOpenFormButton->setToolTip( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) );
}

if ( !current )
{
emit selectedFeatureChanged( 0, 0 );
Expand Down
9 changes: 1 addition & 8 deletions src/ui/qgsidentifyresultsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,9 @@
</item>
<item>
<widget class="QToolButton" name="mOpenFormButton">
<property name="toolTip">
<string>Expand tree.</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/mActionToggleEditing.png</normaloff>:/images/themes/default/mActionToggleEditing.png</iconset>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -189,7 +182,7 @@
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
<set>QDialogButtonBox::Help</set>
</property>
<property name="centerButtons">
<bool>false</bool>
Expand Down

0 comments on commit 7203cff

Please sign in to comment.