Fix #4007 (Download Now doesn't work after Stop Selected Job)

This commit is contained in:
Kovid Goyal 2009-12-11 15:39:25 -07:00
parent ee8b98a1e3
commit aced7e5ef4
4 changed files with 17 additions and 2 deletions

View File

@ -43,6 +43,9 @@
tickets: [3328] tickets: [3328]
- title: "Linux device detection: Switch to using libusb1 to enumerate devices on system." - title: "Linux device detection: Switch to using libusb1 to enumerate devices on system."
description: >
"If you are building for source, the libusb1 headers and library are now required at
compile time."
bug fixes: bug fixes:
@ -65,7 +68,7 @@
- title: "Save to disk: Fix {pubdate} format string in template being ignored" - title: "Save to disk: Fix {pubdate} format string in template being ignored"
tickets: [4140] tickets: [4140]
- title: Replace rotating hourglass with a more efficient bust indicator - title: "Replace rotating hourglass with a more efficient busy indicator."
- title: "PML Input: Make footnotes and sidebars display better" - title: "PML Input: Make footnotes and sidebars display better"
@ -78,6 +81,9 @@
- title: "Fix PocketBook 360 driver on windows when no SD card is inserted" - title: "Fix PocketBook 360 driver on windows when no SD card is inserted"
tickets: [4182] tickets: [4182]
- title: "Fix stopping of a recipe download would prevent it from being re-downloaded until a calibre restart"
tickets: [4007, 4158]
new recipes: new recipes:
- title: Rzeczpospolita OnLine - title: Rzeczpospolita OnLine

View File

@ -9,7 +9,7 @@ __docformat__ = 'restructuredtext en'
from calibre.constants import plugins from calibre.constants import plugins
libusb, libusb_err = plugins['libusb'] libusb, libusb_err = plugins.get('libusb', (None, 'Wrong platform'))
def scan(): def scan():
if libusb_err: if libusb_err:

View File

@ -287,6 +287,14 @@ class Scheduler(QObject):
finally: finally:
self.lock.unlock() self.lock.unlock()
def recipe_download_failed(self, arg):
self.lock.lock()
try:
self.download_queue.remove(arg['urn'])
finally:
self.lock.unlock()
def download_clicked(self, urn): def download_clicked(self, urn):
if urn is not None: if urn is not None:
return self.download(urn) return self.download(urn)

View File

@ -1224,6 +1224,7 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI):
temp_files, fmt, arg = self.conversion_jobs.pop(job) temp_files, fmt, arg = self.conversion_jobs.pop(job)
pt = temp_files[0] pt = temp_files[0]
if job.failed: if job.failed:
self.scheduler.recipe_download_failed(arg)
return self.job_exception(job) return self.job_exception(job)
id = self.library_view.model().add_news(pt.name, arg) id = self.library_view.model().add_news(pt.name, arg)
self.library_view.model().reset() self.library_view.model().reset()