Skip to content
Permalink
Browse files

remove null information message bar

  • Loading branch information
pblottiere committed May 29, 2016
1 parent 8449e42 commit 36d7dc4ef01384a8ec7b11f03a51750ad0f7f7af
Showing with 0 additions and 28 deletions.
  1. +0 −26 src/gui/qgsattributeform.cpp
  2. +0 −2 src/gui/qgsattributeform.h
@@ -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 )
@@ -83,7 +82,6 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
connect( vl, SIGNAL( selectionChanged() ), this, SLOT( layerSelectionChanged() ) );

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

@@ -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 )
@@ -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;

0 comments on commit 36d7dc4

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