mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Allow has_device_jobs to also check for queued device jobs
This commit is contained in:
parent
1620dee548
commit
9ba38f6585
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user