Skip to content

Commit 87ca653

Browse files
NathanW2dakcarto
authored andcommittedMay 29, 2013
Fix #7134
1 parent e0406e7 commit 87ca653

File tree

7 files changed

+219
-209
lines changed

7 files changed

+219
-209
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8758,7 +8758,7 @@ void QgisApp::showLayerProperties( QgsMapLayer *ml )
87588758
QgsVectorLayerProperties *vlp = NULL; // See note above about reusing this
87598759
if ( vlp )
87608760
{
8761-
vlp->reset();
8761+
vlp->syncToLayer();
87628762
}
87638763
else
87648764
{

‎src/app/qgslabelinggui.cpp

Lines changed: 204 additions & 193 deletions
Large diffs are not rendered by default.

‎src/app/qgslabelinggui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
4040
void writeSettingsToLayer();
4141

4242
public slots:
43+
void init();
4344
void collapseSample( bool collapse );
4445
void apply();
4546
void changeTextColor( const QColor &color );

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
171171
connect( mFieldsPropertiesDialog, SIGNAL( toggleEditing() ), this, SLOT( toggleEditing() ) );
172172
connect( this, SIGNAL( toggleEditing( QgsMapLayer* ) ), QgisApp::instance(), SLOT( toggleEditing( QgsMapLayer* ) ) );
173173

174-
reset();
174+
syncToLayer();
175175

176176
if ( layer->dataProvider() )//enable spatial index button group if supported by provider
177177
{
@@ -337,7 +337,7 @@ void QgsVectorLayerProperties::setDisplayField( QString name )
337337
}
338338

339339
//! @note in raster props, this method is called sync()
340-
void QgsVectorLayerProperties::reset( void )
340+
void QgsVectorLayerProperties::syncToLayer( void )
341341
{
342342
// populate the general information
343343
mLayerOrigNameLineEdit->setText( layer->originalName() );
@@ -393,6 +393,7 @@ void QgsVectorLayerProperties::reset( void )
393393
layer->label()->setFields( layer->pendingFields() );
394394

395395
actionDialog->init();
396+
labelingDialog->init();
396397

397398
if ( layer->hasGeometryType() )
398399
{
@@ -605,7 +606,7 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
605606
}
606607
else
607608
{
608-
reset();
609+
syncToLayer();
609610
}
610611

611612
return;
@@ -621,7 +622,7 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
621622
if ( defaultLoadedFlag )
622623
{
623624
// all worked ok so no need to inform user
624-
reset();
625+
syncToLayer();
625626
}
626627
else
627628
{
@@ -696,7 +697,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
696697
//reset if the default style was loaded ok only
697698
if ( defaultLoadedFlag )
698699
{
699-
reset();
700+
syncToLayer();
700701
}
701702
else
702703
{
@@ -813,7 +814,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
813814
//reset if the default style was loaded ok only
814815
if ( defaultLoadedFlag )
815816
{
816-
reset();
817+
syncToLayer();
817818
}
818819
else
819820
{
@@ -875,7 +876,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
875876
}
876877
if ( layer->applyNamedStyle( qmlStyle, errorMsg ) )
877878
{
878-
reset();
879+
syncToLayer();
879880
}
880881
else
881882
{

‎src/app/qgsvectorlayerproperties.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVec
8181
void insertExpression();
8282

8383
/** Reset to original (vector layer) values */
84-
void reset();
84+
void syncToLayer();
8585

8686
/** Get metadata about the layer in nice formatted html */
8787
QString metadata();

‎src/core/qgsmaplayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
942942
return saveNamedStyle( styleURI(), theResultFlag );
943943
}
944944

945-
QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag )
945+
QString QgsMapLayer:: saveNamedStyle( const QString theURI, bool & theResultFlag )
946946
{
947947
QString myErrorMessage;
948948
QDomDocument myDocument;

‎src/core/qgsvectorlayer.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,16 +3914,13 @@ QString QgsVectorLayer::loadNamedStyle( const QString theURI, bool &theResultFla
39143914
if ( !qml.isEmpty() )
39153915
{
39163916
theResultFlag = this->applyNamedStyle( qml, errorMsg );
3917+
return QObject::tr( "Loaded from Provider" );
39173918
}
39183919
}
39193920
}
3920-
3921-
}
3922-
if ( !theResultFlag )
3923-
{
3924-
return QgsMapLayer::loadNamedStyle( theURI, theResultFlag );
39253921
}
3926-
return QObject::tr( "Loaded from Provider" );
3922+
3923+
return QgsMapLayer::loadNamedStyle( theURI, theResultFlag );
39273924
}
39283925

39293926
bool QgsVectorLayer::applyNamedStyle( QString namedStyle, QString errorMsg )

0 commit comments

Comments
 (0)