30 """ |
30 """ |
31 rope.base.taskhandle.TaskHandle.__init__(self, title, interruptable) |
31 rope.base.taskhandle.TaskHandle.__init__(self, title, interruptable) |
32 |
32 |
33 self.__client = client |
33 self.__client = client |
34 |
34 |
35 self.__client.sendJson("ProgressInit", { |
35 self.__client.sendJson("Progress", { |
|
36 "Subcommand": "Init", |
36 "Title": title, |
37 "Title": title, |
37 "Interrutable": interruptable, |
38 "Interruptable": interruptable, |
38 }) |
39 }) |
39 |
40 |
40 self.add_observer(self.__updateProgress) |
41 self.add_observer(self.__updateProgress) |
41 |
42 |
42 def __updateProgress(self): |
43 def __updateProgress(self): |
43 """ |
44 """ |
44 Private slot to handle the task progress. |
45 Private slot to handle the task progress. |
45 """ |
46 """ |
|
47 params = { |
|
48 "Subcommand": "Progress", |
|
49 } |
|
50 |
46 jobset = self.current_jobset() |
51 jobset = self.current_jobset() |
47 if jobset: |
52 if jobset: |
48 text = '' |
53 text = '' |
49 if jobset.get_name() is not None: |
54 if jobset.get_name() is not None: |
50 text += jobset.get_name() |
55 text += jobset.get_name() |
51 if jobset.get_active_job_name() is not None: |
56 if jobset.get_active_job_name() is not None: |
52 text += ': ' + jobset.get_active_job_name() |
57 text += ': ' + jobset.get_active_job_name() |
53 params = { |
58 params["Text"] = text |
54 "Text": text, |
|
55 } |
|
56 if jobset.count is not None: |
59 if jobset.count is not None: |
57 params["Maximum"] = jobset.count |
60 params["Maximum"] = jobset.count |
58 params["Value"] = jobset.done |
61 params["Value"] = jobset.done |
59 else: |
|
60 params = {} |
|
61 |
62 |
62 self.__client.sendJson("Progress", params) |
63 self.__client.sendJson("Progress", params) |
63 self.__client.poll() |
64 self.__client.poll() |
64 |
65 |
65 def reset(self): |
66 def reset(self): |
66 """ |
67 """ |
67 Public slot to reset the progress dialog. |
68 Public slot to reset the progress dialog. |
68 """ |
69 """ |
69 self.__client.sendJson("ProgressReset", {}) |
70 self.__client.sendJson("Progress", { |
|
71 "Subcommand": "Reset", |
|
72 }) |
70 self.__client.poll() |
73 self.__client.poll() |