diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2008-06-03 21:08:41 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2008-06-03 21:08:41 +0000 |
| commit | 8b5176ab8d8a334dfee75cfbda878240e2501823 (patch) | |
| tree | df4ace3ea1da32330b00d46139b02773531b7362 /lib/python/Screens/TaskView.py | |
| parent | be9f9b15125b46136fefc5051f5661dc15d59ab7 (diff) | |
| download | enigma2-8b5176ab8d8a334dfee75cfbda878240e2501823.tar.gz enigma2-8b5176ab8d8a334dfee75cfbda878240e2501823.zip | |
some cleanups
Diffstat (limited to 'lib/python/Screens/TaskView.py')
| -rw-r--r-- | lib/python/Screens/TaskView.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py index 25285852..299c0fa2 100644 --- a/lib/python/Screens/TaskView.py +++ b/lib/python/Screens/TaskView.py @@ -4,15 +4,18 @@ class JobView(Screen): def __init__(self, session, job, cancelable = True, close_on_finish = False): from Components.Sources.StaticText import StaticText from Components.Sources.Progress import Progress + from Components.Sources.Boolean import Boolean from Components.ActionMap import ActionMap Screen.__init__(self, session) self.job = job self.close_on_finish = close_on_finish + self.cancelable = cancelable self["job_name"] = StaticText(job.name) self["job_progress"] = Progress() self["job_status"] = StaticText() self["job_task"] = StaticText() + self["finished"] = Boolean() self.onShow.append(self.windowShow) self.onHide.append(self.windowHide) @@ -32,15 +35,19 @@ class JobView(Screen): def state_changed(self): j = self.job - self["job_progress"].range = len(j.tasks) - self["job_progress"].value = j.current_task + self["job_progress"].range = j.end + self["job_progress"].value = j.progress + print "JobView::state_changed:", j.end, j.progress self["job_status"].text = {j.NOT_STARTED: _("Waiting"), j.IN_PROGRESS: _("In Progress"), j.FINISHED: _("Finished"), j.FAILED: _("Failed")}[j.status] if j.status == j.IN_PROGRESS: self["job_task"].text = j.tasks[j.current_task].name else: self["job_task"].text = "" - if j.status in [j.FINISHED, j.FAILED] and self.close_on_finish: - self.close() + if j.status in [j.FINISHED, j.FAILED]: + if self.close_on_finish: + self.close() + else: + self["finished"].boolean = True def ok(self): if self.job.status in [self.job.FINISHED, self.job.FAILED]: |
