From 70da6dd8522c6ec454e5d07a7212408df742db68 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 24 Apr 2011 00:21:28 -0400 Subject: [PATCH 1/4] Store: Fix no books found dialog showing too often. --- src/calibre/gui2/store/search/search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/store/search/search.py b/src/calibre/gui2/store/search/search.py index 70e92d1756..7ff38c3f31 100644 --- a/src/calibre/gui2/store/search/search.py +++ b/src/calibre/gui2/store/search/search.py @@ -206,7 +206,7 @@ class SearchDialog(QDialog, Ui_Dialog): if res: self.results_view.model().add_result(res, store_plugin) - if not self.results_view.model().has_results(): + if not self.search_pool.threads_running() and not self.results_view.model().has_results(): info_dialog(self, _('No matches'), _('Couldn\'t find any books matching your query.'), show=True, show_copy_button=False) From f4da91d06ab81fc51d5acf494ebc625e20f40507 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 24 Apr 2011 07:33:28 -0400 Subject: [PATCH 2/4] Store: Still open MobileRead dialog even when update cache is canceled. Ensure Cache thread is stopped. --- src/calibre/gui2/store/mobileread/mobileread_plugin.py | 8 ++++---- src/calibre/gui2/store/search/search.py | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/store/mobileread/mobileread_plugin.py b/src/calibre/gui2/store/mobileread/mobileread_plugin.py index 54242ce0b2..271e34a619 100644 --- a/src/calibre/gui2/store/mobileread/mobileread_plugin.py +++ b/src/calibre/gui2/store/mobileread/mobileread_plugin.py @@ -37,10 +37,10 @@ class MobileReadStore(BasicStoreConfig, StorePlugin): d.set_tags(self.config.get('tags', '')) d.exec_() else: - if self.update_cache(parent, 30): - d = MobeReadStoreDialog(self, parent) - d.setWindowTitle(self.name) - d.exec_() + self.update_cache(parent, 30) + d = MobeReadStoreDialog(self, parent) + d.setWindowTitle(self.name) + d.exec_() def search(self, query, max_results=10, timeout=60): books = self.get_book_list() diff --git a/src/calibre/gui2/store/search/search.py b/src/calibre/gui2/store/search/search.py index 7ff38c3f31..5654df8ffc 100644 --- a/src/calibre/gui2/store/search/search.py +++ b/src/calibre/gui2/store/search/search.py @@ -247,5 +247,6 @@ class SearchDialog(QDialog, Ui_Dialog): def dialog_closed(self, result): self.results_view.model().closing() self.search_pool.abort() + self.cache_pool.abort() self.save_state() From 3d1e7fe162ae8af4fb88926c9427e7eb4c126259 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 24 Apr 2011 09:47:14 -0400 Subject: [PATCH 3/4] Store: Fix Baen. Missed refactoring to JSON config. --- src/calibre/gui2/store/baen_webscription_plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/store/baen_webscription_plugin.py b/src/calibre/gui2/store/baen_webscription_plugin.py index d4f7924851..5be7e9c161 100644 --- a/src/calibre/gui2/store/baen_webscription_plugin.py +++ b/src/calibre/gui2/store/baen_webscription_plugin.py @@ -24,10 +24,9 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class BaenWebScriptionStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - settings = self.get_settings() url = 'http://www.webscription.net/' - if external or settings.get(self.name + '_open_external', False): + if external or self.config.get('open_external', False): if detail_item: url = url + detail_item open_url(QUrl(url_slash_cleaner(url))) @@ -37,7 +36,7 @@ class BaenWebScriptionStore(BasicStoreConfig, StorePlugin): detail_url = url + detail_item d = WebStoreDialog(self.gui, url, parent, detail_url) d.setWindowTitle(self.name) - d.set_tags(settings.get(self.name + '_tags', '')) + d.set_tags(self.config.get('tags', '')) d.exec_() def search(self, query, max_results=10, timeout=60): From 27b2b3c31dff54f29a711218746255931846920c Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 24 Apr 2011 09:49:53 -0400 Subject: [PATCH 4/4] Store: Remove unused API call. --- src/calibre/gui2/store/__init__.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/calibre/gui2/store/__init__.py b/src/calibre/gui2/store/__init__.py index c95d794975..fd2fb965a9 100644 --- a/src/calibre/gui2/store/__init__.py +++ b/src/calibre/gui2/store/__init__.py @@ -161,18 +161,6 @@ class StorePlugin(object): # {{{ ''' return False - def get_settings(self): - ''' - This is only useful for plugins that implement - :attr:`config_widget` that is the only way to save - settings. This is used by plugins to get the saved - settings and apply when necessary. - - :return: A dictionary filled with the settings used - by this plugin. - ''' - raise NotImplementedError() - def do_genesis(self): self.genesis()