diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2011-09-14 22:58:53 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2011-09-14 22:58:53 +0200 |
| commit | 75d5fba59f4e575eab24d1a6397a5904abed1101 (patch) | |
| tree | b1e84f1bb4edb8de2307ca5e65b979f0913f47a2 | |
| parent | 8a25a8d1153800a868830d4813e277dcc490bcb7 (diff) | |
| parent | 9d1c22ed6298d6fa303f7e129d937df06e1bac7d (diff) | |
| download | enigma2-75d5fba59f4e575eab24d1a6397a5904abed1101.tar.gz enigma2-75d5fba59f4e575eab24d1a6397a5904abed1101.zip | |
Merge branch 'bug_747_cancel_waiting_tasks'
| -rw-r--r-- | lib/python/Components/Task.py | 2 | ||||
| -rw-r--r-- | lib/python/Screens/TaskView.py | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index 3a755405..86769233 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -108,7 +108,6 @@ class Job(object): self.tasks[i].abort() def cancel(self): - # some Jobs might have a better idea of how to cancel a job self.abort() class Task(object): @@ -305,6 +304,7 @@ class JobManager: list.append(self.active_job) list += self.active_jobs return list + # some examples: #class PartitionExistsPostcondition: # def __init__(self, device): diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py index 6e1b752d..5dd744fa 100644 --- a/lib/python/Screens/TaskView.py +++ b/lib/python/Screens/TaskView.py @@ -2,6 +2,7 @@ from Screen import Screen from Components.ConfigList import ConfigListScreen from Components.config import config, ConfigSubsection, ConfigSelection, getConfigListEntry from Components.SystemInfo import SystemInfo +from Components.Task import job_manager from InfoBarGenerics import InfoBarNotifications import Screens.Standby from Tools import Notifications @@ -108,7 +109,10 @@ class JobView(InfoBarNotifications, Screen, ConfigListScreen): self.close(False) def abort(self): - if self.job.status == self.job.IN_PROGRESS and self["cancelable"].boolean == True: + if self.job.status == self.job.NOT_STARTED: + job_manager.active_jobs.remove(self.job) + self.close(False) + elif self.job.status == self.job.IN_PROGRESS and self["cancelable"].boolean == True: self.job.cancel() else: self.close(False) |
