Allow has_device_jobs to also check for queued device jobs

This commit is contained in:
Kovid Goyal 2011-06-06 08:40:29 -06:00
parent 1620dee548
commit 9ba38f6585

View File

@ -197,10 +197,12 @@ class JobManager(QAbstractTableModel): # {{{
def row_to_job(self, row): def row_to_job(self, row):
return self.jobs[row] return self.jobs[row]
def has_device_jobs(self): def has_device_jobs(self, queued_also=False):
for job in self.jobs: for job in self.jobs:
if job.is_running and isinstance(job, DeviceJob): if isinstance(job, DeviceJob):
return True if job.duration is None: # Running or waiting
if (job.is_running or queued_also):
return True
return False return False
def has_jobs(self): def has_jobs(self):