From 9ba38f6585a80aa667c45b4a74ad994d41532fe4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Jun 2011 08:40:29 -0600 Subject: [PATCH] Allow has_device_jobs to also check for queued device jobs --- src/calibre/gui2/jobs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index 51c54843a4..6aae892d61 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -197,10 +197,12 @@ class JobManager(QAbstractTableModel): # {{{ def row_to_job(self, row): return self.jobs[row] - def has_device_jobs(self): + def has_device_jobs(self, queued_also=False): for job in self.jobs: - if job.is_running and isinstance(job, DeviceJob): - return True + if isinstance(job, DeviceJob): + if job.duration is None: # Running or waiting + if (job.is_running or queued_also): + return True return False def has_jobs(self):