Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 30, 2019
1 parent c12fd87 commit 1d80fe8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
13 changes: 9 additions & 4 deletions python/gui/auto_generated/qgsfindfilesbypatternwidget.sip.in
Expand Up @@ -30,17 +30,21 @@ Constructor for QgsFindFilesByPatternWidget, with the specified ``parent`` widge

QStringList files() const;
%Docstring
Returns the list of files found by the dialog.
Returns the list of files found by the dialog. This may be empty if
no matching files were found.

.. seealso:: :py:func:`filesFound`
.. seealso:: :py:func:`findComplete`
%End

signals:

void filesFound( const QStringList &files );
void findComplete( const QStringList &files );
%Docstring
Emitted after files are found in the dialog.

The ``files`` argument contains a list of all matching files found. This may be empty if
no matching files were found.

.. seealso:: :py:func:`files`
%End

Expand All @@ -66,7 +70,8 @@ Constructor for QgsFindFilesByPatternDialog, with the specified ``parent`` widge

QStringList files() const;
%Docstring
Returns the list of files found by the dialog.
Returns the list of files found by the dialog. This may be empty if
no matching files were found.
%End

};
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/gui/BatchPanel.py
Expand Up @@ -96,7 +96,7 @@ class BatchPanelFillWidget(QToolButton):
def __init__(self, parameterDefinition, column, panel, parent=None):
super().__init__(parent)

self.setBackgroundRole(QPalette.Window)
self.setBackgroundRole(QPalette.Button)
self.setAutoFillBackground(True)

self.parameterDefinition = parameterDefinition
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsfindfilesbypatternwidget.cpp
Expand Up @@ -103,7 +103,7 @@ void QgsFindFilesByPatternWidget::find()
disconnect( mFindButton, &QPushButton::clicked, this, &QgsFindFilesByPatternWidget::cancel );
connect( mFindButton, &QPushButton::clicked, this, &QgsFindFilesByPatternWidget::find );

emit filesFound( mFiles );
emit findComplete( mFiles );
}

void QgsFindFilesByPatternWidget::cancel()
Expand Down Expand Up @@ -135,7 +135,7 @@ QgsFindFilesByPatternDialog::QgsFindFilesByPatternDialog( QWidget *parent )
setLayout( vLayout );

mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( false );
connect( mWidget, &QgsFindFilesByPatternWidget::filesFound, this, [ = ]( const QStringList & files )
connect( mWidget, &QgsFindFilesByPatternWidget::findComplete, this, [ = ]( const QStringList & files )
{
mButtonBox->button( QDialogButtonBox::Ok )->setEnabled( !files.empty() );
} );
Expand Down
13 changes: 9 additions & 4 deletions src/gui/qgsfindfilesbypatternwidget.h
Expand Up @@ -41,8 +41,9 @@ class GUI_EXPORT QgsFindFilesByPatternWidget : public QWidget, private Ui::QgsFi
QgsFindFilesByPatternWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );

/**
* Returns the list of files found by the dialog.
* \see filesFound()
* Returns the list of files found by the dialog. This may be empty if
* no matching files were found.
* \see findComplete()
*/
QStringList files() const { return mFiles; }

Expand All @@ -51,9 +52,12 @@ class GUI_EXPORT QgsFindFilesByPatternWidget : public QWidget, private Ui::QgsFi
/**
* Emitted after files are found in the dialog.
*
* The \a files argument contains a list of all matching files found. This may be empty if
* no matching files were found.
*
* \see files()
*/
void filesFound( const QStringList &files );
void findComplete( const QStringList &files );

private slots:

Expand Down Expand Up @@ -84,7 +88,8 @@ class GUI_EXPORT QgsFindFilesByPatternDialog : public QDialog
QgsFindFilesByPatternDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr );

/**
* Returns the list of files found by the dialog.
* Returns the list of files found by the dialog. This may be empty if
* no matching files were found.
*/
QStringList files() const;

Expand Down

0 comments on commit 1d80fe8

Please sign in to comment.