@@ -140,19 +140,16 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
140140 for ( ; it != overlayPluginList.constEnd (); ++it )
141141 {
142142 QgsApplyDialog* d = ( *it )->dialog ( lyr );
143- position = stackedWidget-> insertWidget ( stackedWidget ->count (), qobject_cast<QDialog*>( d ) );
144- stackedWidget ->setCurrentIndex ( position ); // ugly, but otherwise the properties dialog is a mess
143+ position = tabWidget-> insertTab ( tabWidget ->count (), qobject_cast<QDialog*>( d ), QgisApp::getThemeIcon ( " propertyicons/diagram.png " ), tr ( " Overlay " ) );
144+ tabWidget ->setCurrentIndex ( position ); // ugly, but otherwise the properties dialog is a mess
145145 mOverlayDialogs .push_back ( d );
146- // shamelessly hard coded - what will we do if other types of layer plugins exist? TS
147- QListWidgetItem * mypItem = new QListWidgetItem ( QgisApp::getThemeIcon ( " propertyicons/diagram.png" ), ( *it )->name () );
148- listWidget->insertItem ( stackedWidget->count () - 1 , mypItem );
149146 }
150147
151- stackedWidget ->setCurrentIndex ( 0 );
148+ tabWidget ->setCurrentIndex ( 0 );
152149
153150 QSettings settings;
154151 restoreGeometry ( settings.value ( " /Windows/VectorLayerProperties/geometry" ).toByteArray () );
155- listWidget-> setCurrentRow ( settings.value ( " /Windows/VectorLayerProperties/row" ).toInt () );
152+ tabWidget-> setCurrentIndex ( settings.value ( " /Windows/VectorLayerProperties/row" ).toInt () );
156153
157154 setWindowTitle ( tr ( " Layer Properties - %1" ).arg ( layer->name () ) );
158155} // QgsVectorLayerProperties ctor
@@ -211,7 +208,7 @@ QgsVectorLayerProperties::~QgsVectorLayerProperties()
211208
212209 QSettings settings;
213210 settings.setValue ( " /Windows/VectorLayerProperties/geometry" , saveGeometry () );
214- settings.setValue ( " /Windows/VectorLayerProperties/row" , listWidget-> currentRow () );
211+ settings.setValue ( " /Windows/VectorLayerProperties/row" , tabWidget-> currentIndex () );
215212}
216213
217214void QgsVectorLayerProperties::attributeTypeDialog ( )
@@ -1233,12 +1230,12 @@ void QgsVectorLayerProperties::updateSymbologyPage()
12331230 }
12341231 else
12351232 {
1236- if ( listWidget-> currentRow () == 0 )
1233+ if ( tabWidget-> currentIndex () == 0 )
12371234 {
1238- listWidget-> setCurrentRow ( 1 );
1235+ tabWidget-> setCurrentIndex ( 1 );
12391236 }
12401237
1241- listWidget-> setItemHidden ( listWidget-> item ( 0 ) , true ); // hide symbology item
1238+ tabWidget-> setTabEnabled ( 0 , true ); // hide symbology item
12421239 }
12431240
12441241 if ( mRendererDialog )
@@ -1248,7 +1245,7 @@ void QgsVectorLayerProperties::updateSymbologyPage()
12481245 }
12491246}
12501247
1251- void QgsVectorLayerProperties::on_stackedWidget_currentChanged ( int index )
1248+ void QgsVectorLayerProperties::on_tabWidget_currentChanged ( int index )
12521249{
12531250 if ( index != 4 || mMetadataFilled )
12541251 return ;
0 commit comments