Skip to content

Commit

Permalink
Sanity checks in add attribute dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 24, 2014
1 parent 302b2ae commit c255823
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgsaddattrdialog.cpp
Expand Up @@ -113,6 +113,18 @@ void QgsAddAttrDialog::accept()
tr( "Invalid field name. This field name is reserved and cannot be used." ) );
return;
}
if ( mNameEdit->text().isEmpty() )
{
QMessageBox::warning( this, tr( "Warning" ),
tr( "No name specified. Please specify a name to create a new field." ) );
return;
}
if ( mButtonVirtualField->isChecked() && mExpressionWidget->currentField().isEmpty() )
{
QMessageBox::warning( this, tr( "Warning" ),
tr( "No expression specified. Please enter an expression that will be used to calculate the field values." ) );
return;
}
QDialog::accept();
}

Expand Down

0 comments on commit c255823

Please sign in to comment.