15 |
15 |
16 class RopeProgressDialog(EricProgressDialog): |
16 class RopeProgressDialog(EricProgressDialog): |
17 """ |
17 """ |
18 Class implementing TaskHandle with a progress dialog. |
18 Class implementing TaskHandle with a progress dialog. |
19 """ |
19 """ |
|
20 |
20 def __init__(self, server, title, interruptable=True, parent=None): |
21 def __init__(self, server, title, interruptable=True, parent=None): |
21 """ |
22 """ |
22 Constructor |
23 Constructor |
23 |
24 |
24 @param server reference to the JSON server |
25 @param server reference to the JSON server |
25 @type EricJsonServer |
26 @type EricJsonServer |
26 @param title title for the dialog |
27 @param title title for the dialog |
27 @type str |
28 @type str |
28 @param interruptable flag indicating, that the task may be |
29 @param interruptable flag indicating, that the task may be |
37 self.setFormat(self.tr("%v/%m files")) |
38 self.setFormat(self.tr("%v/%m files")) |
38 label = QLabel("") |
39 label = QLabel("") |
39 label.setWordWrap(True) |
40 label.setWordWrap(True) |
40 self.setLabel(label) |
41 self.setLabel(label) |
41 self.setWindowTitle(self.tr("eric7 - {0}").format(title)) |
42 self.setWindowTitle(self.tr("eric7 - {0}").format(title)) |
42 |
43 |
43 self.__server = server |
44 self.__server = server |
44 |
45 |
45 def updateProgress(self, params): |
46 def updateProgress(self, params): |
46 """ |
47 """ |
47 Public slot to handle the task progress. |
48 Public slot to handle the task progress. |
48 |
49 |
49 @param params dictionary containing the data to be set |
50 @param params dictionary containing the data to be set |
50 @type dict |
51 @type dict |
51 """ |
52 """ |
52 if params: |
53 if params: |
53 self.setLabelText(params["Text"]) |
54 self.setLabelText(params["Text"]) |
54 if "Maximum" in params: |
55 if "Maximum" in params: |
55 # these are always sent together |
56 # these are always sent together |
56 self.setMaximum(params["Maximum"]) |
57 self.setMaximum(params["Maximum"]) |
57 self.setValue(params["Value"]) |
58 self.setValue(params["Value"]) |
58 |
59 |
59 QCoreApplication.processEvents() |
60 QCoreApplication.processEvents() |
60 |
61 |
61 if self.wasCanceled(): |
62 if self.wasCanceled(): |
62 self.__server.sendJson("AbortAction", {}) |
63 self.__server.sendJson("AbortAction", {}) |