mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Set busy cursor on long job
This commit is contained in:
parent
106b717208
commit
b1c59e0c03
@ -10,7 +10,7 @@ import time
|
|||||||
from threading import Thread
|
from threading import Thread
|
||||||
from functools import partial
|
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 import Dispatcher
|
||||||
from calibre.gui2.progress_indicator import ProgressIndicator
|
from calibre.gui2.progress_indicator import ProgressIndicator
|
||||||
@ -65,8 +65,10 @@ class BlockingJob(QWidget):
|
|||||||
self.raise_()
|
self.raise_()
|
||||||
self.setFocus(Qt.OtherFocusReason)
|
self.setFocus(Qt.OtherFocusReason)
|
||||||
self.pi.startAnimation()
|
self.pi.startAnimation()
|
||||||
|
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
QApplication.restoreOverrideCursor()
|
||||||
self.pi.stopAnimation()
|
self.pi.stopAnimation()
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
self.parent().setEnabled(True)
|
self.parent().setEnabled(True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user