Skip to content

Commit

Permalink
Fix algorithm dialog window geometry save/restore
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Dec 21, 2017
1 parent ce28cf5 commit 54910fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
5 changes: 0 additions & 5 deletions python/gui/processing/qgsprocessingalgorithmdialogbase.sip
Expand Up @@ -99,8 +99,6 @@ Returns the parameter values for the algorithm to run in the dialog.

virtual void accept();

virtual void reject();


void reportError( const QString &error );
%Docstring
Expand Down Expand Up @@ -139,9 +137,6 @@ Pushes a console info string to the dialog's log.

protected:

virtual void closeEvent( QCloseEvent *e );


QPushButton *runButton();
%Docstring
Returns the dialog's run button.
Expand Down
21 changes: 3 additions & 18 deletions src/gui/processing/qgsprocessingalgorithmdialogbase.cpp
Expand Up @@ -17,6 +17,7 @@
#include "qgssettings.h"
#include "qgshelp.h"
#include "qgsmessagebar.h"
#include "qgsgui.h"
#include "processing/qgsprocessingalgorithm.h"
#include "processing/qgsprocessingprovider.h"
#include <QToolButton>
Expand Down Expand Up @@ -83,8 +84,9 @@ QgsProcessingAlgorithmDialogBase::QgsProcessingAlgorithmDialogBase( QWidget *par
handleLayout->addStretch();
splitterHandle->setLayout( handleLayout );

QgsGui::instance()->enableAutoGeometryRestore( this );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "/Processing/dialogBase" ) ).toByteArray() );
splitter->restoreState( settings.value( QStringLiteral( "/Processing/dialogBaseSplitter" ), QByteArray() ).toByteArray() );
mSplitterState = splitter->saveState();
splitterChanged( 0, 0 );
Expand Down Expand Up @@ -184,12 +186,6 @@ void QgsProcessingAlgorithmDialogBase::showLog()
mTabWidget->setCurrentIndex( 1 );
}

void QgsProcessingAlgorithmDialogBase::closeEvent( QCloseEvent *e )
{
saveWindowGeometry();
QDialog::closeEvent( e );
}

QPushButton *QgsProcessingAlgorithmDialogBase::runButton()
{
return mButtonRun;
Expand Down Expand Up @@ -224,12 +220,6 @@ void QgsProcessingAlgorithmDialogBase::accept()
{
}

void QgsProcessingAlgorithmDialogBase::reject()
{
saveWindowGeometry();
QDialog::reject();
}

void QgsProcessingAlgorithmDialogBase::openHelp()
{
QUrl algHelp = mAlgorithm->helpUrl();
Expand Down Expand Up @@ -335,11 +325,6 @@ QString QgsProcessingAlgorithmDialogBase::formatHelp( QgsProcessingAlgorithm *al
return QString();
}

void QgsProcessingAlgorithmDialogBase::saveWindowGeometry()
{

}

void QgsProcessingAlgorithmDialogBase::resetGui()
{
lblProgress->clear();
Expand Down
4 changes: 0 additions & 4 deletions src/gui/processing/qgsprocessingalgorithmdialogbase.h
Expand Up @@ -144,7 +144,6 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
public slots:

void accept() override;
void reject() override;

/**
* Reports an \a error string to the dialog's log.
Expand Down Expand Up @@ -183,8 +182,6 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::

protected:

void closeEvent( QCloseEvent *e ) override;

/**
* Returns the dialog's run button.
*/
Expand Down Expand Up @@ -274,7 +271,6 @@ class GUI_EXPORT QgsProcessingAlgorithmDialogBase : public QDialog, private Ui::
bool mHelpCollapsed = false;

QString formatHelp( QgsProcessingAlgorithm *algorithm );
void saveWindowGeometry();

};

Expand Down

0 comments on commit 54910fc

Please sign in to comment.