mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
c1720a1447
@ -161,18 +161,6 @@ class StorePlugin(object): # {{{
|
|||||||
'''
|
'''
|
||||||
return False
|
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):
|
def do_genesis(self):
|
||||||
self.genesis()
|
self.genesis()
|
||||||
|
|
||||||
|
@ -24,10 +24,9 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog
|
|||||||
class BaenWebScriptionStore(BasicStoreConfig, StorePlugin):
|
class BaenWebScriptionStore(BasicStoreConfig, StorePlugin):
|
||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
settings = self.get_settings()
|
|
||||||
url = 'http://www.webscription.net/'
|
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:
|
if detail_item:
|
||||||
url = url + detail_item
|
url = url + detail_item
|
||||||
open_url(QUrl(url_slash_cleaner(url)))
|
open_url(QUrl(url_slash_cleaner(url)))
|
||||||
@ -37,7 +36,7 @@ class BaenWebScriptionStore(BasicStoreConfig, StorePlugin):
|
|||||||
detail_url = url + detail_item
|
detail_url = url + detail_item
|
||||||
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
d = WebStoreDialog(self.gui, url, parent, detail_url)
|
||||||
d.setWindowTitle(self.name)
|
d.setWindowTitle(self.name)
|
||||||
d.set_tags(settings.get(self.name + '_tags', ''))
|
d.set_tags(self.config.get('tags', ''))
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
|
@ -37,10 +37,10 @@ class MobileReadStore(BasicStoreConfig, StorePlugin):
|
|||||||
d.set_tags(self.config.get('tags', ''))
|
d.set_tags(self.config.get('tags', ''))
|
||||||
d.exec_()
|
d.exec_()
|
||||||
else:
|
else:
|
||||||
if self.update_cache(parent, 30):
|
self.update_cache(parent, 30)
|
||||||
d = MobeReadStoreDialog(self, parent)
|
d = MobeReadStoreDialog(self, parent)
|
||||||
d.setWindowTitle(self.name)
|
d.setWindowTitle(self.name)
|
||||||
d.exec_()
|
d.exec_()
|
||||||
|
|
||||||
def search(self, query, max_results=10, timeout=60):
|
def search(self, query, max_results=10, timeout=60):
|
||||||
books = self.get_book_list()
|
books = self.get_book_list()
|
||||||
|
@ -206,7 +206,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
if res:
|
if res:
|
||||||
self.results_view.model().add_result(res, store_plugin)
|
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)
|
info_dialog(self, _('No matches'), _('Couldn\'t find any books matching your query.'), show=True, show_copy_button=False)
|
||||||
|
|
||||||
|
|
||||||
@ -247,5 +247,6 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
def dialog_closed(self, result):
|
def dialog_closed(self, result):
|
||||||
self.results_view.model().closing()
|
self.results_view.model().closing()
|
||||||
self.search_pool.abort()
|
self.search_pool.abort()
|
||||||
|
self.cache_pool.abort()
|
||||||
self.save_state()
|
self.save_state()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user