Skip to content
Permalink
Browse files

[raster calc] use new API to save/restore geometry

  • Loading branch information
nirvn committed Feb 8, 2018
1 parent 90e353b commit 50a103f5b8386b247782c5ca677a875cd5a7ffa4
Showing with 3 additions and 10 deletions.
  1. +3 −9 src/app/qgsrastercalcdialog.cpp
  2. +0 −1 src/app/qgsrastercalcdialog.h
@@ -21,6 +21,7 @@
#include "qgsrasterdataprovider.h"
#include "qgsrasterlayer.h"
#include "qgssettings.h"
#include "qgsgui.h"

#include "cpl_string.h"
#include "gdal.h"
@@ -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 );
@@ -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();
@@ -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();
@@ -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;

0 comments on commit 50a103f

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