9 |
9 |
10 from PyQt4.QtGui import QApplication, QProgressDialog, QLabel |
10 from PyQt4.QtGui import QApplication, QProgressDialog, QLabel |
11 |
11 |
12 import rope.base.taskhandle |
12 import rope.base.taskhandle |
13 |
13 |
|
14 |
14 class ProgressHandle(rope.base.taskhandle.TaskHandle): |
15 class ProgressHandle(rope.base.taskhandle.TaskHandle): |
15 """ |
16 """ |
16 Class implementing TaskHandle with a progress dialog. |
17 Class implementing TaskHandle with a progress dialog. |
17 """ |
18 """ |
18 def __init__(self, title, interruptable=True, parent=None): |
19 def __init__(self, title, interruptable=True, parent=None): |
19 """ |
20 """ |
20 Constructor |
21 Constructor |
21 |
22 |
22 @param title title for the taskhandle (string) |
23 @param title title for the taskhandle (string) |
23 @param interruptable flag indicating, that the task may be |
24 @param interruptable flag indicating, that the task may be |
24 interrupted (boolean) |
25 interrupted (boolean) |
25 @param parent reference to the parent widget (QWidget) |
26 @param parent reference to the parent widget (QWidget) |
26 """ |
27 """ |
27 rope.base.taskhandle.TaskHandle.__init__(self, title, interruptable) |
28 rope.base.taskhandle.TaskHandle.__init__(self, title, interruptable) |
28 if interruptable: |
29 if interruptable: |
29 cancelLabel = QApplication.translate("ProgressHandle","Interrupt") |
30 cancelLabel = QApplication.translate("ProgressHandle", "Interrupt") |
30 else: |
31 else: |
31 cancelLabel = "" |
32 cancelLabel = "" |
32 self.__progress = QProgressDialog("", cancelLabel, 0, 100, parent) |
33 self.__progress = QProgressDialog("", cancelLabel, 0, 100, parent) |
33 label = QLabel("") |
34 label = QLabel("") |
34 label.setWordWrap(True) |
35 label.setWordWrap(True) |