Skip to content

Commit

Permalink
Clean up progress handling in QgsProcessingFeedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Mar 28, 2017
1 parent 4d62804 commit 99f186a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 25 deletions.
8 changes: 0 additions & 8 deletions python/core/processing/qgsprocessingfeedback.sip
Expand Up @@ -16,14 +16,6 @@ class QgsProcessingFeedback : public QgsFeedback

public:

/**
* Sets the algorithm's progress. The progress
* argument is limited to the range 0-100 and reflects the percentage
* progress through the task.
* @see setProgressText()
*/
virtual void setProgress( double progress );

/**
* Sets a progress report text string. This can be used in conjunction with
* setProgress() to provide detailed progress reports, such as "Transformed
Expand Down
Expand Up @@ -61,9 +61,6 @@ def __init__(self, dialog):
def reportError(self, msg):
self.dialog.error(msg)

def setProgress(self, i):
self.dialog.setPercentage(i)


class FieldsCalculatorDialog(BASE, WIDGET):

Expand All @@ -72,6 +69,7 @@ def __init__(self, alg):
self.setupUi(self)

self.feedback = FieldCalculatorFeedback(self)
self.feedback.progressChanged.connect(self.setPercentage)

self.executed = False
self.alg = alg
Expand Down
4 changes: 1 addition & 3 deletions python/plugins/processing/gui/AlgorithmDialogBase.py
Expand Up @@ -63,9 +63,6 @@ def reportError(self, msg):
def setProgressText(self, text):
self.dialog.setText(text)

def setProgress(self, i):
self.dialog.setPercentage(i)

def pushInfo(self, msg):
self.dialog.setInfo(msg)

Expand All @@ -86,6 +83,7 @@ def __init__(self, alg):
self.setupUi(self)

self.feedback = AlgorithmDialogFeedback(self)
self.feedback.progressChanged.connect(self.setPercentage)

self.settings = QgsSettings()
self.restoreGeometry(self.settings.value("/Processing/dialogBase", QByteArray()))
Expand Down
4 changes: 1 addition & 3 deletions python/plugins/processing/gui/MessageBarProgress.py
Expand Up @@ -40,6 +40,7 @@ def __init__(self, algname=None):
self.msg = []
self.progressMessageBar = \
iface.messageBar().createMessage(self.tr('Executing algorithm <i>{0}</i>'.format(algname if algname else '')))
self.progressChanged.connect(self.progress.setValue)
self.progress = QProgressBar()
self.progress.setMaximum(100)
self.progress.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
Expand All @@ -50,9 +51,6 @@ def __init__(self, algname=None):
def reportError(self, msg):
self.msg.append(msg)

def setProgress(self, i):
self.progress.setValue(i)

def close(self):
if self.msg:
dlg = MessageDialog()
Expand Down
8 changes: 0 additions & 8 deletions src/core/processing/qgsprocessingfeedback.h
Expand Up @@ -37,14 +37,6 @@ class CORE_EXPORT QgsProcessingFeedback : public QgsFeedback

public:

/**
* Sets the algorithm's progress. The progress
* argument is limited to the range 0-100 and reflects the percentage
* progress through the task.
* @see setProgressText()
*/
virtual void setProgress( double progress ) { Q_UNUSED( progress ); }

/**
* Sets a progress report text string. This can be used in conjunction with
* setProgress() to provide detailed progress reports, such as "Transformed
Expand Down

0 comments on commit 99f186a

Please sign in to comment.