Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Sanity checks in add attribute dialog
- Loading branch information
Showing
with
12 additions
and
0 deletions.
-
+12
−0
src/app/qgsaddattrdialog.cpp
|
@@ -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(); |
|
|
} |
|
|
|
|
|