Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Cleanups for vector layer properties
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14622 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Nov 13, 2010
1 parent a2b198a commit 212eab1
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 257 deletions.
21 changes: 9 additions & 12 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -140,19 +140,16 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
for ( ; it != overlayPluginList.constEnd(); ++it )
{
QgsApplyDialog* d = ( *it )->dialog( lyr );
position = stackedWidget->insertWidget( stackedWidget->count(), qobject_cast<QDialog*>( d ) );
stackedWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess
position = tabWidget->insertTab( tabWidget->count(), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon( "propertyicons/diagram.png" ), tr( "Overlay"));
tabWidget->setCurrentIndex( position ); //ugly, but otherwise the properties dialog is a mess
mOverlayDialogs.push_back( d );
//shamelessly hard coded - what will we do if other types of layer plugins exist? TS
QListWidgetItem * mypItem = new QListWidgetItem( QgisApp::getThemeIcon( "propertyicons/diagram.png" ), ( *it )->name() );
listWidget->insertItem( stackedWidget->count() - 1, mypItem );
}

stackedWidget->setCurrentIndex( 0 );
tabWidget->setCurrentIndex( 0 );

QSettings settings;
restoreGeometry( settings.value( "/Windows/VectorLayerProperties/geometry" ).toByteArray() );
listWidget->setCurrentRow( settings.value( "/Windows/VectorLayerProperties/row" ).toInt() );
tabWidget->setCurrentIndex( settings.value( "/Windows/VectorLayerProperties/row" ).toInt() );

setWindowTitle( tr( "Layer Properties - %1" ).arg( layer->name() ) );
} // QgsVectorLayerProperties ctor
Expand Down Expand Up @@ -211,7 +208,7 @@ QgsVectorLayerProperties::~QgsVectorLayerProperties()

QSettings settings;
settings.setValue( "/Windows/VectorLayerProperties/geometry", saveGeometry() );
settings.setValue( "/Windows/VectorLayerProperties/row", listWidget->currentRow() );
settings.setValue( "/Windows/VectorLayerProperties/row", tabWidget->currentIndex() );
}

void QgsVectorLayerProperties::attributeTypeDialog( )
Expand Down Expand Up @@ -1233,12 +1230,12 @@ void QgsVectorLayerProperties::updateSymbologyPage()
}
else
{
if ( listWidget->currentRow() == 0 )
if ( tabWidget->currentIndex() == 0 )
{
listWidget->setCurrentRow( 1 );
tabWidget->setCurrentIndex( 1 );
}

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

if ( mRendererDialog )
Expand All @@ -1248,7 +1245,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
}
}

void QgsVectorLayerProperties::on_stackedWidget_currentChanged( int index )
void QgsVectorLayerProperties::on_tabWidget_currentChanged( int index )
{
if ( index != 4 || mMetadataFilled )
return;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.h
Expand Up @@ -104,7 +104,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
void on_tblAttributes_cellChanged( int row, int column );
void on_mCalculateFieldButton_clicked();
void on_pbnSelectEditForm_clicked();
void on_stackedWidget_currentChanged( int idx );
void on_tabWidget_currentChanged( int idx );
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }

void addAttribute();
Expand Down

0 comments on commit 212eab1

Please sign in to comment.