Skip to content
Permalink
Browse files

Cleanups for vector layer properties

git-svn-id: http://svn.osgeo.org/qgis/trunk@14622 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux
timlinux committed Nov 13, 2010
1 parent 9a91aa4 commit 72a5bfcc0680325176252b001ea0d21557b4d2aa
Showing with 101 additions and 257 deletions.
  1. +9 −12 src/app/qgsvectorlayerproperties.cpp
  2. +1 −1 src/app/qgsvectorlayerproperties.h
  3. +91 −244 src/ui/qgsvectorlayerpropertiesbase.ui
@@ -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
@@ -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( )
@@ -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 )
@@ -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;
@@ -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();

0 comments on commit 72a5bfc

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