Skip to content

Commit

Permalink
Set Style tab as default on first opening of raster properties
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Apr 13, 2013
1 parent 602f09d commit 2f94d65
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
.arg( pyramidSentence2 ).arg( pyramidSentence3 )
.arg( pyramidSentence4 ).arg( pyramidSentence5 ) );

QSettings settings;
restoreGeometry( settings.value( "/Windows/RasterLayerProperties/geometry" ).toByteArray() );

setWindowTitle( tr( "Layer Properties - %1" ).arg( lyr->name() ) );

tableTransparency->horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch );
Expand Down Expand Up @@ -381,6 +378,15 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
// update based on lyr's current state
sync();

QSettings settings;
// if dialog hasn't been opened/closed yet, default to Styles tab, which is used most often
// this will be read by restoreOptionsBaseUi()
if ( !settings.contains( QString( "/Windows/RasterLayerProperties/tab" ) ) )
{
settings.setValue( QString( "/Windows/RasterLayerProperties/tab" ),
mOptStackedWidget->indexOf( mOptsPage_Style ) );
}

restoreOptionsBaseUi();
} // QgsRasterLayerProperties ctor

Expand Down

0 comments on commit 2f94d65

Please sign in to comment.