'**Arguments:**
labelText      (required)
cancelText     Text to display on cancel button, or None to disable it.
minimum
maximum
parent
wait           Length of time (im ms) to wait before displaying dialog
busyCursor     If True, show busy cursor until dialog finishes
disable        If True, the progress dialog will not be displayed
and calls to wasCanceled() will always return False.
If ProgressDialog is entered from a non-gui thread, it will
always be disabled.'

def __init__(self, labelText, minimum=0, maximum=100, cancelText='Cancel', parent=None, wait=250, busyCursor=False, disable=False):

    isGuiThread = (QtCore.QThread.currentThread() == QtCore.QCoreApplication.instance().thread())
    self.disabled = (disable or (not isGuiThread))
    if self.disabled:
        return
    noCancel = False
    if (cancelText is None):
        cancelText = ''
        noCancel = True
    self.busyCursor = busyCursor
    QtGui.QProgressDialog.__init__(self, labelText, cancelText, minimum, maximum, parent)
    self.setMinimumDuration(wait)
    self.setWindowModality(QtCore.Qt.WindowModal)
    self.setValue(self.minimum())
    if noCancel:
        self.setCancelButton(None)
