Skip to content
Permalink
Browse files
Clean up progress handling in QgsProcessingFeedback
  • Loading branch information
nyalldawson committed Mar 28, 2017
1 parent 4d62804 commit 99f186a7d201451a4624bb894088e3bb90f1d933
@@ -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
@@ -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):

@@ -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
@@ -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)

@@ -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()))
@@ -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)
@@ -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()
@@ -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

0 comments on commit 99f186a

Please sign in to comment.