mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
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:
parent
2aa6508d8f
commit
0b230c8ec2
@ -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() );
|
||||
}
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user