[georef] Save/restore window positions

This commit is contained in:
Nyall Dawson 2015-06-18 08:00:22 +10:00
parent 049436ef83
commit 4e663fe8f8
6 changed files with 33 additions and 5 deletions

View File

@ -23,6 +23,9 @@ QgsGeorefConfigDialog::QgsGeorefConfigDialog( QWidget *parent ) :
{
setupUi( this );
QSettings s;
restoreGeometry( s.value( "/Plugin-GeoReferencer/ConfigWindow/geometry" ).toByteArray() );
readSettings();
mPaperSizeComboBox->addItem( tr( "A5 (148x210 mm)" ), QSizeF( 148, 210 ) );
@ -55,6 +58,12 @@ QgsGeorefConfigDialog::QgsGeorefConfigDialog( QWidget *parent ) :
}
QgsGeorefConfigDialog::~QgsGeorefConfigDialog()
{
QSettings settings;
settings.setValue( "/Plugin-GeoReferencer/ConfigWindow/geometry", saveGeometry() );
}
void QgsGeorefConfigDialog::changeEvent( QEvent *e )
{
QDialog::changeEvent( e );

View File

@ -23,6 +23,7 @@ class QgsGeorefConfigDialog : public QDialog, private Ui::QgsGeorefConfigDialogB
Q_OBJECT
public:
QgsGeorefConfigDialog( QWidget *parent = 0 );
~QgsGeorefConfigDialog();
protected:
void changeEvent( QEvent *e ) override;

View File

@ -87,6 +87,9 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget
{
setupUi( this );
QSettings s;
restoreGeometry( s.value( "/Plugin-GeoReferencer/Window/geometry" ).toByteArray() );
createActions();
createActionGroups();
createMenus();
@ -105,7 +108,6 @@ QgsGeorefPluginGui::QgsGeorefPluginGui( QgisInterface* theQgisInterface, QWidget
connect( mIface, SIGNAL( currentThemeChanged( QString ) ), this, SLOT( updateIconTheme( QString ) ) );
QSettings s;
if ( s.value( "/Plugin-GeoReferencer/Config/ShowDocked" ).toBool() )
{
dockThisWindow( true );
@ -135,6 +137,9 @@ void QgsGeorefPluginGui::dockThisWindow( bool dock )
QgsGeorefPluginGui::~QgsGeorefPluginGui()
{
QSettings settings;
settings.setValue( "/Plugin-GeoReferencer/Window/geometry", saveGeometry() );
clearGCPData();
removeOldLayer();
@ -146,7 +151,6 @@ QgsGeorefPluginGui::~QgsGeorefPluginGui()
delete mToolDeletePoint;
delete mToolMovePoint;
delete mToolMovePointQgis;
}
// ----------------------------- protected --------------------------------- //

View File

@ -29,12 +29,14 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint
{
setupUi( this );
QSettings s;
restoreGeometry( s.value( "/Plugin-GeoReferencer/MapCoordsWindow/geometry" ).toByteArray() );
setAttribute( Qt::WA_DeleteOnClose );
mPointFromCanvasPushButton = new QPushButton( QIcon( ":/icons/default/mPushButtonPencil.png" ), tr( "From map canvas" ) );
mPointFromCanvasPushButton->setCheckable( true );
buttonBox->addButton( mPointFromCanvasPushButton, QDialogButtonBox::ActionRole );
adjustSize();
// User can input either DD or DMS coords (from QGis mapcanav we take DD coords)
QgsDMSAndDDValidator *validator = new QgsDMSAndDDValidator( this );
@ -44,7 +46,6 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint
mToolEmitPoint = new QgsGeorefMapToolEmitPoint( qgisCanvas );
mToolEmitPoint->setButton( mPointFromCanvasPushButton );
QSettings s;
mSnapToBackgroundLayerBox->setChecked( s.value( "/Plugin-GeoReferencer/snapToBackgroundLayers", QVariant( false ) ).toBool() );
connect( mPointFromCanvasPushButton, SIGNAL( clicked( bool ) ), this, SLOT( setToolEmitPoint( bool ) ) );
@ -61,6 +62,9 @@ QgsMapCoordsDialog::QgsMapCoordsDialog( QgsMapCanvas* qgisCanvas, const QgsPoint
QgsMapCoordsDialog::~QgsMapCoordsDialog()
{
delete mToolEmitPoint;
QSettings settings;
settings.setValue( "/Plugin-GeoReferencer/MapCoordsWindow/geometry", saveGeometry() );
}
void QgsMapCoordsDialog::updateOK()

View File

@ -34,6 +34,9 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c
{
setupUi( this );
QSettings s;
restoreGeometry( s.value( "/Plugin-GeoReferencer/TransformSettingsWindow/geometry" ).toByteArray() );
cmbTransformType->addItem( tr( "Linear" ), ( int )QgsGeorefTransform::Linear );
cmbTransformType->addItem( tr( "Helmert" ), ( int )QgsGeorefTransform::Helmert );
cmbTransformType->addItem( tr( "Polynomial 1" ), ( int )QgsGeorefTransform::PolynomialOrder1 );
@ -56,7 +59,6 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c
}
cmbCompressionComboBox->addItems( listCompressionTr );
QSettings s;
cmbTransformType->setCurrentIndex( s.value( "/Plugin-GeoReferencer/lasttransformation", -1 ).toInt() );
cmbResampling->setCurrentIndex( s.value( "/Plugin-GeoReferencer/lastresampling", 0 ).toInt() );
cmbCompressionComboBox->setCurrentIndex( s.value( "/Plugin-GeoReferencer/lastcompression", 0 ).toInt() );
@ -81,6 +83,12 @@ QgsTransformSettingsDialog::QgsTransformSettingsDialog( const QString &raster, c
cbxLoadInQgisWhenDone->setChecked( s.value( "/Plugin-GeoReferencer/loadinqgis", false ).toBool() );
}
QgsTransformSettingsDialog::~QgsTransformSettingsDialog()
{
QSettings settings;
settings.setValue( "/Plugin-GeoReferencer/TransformSettingsWindow/geometry", saveGeometry() );
}
void QgsTransformSettingsDialog::getTransformSettings( QgsGeorefTransform::TransformParametrisation &tp,
QgsImageWarper::ResamplingMethod &rm,
QString &comprMethod, QString &raster,

View File

@ -29,6 +29,8 @@ class QgsTransformSettingsDialog : public QDialog, private Ui::QgsTransformSetti
public:
QgsTransformSettingsDialog( const QString &raster, const QString &output,
int countGCPpoints, QWidget *parent = 0 );
~QgsTransformSettingsDialog();
void getTransformSettings( QgsGeorefTransform::TransformParametrisation &tp,
QgsImageWarper::ResamplingMethod &rm, QString &comprMethod,
QString &raster, QgsCoordinateReferenceSystem& proj, QString& pdfMapFile, QString& pdfReportFile, bool &zt, bool &loadInQgis,