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
@ -92,6 +92,9 @@ class Matches(QAbstractItemModel):
|
|||||||
return self.matches[row]
|
return self.matches[row]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def has_results(self):
|
||||||
|
return len(self.matches) > 0
|
||||||
|
|
||||||
def filter_results(self):
|
def filter_results(self):
|
||||||
self.layoutAboutToBeChanged.emit()
|
self.layoutAboutToBeChanged.emit()
|
||||||
|
@ -11,7 +11,7 @@ from random import shuffle
|
|||||||
|
|
||||||
from PyQt4.Qt import (QDialog, QTimer, QCheckBox, QVBoxLayout)
|
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.progress_indicator import ProgressIndicator
|
||||||
from calibre.gui2.store.search.download_thread import SearchThreadPool, SearchThread
|
from calibre.gui2.store.search.download_thread import SearchThreadPool, SearchThread
|
||||||
from calibre.gui2.store.search.search_ui import Ui_Dialog
|
from calibre.gui2.store.search.search_ui import Ui_Dialog
|
||||||
@ -186,6 +186,11 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
res, store_plugin = self.search_pool.get_result()
|
res, store_plugin = self.search_pool.get_result()
|
||||||
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.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):
|
def open_store(self, index):
|
||||||
result = self.results_view.model().get_result(index)
|
result = self.results_view.model().get_result(index)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user