Make projection properties dialog remember size, position and current tab between sessions

git-svn-id: http://svn.osgeo.org/qgis/trunk@11518 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
homann 2009-08-26 20:36:51 +00:00
parent 2aa6508d8f
commit 0b230c8ec2
2 changed files with 34 additions and 1 deletions

View File

@ -205,10 +205,13 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
mSnappingLayerSettings.insert( *idIter, newEntry );
}
}
restoreState();
}
QgsProjectProperties::~QgsProjectProperties()
{}
{
saveState();
}
@ -437,3 +440,22 @@ void QgsProjectProperties::on_cbxProjectionEnabled_stateChanged( int state )
btnGrpMapUnits->setEnabled( state == Qt::Unchecked );
}
/*!
* Function to save dialog window state
*/
void QgsProjectProperties::saveState()
{
QSettings settings;
settings.setValue( "/Windows/ProjectProperties/geometry", saveGeometry() );
settings.setValue( "/Windows/ProjectProperties/tab", tabWidget->currentIndex() );
}
/*!
* Function to restore dialog window state
*/
void QgsProjectProperties::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Windows/ProjectProperties/geometry" ).toByteArray() );
tabWidget->setCurrentIndex( settings.value( "/Windows/ProjectProperties/tab" ).toInt() );
}

View File

@ -113,4 +113,15 @@ class QgsProjectProperties : public QDialog, private Ui::QgsProjectPropertiesBas
Key is the layer id, the pair consists of snap to vertex = 0/snap to segment = 1,
snapping tolerance*/
QMap<QString, LayerEntry> mSnappingLayerSettings;
/*!
* Function to save dialog window state
*/
void saveState();
/*!
* Function to restore dialog window state
*/
void restoreState();
};