Skip to content

Commit

Permalink
Make projection properties dialog remember size, position and current…
Browse files Browse the repository at this point in the history
… tab between sessions

git-svn-id: http://svn.osgeo.org/qgis/trunk@11518 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Aug 26, 2009
1 parent 2aa6508 commit 0b230c8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/app/qgsprojectproperties.cpp
Expand Up @@ -205,10 +205,13 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
mSnappingLayerSettings.insert( *idIter, newEntry );
}
}
restoreState();
}

QgsProjectProperties::~QgsProjectProperties()
{}
{
saveState();
}



Expand Down Expand Up @@ -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() );
}
11 changes: 11 additions & 0 deletions src/app/qgsprojectproperties.h
Expand Up @@ -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();
};

0 comments on commit 0b230c8

Please sign in to comment.