Skip to content

Commit

Permalink
remove null information message bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed May 31, 2016
1 parent 8449e42 commit 36d7dc4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
26 changes: 0 additions & 26 deletions src/gui/qgsattributeform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ int QgsAttributeForm::sFormCounter = 0;
QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &feature, const QgsAttributeEditorContext &context, QWidget* parent )
: QWidget( parent )
, mInvalidConstraintMessageBarItem( nullptr )
, mFieldNotInitializedMessageBarItem( nullptr )
, mLayer( vl )
, mMessageBar( nullptr )
, mMultiEditUnsavedMessageBarItem( nullptr )
Expand Down Expand Up @@ -83,7 +82,6 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );

// constraints management
displayNullFieldsMessage();
updateAllConstaints();
}

Expand Down Expand Up @@ -762,30 +760,6 @@ bool QgsAttributeForm::currentFormFeature( QgsFeature &feature )
return rc;
}

void QgsAttributeForm::displayNullFieldsMessage()
{
QStringList notInitializedFields;
Q_FOREACH ( QgsWidgetWrapper* ww, mWidgets )
{
QgsEditorWidgetWrapper* eww = qobject_cast<QgsEditorWidgetWrapper*>( ww );
if ( eww )
{
if ( mFeature.attribute( eww->fieldIdx() ).isNull() )
notInitializedFields.append( eww->field().name() );
}
}

if ( ! notInitializedFields.isEmpty() )
{
mFieldNotInitializedMessageBarItem =
new QgsMessageBarItem( tr( "Some fields are NULL: " ),
notInitializedFields.join( ", " ),
QgsMessageBar::INFO );
mMessageBar->pushItem( mFieldNotInitializedMessageBarItem );
}

}

void QgsAttributeForm::clearInvalidConstraintsMessage()
{
if ( mInvalidConstraintMessageBarItem != nullptr )
Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsattributeform.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
void clearInvalidConstraintsMessage();
void displayInvalidConstraintMessage( const QStringList &invalidFields,
const QStringList &description );
void displayNullFieldsMessage();
QgsMessageBarItem *mInvalidConstraintMessageBarItem;
QgsMessageBarItem *mFieldNotInitializedMessageBarItem;

QgsVectorLayer* mLayer;
QgsFeature mFeature;
Expand Down

0 comments on commit 36d7dc4

Please sign in to comment.