Skip to content
Permalink
Browse files

[georef] Save/restore window positions

  • Loading branch information
nyalldawson committed Jun 17, 2015
1 parent 049436e commit 4e663fe8f80b2c618f3308dca7839c04e172fb46
@@ -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 );
@@ -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;
@@ -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 --------------------------------- //
@@ -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()
@@ -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,
@@ -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,

0 comments on commit 4e663fe

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