Skip to content
Permalink
Browse files

fix opening sublayers in a group

  • Loading branch information
Gustry authored and m-kuhn committed Aug 18, 2017
1 parent 475998e commit f0d36778659e274d063ee77fba774293cadd0ee9
Showing with 14 additions and 9 deletions.
  1. +14 −9 src/gui/qgssublayersdialog.cpp
@@ -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()
@@ -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.
You can’t perform that action at this time.