Skip to content

Commit

Permalink
Use icons on fields properties, disable "editable" where inappropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 24, 2014
1 parent 1395367 commit 1494069
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/qgsattributetypedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl , int fieldId
+ 2 );
selectionListWidget->setMaximumWidth( selectionListWidget->sizeHintForColumn( 0 )
+ 2 );

if ( vl->pendingFields().fieldOrigin( fieldIdx ) == QgsFields::OriginJoin ||
vl->pendingFields().fieldOrigin( fieldIdx ) == QgsFields::OriginExpression )
{
isFieldEditableCheckBox->setEnabled( false );
}

QSettings settings;
restoreGeometry( settings.value( "/Windows/QgsAttributeTypeDialog/geometry" ).toByteArray() );
}
Expand Down
14 changes: 14 additions & 0 deletions src/app/qgsfieldsproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,20 @@ void QgsFieldsProperties::setRow( int row, int idx, const QgsField& field )
dataItem->setData( Qt::DisplayRole, idx );
DesignerTreeItemData itemData( DesignerTreeItemData::Field, field.name() );
dataItem->setData( DesignerTreeRole, itemData.asQVariant() );
switch ( mLayer->pendingFields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
dataItem->setIcon( QgsApplication::getThemeIcon( "/mIconExpression.svg" ) );
break;

case QgsFields::OriginJoin:
dataItem->setIcon( QgsApplication::getThemeIcon( "/propertyicons/join.png" ) );
break;

default:
dataItem->setIcon( QgsApplication::getThemeIcon( "/propertyicons/attributes.png" ) );
break;
}
mFieldsList->setItem( row, attrIdCol, dataItem );
mIndexedWidgets.insert( idx, mFieldsList->item( row, 0 ) );
mFieldsList->setItem( row, attrNameCol, new QTableWidgetItem( field.name() ) );
Expand Down

0 comments on commit 1494069

Please sign in to comment.