Skip to content
Permalink
Browse files

fix #6446

  • Loading branch information
brushtyler committed Oct 3, 2012
1 parent 99876cc commit 80d645dde56de7c5c74eada536a08a9a1223f28d
Showing with 51 additions and 24 deletions.
  1. +51 −24 src/app/qgsvectorlayerproperties.cpp
@@ -105,19 +105,30 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

connect( btnUseNewSymbology, SIGNAL( clicked() ), this, SLOT( useNewSymbology() ) );

QVBoxLayout *layout = new QVBoxLayout( labelingFrame );
layout->setMargin( 0 );
labelingDialog = new QgsLabelingGui( QgisApp::instance()->palLabeling(), layer, QgisApp::instance()->mapCanvas(), labelingFrame );
layout->addWidget( labelingDialog );
labelingFrame->setLayout( layout );

// Create the Label dialog tab
layout = new QVBoxLayout( labelOptionsFrame );
layout->setMargin( 0 );
labelDialog = new QgsLabelDialog( layer->label(), labelOptionsFrame );
layout->addWidget( labelDialog );
labelOptionsFrame->setLayout( layout );
connect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
QVBoxLayout *layout;

if ( layer->hasGeometryType() )
{
// Create the Labeling dialog tab
layout= new QVBoxLayout( labelingFrame );
layout->setMargin( 0 );
labelingDialog = new QgsLabelingGui( QgisApp::instance()->palLabeling(), layer, QgisApp::instance()->mapCanvas(), labelingFrame );
layout->addWidget( labelingDialog );
labelingFrame->setLayout( layout );

// Create the Labeling (deprecated) dialog tab
layout = new QVBoxLayout( labelOptionsFrame );
layout->setMargin( 0 );
labelDialog = new QgsLabelDialog( layer->label(), labelOptionsFrame );
layout->addWidget( labelDialog );
labelOptionsFrame->setLayout( layout );
connect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
}
else
{
tabWidget->setTabEnabled( 1, false ); // hide labeling item
tabWidget->setTabEnabled( 2, false ); // hide labeling (deprecated) item
}

// Create the Actions dialog tab
QVBoxLayout *actionLayout = new QVBoxLayout( actionOptionsFrame );
@@ -202,19 +213,35 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mLayerAbstractTextEdit->setPlainText( layer->abstract() );
}

tabWidget->setCurrentIndex( 0 );

QSettings settings;
restoreGeometry( settings.value( "/Windows/VectorLayerProperties/geometry" ).toByteArray() );
tabWidget->setCurrentIndex( settings.value( "/Windows/VectorLayerProperties/row" ).toInt() );
int tabIndex = settings.value( "/Windows/VectorLayerProperties/row", 0 ).toInt();

// if the last used tab is not enabled display the first enabled one
if ( !tabWidget->isTabEnabled( tabIndex ) )
{
tabIndex = 0;
for ( int i = 0; i < tabWidget->count(); i++ )
{
if ( tabWidget->isTabEnabled( i ) )
{
tabIndex = i;
break;
}
}
}
tabWidget->setCurrentIndex( tabIndex );

setWindowTitle( tr( "Layer Properties - %1" ).arg( layer->name() ) );
} // QgsVectorLayerProperties ctor


QgsVectorLayerProperties::~QgsVectorLayerProperties()
{
disconnect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
if ( layer->hasGeometryType() )
{
disconnect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );
}

QSettings settings;
settings.setValue( "/Windows/VectorLayerProperties/geometry", saveGeometry() );
@@ -615,9 +642,14 @@ void QgsVectorLayerProperties::reset( void )
layer->label()->setFields( layer->pendingFields() );

actionDialog->init();
labelDialog->init();

if ( layer->hasGeometryType() )
{
labelDialog->init();
}
labelCheckBox->setChecked( layer->hasLabelsEnabled() );
labelOptionsFrame->setEnabled( layer->hasLabelsEnabled() );

//set the transparency slider
sliderTransparency->setValue( 255 - layer->getTransparency() );
//update the transparency percentage label
@@ -1293,12 +1325,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
}
else
{
if ( tabWidget->currentIndex() == 0 )
{
tabWidget->setCurrentIndex( 1 );
}

tabWidget->setTabEnabled( 0, true ); // hide symbology item
tabWidget->setTabEnabled( 0, false ); // hide symbology item
}

if ( mRendererDialog )

0 comments on commit 80d645d

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