Skip to content

Commit

Permalink
[raster calc] use new API to save/restore geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 8, 2018
1 parent 90e353b commit 50a103f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/app/qgsrastercalcdialog.cpp
Expand Up @@ -21,6 +21,7 @@
#include "qgsrasterdataprovider.h"
#include "qgsrasterlayer.h"
#include "qgssettings.h"
#include "qgsgui.h"

#include "cpl_string.h"
#include "gdal.h"
Expand All @@ -31,6 +32,8 @@
QgsRasterCalcDialog::QgsRasterCalcDialog( QWidget *parent, Qt::WindowFlags f ): QDialog( parent, f )
{
setupUi( this );
QgsGui::instance()->enableAutoGeometryRestore( this );

connect( mOutputLayerPushButton, &QPushButton::clicked, this, &QgsRasterCalcDialog::mOutputLayerPushButton_clicked );
connect( mRasterBandsListWidget, &QListWidget::itemDoubleClicked, this, &QgsRasterCalcDialog::mRasterBandsListWidget_itemDoubleClicked );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QgsRasterCalcDialog::mButtonBox_accepted );
Expand Down Expand Up @@ -63,9 +66,6 @@ QgsRasterCalcDialog::QgsRasterCalcDialog( QWidget *parent, Qt::WindowFlags f ):
connect( mOrButton, &QPushButton::clicked, this, &QgsRasterCalcDialog::mOrButton_clicked );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterCalcDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/RasterCalc/geometry" ) ).toByteArray() );

//add supported output formats
insertAvailableOutputFormats();
insertAvailableRasterBands();
Expand All @@ -79,12 +79,6 @@ QgsRasterCalcDialog::QgsRasterCalcDialog( QWidget *parent, Qt::WindowFlags f ):
mExpressionTextEdit->setCurrentFont( QFontDatabase::systemFont( QFontDatabase::FixedFont ) );
}

QgsRasterCalcDialog::~QgsRasterCalcDialog()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/RasterCalc/geometry" ), saveGeometry() );
}

QString QgsRasterCalcDialog::formulaString() const
{
return mExpressionTextEdit->toPlainText();
Expand Down
1 change: 0 additions & 1 deletion src/app/qgsrastercalcdialog.h
Expand Up @@ -29,7 +29,6 @@ class APP_EXPORT QgsRasterCalcDialog: public QDialog, private Ui::QgsRasterCalcD
Q_OBJECT
public:
QgsRasterCalcDialog( QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );
~QgsRasterCalcDialog() override;

QString formulaString() const;
QString outputFile() const;
Expand Down

0 comments on commit 50a103f

Please sign in to comment.