From 0d52b87a558e2cde56705ef37a8490be33b958c6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Dec 2010 17:30:18 -0700 Subject: [PATCH 1/2] Fix #7786 (Feedback when installing new plugins) --- src/calibre/gui2/preferences/plugins.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/preferences/plugins.py b/src/calibre/gui2/preferences/plugins.py index 388227e438..d493b615b5 100644 --- a/src/calibre/gui2/preferences/plugins.py +++ b/src/calibre/gui2/preferences/plugins.py @@ -151,6 +151,7 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): self._plugin_model.populate() self._plugin_model.reset() self.changed_signal.emit() + self.plugin_path.setText('') else: error_dialog(self, _('No valid plugin path'), _('%s is not a valid plugin path')%path).exec_() From dbff870b893a19515cbd3ad3f4004e11735e5893 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 6 Dec 2010 18:30:34 -0700 Subject: [PATCH 2/2] Fix #7716 (Edit meta Information - cover download crash - os x) --- src/calibre/gui2/dialogs/metadata_single.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index fec58a74f6..3205b1d23c 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -8,8 +8,9 @@ add/remove formats import os, re, time, traceback, textwrap from functools import partial +from threading import Thread -from PyQt4.Qt import SIGNAL, QObject, Qt, QTimer, QThread, QDate, \ +from PyQt4.Qt import SIGNAL, QObject, Qt, QTimer, QDate, \ QPixmap, QListWidgetItem, QDialog, pyqtSignal, QMessageBox, QIcon, \ QPushButton @@ -34,9 +35,12 @@ from calibre.gui2.preferences.social import SocialMetadata from calibre.gui2.custom_column_widgets import populate_metadata_page from calibre import strftime -class CoverFetcher(QThread): # {{{ +class CoverFetcher(Thread): # {{{ def __init__(self, username, password, isbn, timeout, title, author): + Thread.__init__(self) + self.daemon = True + self.username = username.strip() if username else username self.password = password.strip() if password else password self.timeout = timeout @@ -44,8 +48,7 @@ class CoverFetcher(QThread): # {{{ self.title = title self.needs_isbn = False self.author = author - QThread.__init__(self) - self.exception = self.traceback = self.cover_data = None + self.exception = self.traceback = self.cover_data = self.errors = None def run(self): try: @@ -238,20 +241,20 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog): self.timeout, title, author) self.cover_fetcher.start() self._hangcheck = QTimer(self) - self.connect(self._hangcheck, SIGNAL('timeout()'), self.hangcheck) + self._hangcheck.timeout.connect(self.hangcheck, + type=Qt.QueuedConnection) self.cf_start_time = time.time() self.pi.start(_('Downloading cover...')) self._hangcheck.start(100) def hangcheck(self): - if not self.cover_fetcher.isFinished() and \ + if self.cover_fetcher.is_alive() and \ time.time()-self.cf_start_time < self.COVER_FETCH_TIMEOUT: return self._hangcheck.stop() try: - if self.cover_fetcher.isRunning(): - self.cover_fetcher.terminate() + if self.cover_fetcher.is_alive(): error_dialog(self, _('Cannot fetch cover'), _('Could not fetch cover.
')+ _('The download timed out.')).exec_()