Set busy cursor on long job

This commit is contained in:
Kovid Goyal 2013-10-28 21:41:55 +05:30
parent 106b717208
commit b1c59e0c03

View File

@ -10,7 +10,7 @@ import time
from threading import Thread
from functools import partial
from PyQt4.Qt import (QWidget, QVBoxLayout, QLabel, Qt, QPainter, QBrush, QRect)
from PyQt4.Qt import (QWidget, QVBoxLayout, QLabel, Qt, QPainter, QBrush, QRect, QApplication, QCursor)
from calibre.gui2 import Dispatcher
from calibre.gui2.progress_indicator import ProgressIndicator
@ -65,8 +65,10 @@ class BlockingJob(QWidget):
self.raise_()
self.setFocus(Qt.OtherFocusReason)
self.pi.startAnimation()
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
def stop(self):
QApplication.restoreOverrideCursor()
self.pi.stopAnimation()
self.setVisible(False)
self.parent().setEnabled(True)