mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Store, Show dialog when no books are found.
This commit is contained in:
parent
6504e80404
commit
c0a1ba448e
@ -93,6 +93,9 @@ class Matches(QAbstractItemModel):
|
||||
else:
|
||||
return None
|
||||
|
||||
def has_results(self):
|
||||
return len(self.matches) > 0
|
||||
|
||||
def filter_results(self):
|
||||
self.layoutAboutToBeChanged.emit()
|
||||
if self.query:
|
||||
|
@ -11,7 +11,7 @@ from random import shuffle
|
||||
|
||||
from PyQt4.Qt import (QDialog, QTimer, QCheckBox, QVBoxLayout)
|
||||
|
||||
from calibre.gui2 import JSONConfig
|
||||
from calibre.gui2 import JSONConfig, info_dialog
|
||||
from calibre.gui2.progress_indicator import ProgressIndicator
|
||||
from calibre.gui2.store.search.download_thread import SearchThreadPool, SearchThread
|
||||
from calibre.gui2.store.search.search_ui import Ui_Dialog
|
||||
@ -187,6 +187,11 @@ class SearchDialog(QDialog, Ui_Dialog):
|
||||
if res:
|
||||
self.results_view.model().add_result(res, store_plugin)
|
||||
|
||||
if not self.checker.isActive():
|
||||
if 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)
|
||||
|
||||
|
||||
def open_store(self, index):
|
||||
result = self.results_view.model().get_result(index)
|
||||
self.store_plugins[result.store_name].open(self, result.detail_item)
|
||||
|
Loading…
x
Reference in New Issue
Block a user