Skip to content
Permalink
Browse files

Merge pull request #2649 from SebDieBln/StyleManager_ImportGroupName

[StyleManager] Respect entered groupname when importing symbols (fixes #14048)
  • Loading branch information
nyalldawson committed Jan 9, 2016
2 parents f3d1f8b + 7b2d03b commit 8d105ff8f998bdf3426088d648cd75220b0b469c
Showing with 4 additions and 31 deletions.
  1. +4 −31 src/gui/symbology-ng/qgsstylev2exportimportdialog.cpp
@@ -227,39 +227,12 @@ void QgsStyleV2ExportImportDialog::moveStyles( QModelIndexList* selection, QgsSt
// get the groupid when going for import
if ( mDialogMode == Import )
{
int index = groupCombo->currentIndex();
QString name = groupCombo->itemText( index );
// get the name the user entered
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 ) )
{

0 comments on commit 8d105ff

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