Skip to content

Commit

Permalink
save geometry and current row of options, vector and raster property …
Browse files Browse the repository at this point in the history
…dialogs

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12362 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 7, 2009
1 parent 9764839 commit 937fd5e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4523,6 +4523,8 @@ void QgisApp::options()
double zoomFactor = mySettings.value( "/qgis/zoom_factor", 2 ).toDouble();
mMapCanvas->setWheelAction(( QgsMapCanvas::WheelAction ) action, zoomFactor );
}

delete optionsDialog;
}

void QgisApp::helpContents()
Expand Down
35 changes: 29 additions & 6 deletions src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,38 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
mOverlayAlgorithmComboBox->insertItem( 4, tr( "Popmusic chain (very slow)" ) );

QString overlayAlgorithmString = settings.value( "qgis/overlayPlacementAlgorithm", "Central point" ).toString();
if ( overlayAlgorithmString == "Chain" ) {mOverlayAlgorithmComboBox->setCurrentIndex( 1 );}
else if ( overlayAlgorithmString == "Popmusic tabu chain" ) {mOverlayAlgorithmComboBox->setCurrentIndex( 2 );}
else if ( overlayAlgorithmString == "Popmusic tabu" ) {mOverlayAlgorithmComboBox->setCurrentIndex( 3 );}
else if ( overlayAlgorithmString == "Popmusic chain" ) {mOverlayAlgorithmComboBox->setCurrentIndex( 4 );}
else {mOverlayAlgorithmComboBox->setCurrentIndex( 0 );} //default is central point
if ( overlayAlgorithmString == "Chain" )
{
mOverlayAlgorithmComboBox->setCurrentIndex( 1 );
}
else if ( overlayAlgorithmString == "Popmusic tabu chain" )
{
mOverlayAlgorithmComboBox->setCurrentIndex( 2 );
}
else if ( overlayAlgorithmString == "Popmusic tabu" )
{
mOverlayAlgorithmComboBox->setCurrentIndex( 3 );
}
else if ( overlayAlgorithmString == "Popmusic chain" )
{
mOverlayAlgorithmComboBox->setCurrentIndex( 4 );
}
else
{
mOverlayAlgorithmComboBox->setCurrentIndex( 0 );
} //default is central point

restoreGeometry( settings.value( "/Windows/Options/geometry" ).toByteArray() );
listWidget->setCurrentRow( settings.value( "/Windows/Options/row" ).toInt() );
}

//! Destructor
QgsOptions::~QgsOptions() {}
QgsOptions::~QgsOptions()
{
QSettings settings;
settings.setValue( "/Windows/Options/geometry", saveGeometry() );
settings.setValue( "/Windows/Options/row", listWidget->currentRow() );
}

void QgsOptions::on_pbnSelectionColour_clicked()
{
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,18 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p

// update based on lyr's current state
sync();

QSettings settings;
restoreGeometry( settings.value( "/Windows/RasterLayerProperties/geometry" ).toByteArray() );
listWidget->setCurrentRow( settings.value( "/Windows/RasterLayerProperties/row" ).toInt() );
} // QgsRasterLayerProperties ctor


QgsRasterLayerProperties::~QgsRasterLayerProperties()
{
QSettings settings;
settings.setValue( "/Windows/RasterLayerProperties/geometry", saveGeometry() );
settings.setValue( "/Windows/RasterLayerProperties/row", listWidget->currentRow() );
}

/*
Expand Down
13 changes: 10 additions & 3 deletions src/app/qgsvectorlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
}

stackedWidget->setCurrentIndex( 0 );

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

void QgsVectorLayerProperties::loadRows()
Expand Down Expand Up @@ -201,12 +205,15 @@ void QgsVectorLayerProperties::setRow( int row, int idx, const QgsField &field )

//set the alias for the attribute
tblAttributes->setItem( row, attrAliasCol, new QTableWidgetItem( layer->attributeAlias( idx ) ) );

}

QgsVectorLayerProperties::~QgsVectorLayerProperties()
{
disconnect( labelDialog, SIGNAL( labelSourceSet() ), this, SLOT( setLabelCheckBox() ) );

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

void QgsVectorLayerProperties::attributeTypeDialog( )
Expand Down Expand Up @@ -1119,8 +1126,8 @@ void QgsVectorLayerProperties::setUsingNewSymbology( bool useNewSymbology )
void QgsVectorLayerProperties::useNewSymbology()
{
int res = QMessageBox::question( this, tr( "Symbology" ),
tr( "Do you wish to use the new symbology implementation for this layer?" ),
QMessageBox::Yes | QMessageBox::No );
tr( "Do you wish to use the new symbology implementation for this layer?" ),
QMessageBox::Yes | QMessageBox::No );

if ( res != QMessageBox::Yes )
return;
Expand Down

0 comments on commit 937fd5e

Please sign in to comment.