Skip to content

Commit

Permalink
[StyleManager] import to "ungrouped" when no groupname entered
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDieBln committed Jan 7, 2016
1 parent 284704a commit 7b2d03b
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp
Expand Up @@ -231,35 +231,8 @@ void QgsStyleV2ExportImportDialog::moveStyles( QModelIndexList* selection, QgsSt
QString name = groupCombo->currentText();
if ( name.isEmpty() )
{
// get name of the group
bool nameInvalid = true;
while ( nameInvalid )
{
bool ok;
name = QInputDialog::getText( this, tr( "Group Name" ),
tr( "Please enter a name for new group:" ),
QLineEdit::Normal,
tr( "imported" ),
&ok );
if ( !ok )
{
QMessageBox::warning( this, tr( "New Group" ),
tr( "New group cannot be created without a name. Kindly enter a name." ) );
continue;
}
// validate name
if ( name.isEmpty() )
{
QMessageBox::warning( this, tr( "New group" ),
tr( "Cannot create a group without name. Enter a name." ) );
}
else
{
// valid name
nameInvalid = false;
}
}
groupid = dst->addGroup( name );
// import to "ungrouped"
groupid = 0;
}
else if ( dst->groupNames().contains( name ) )
{
Expand Down

0 comments on commit 7b2d03b

Please sign in to comment.