Skip to content
Permalink
Browse files

Make projection properties dialog remember size, position and current…

… tab between sessions

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11518 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann
homann committed Aug 26, 2009
1 parent dfd09ff commit 898aa792a9f0da4b477e3212dd1988a1a70cb6a6
Showing with 34 additions and 1 deletion.
  1. +23 −1 src/app/qgsprojectproperties.cpp
  2. +11 −0 src/app/qgsprojectproperties.h
@@ -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();
};

0 comments on commit 898aa79

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