Skip to content

Commit

Permalink
fix opening sublayers in a group
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and m-kuhn committed Aug 18, 2017
1 parent 475998e commit f0d3677
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/gui/qgssublayersdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,9 @@ QgsSublayersDialog::QgsSublayersDialog( ProviderType providerType, const QString
restoreGeometry( settings.value( "/Windows/" + mName + "SubLayers/geometry" ).toByteArray() );

// Checkbox about adding sublayers to a group
if ( mShowAddToGroupCheckbox )
{
mCheckboxAddToGroup = new QCheckBox( tr( "Add layers to a group" ) );
bool addToGroup = settings.value( QStringLiteral( "/qgis/openSublayersInGroup" ), false ).toBool();
mCheckboxAddToGroup->setChecked( addToGroup );
buttonBox->addButton( mCheckboxAddToGroup, QDialogButtonBox::ActionRole );
}
mCheckboxAddToGroup = new QCheckBox( tr( "Add layers to a group" ), this );
buttonBox->addButton( mCheckboxAddToGroup, QDialogButtonBox::ActionRole );
mCheckboxAddToGroup->setVisible( false );
}

QgsSublayersDialog::~QgsSublayersDialog()
Expand Down Expand Up @@ -201,11 +197,20 @@ int QgsSublayersDialog::exec()
cursor = QCursor( * QApplication::overrideCursor() );
QApplication::restoreOverrideCursor();
}

// Checkbox about adding sublayers to a group
if ( mShowAddToGroupCheckbox )
{
mCheckboxAddToGroup->setVisible( true );
bool addToGroup = settings.value( QStringLiteral( "/qgis/openSublayersInGroup" ), false ).toBool();
mCheckboxAddToGroup->setChecked( addToGroup );
}

int ret = QDialog::exec();
if ( overrideCursor )
QApplication::setOverrideCursor( cursor );

if ( mCheckboxAddToGroup )
if ( mShowAddToGroupCheckbox )
settings.setValue( QStringLiteral( "/qgis/openSublayersInGroup" ), mCheckboxAddToGroup->isChecked() );
return ret;
}
}

0 comments on commit f0d3677

Please sign in to comment.