Skip to content
Permalink
Browse files

save geometry and current row of options, vector and raster property …

…dialogs

git-svn-id: http://svn.osgeo.org/qgis/trunk@12362 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 7, 2009
1 parent a02f0c7 commit 4c339968fd38b65c879e6fadfb1fc845ce582c08
Showing with 48 additions and 9 deletions.
  1. +2 −0 src/app/qgisapp.cpp
  2. +29 −6 src/app/qgsoptions.cpp
  3. +7 −0 src/app/qgsrasterlayerproperties.cpp
  4. +10 −3 src/app/qgsvectorlayerproperties.cpp
@@ -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()
@@ -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()
{
@@ -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() );
}

/*
@@ -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()
@@ -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( )
@@ -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;

0 comments on commit 4c33996

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