From 3f2e08ba67e6507a8634ae177ae0d980efaf0eb8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Mar 2010 21:03:32 -0700 Subject: [PATCH] News download scheduler: Don't tru to download news when no active internet connection is present (linux/windows only) --- src/calibre/gui2/dialogs/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/dialogs/scheduler.py b/src/calibre/gui2/dialogs/scheduler.py index 5aee71d7c6..d11344207f 100644 --- a/src/calibre/gui2/dialogs/scheduler.py +++ b/src/calibre/gui2/dialogs/scheduler.py @@ -18,6 +18,7 @@ from calibre.gui2 import config as gconf, error_dialog from calibre.web.feeds.recipes.model import RecipeModel from calibre.ptempfile import PersistentTemporaryFile from calibre.utils.date import utcnow +from calibre.utils.network import internet_connected class SchedulerDialog(QDialog, Ui_Dialog): @@ -304,6 +305,8 @@ class Scheduler(QObject): self.download(urn) def download(self, urn): + if not internet_connected(): + return self.lock.lock() doit = urn not in self.download_queue self.lock.unlock()