Make quickview survive changing the library.

This commit is contained in:
Charles Haley 2011-06-27 18:18:01 +01:00
parent 2930304cd8
commit 7f1905b779
2 changed files with 12 additions and 0 deletions

View File

@ -38,3 +38,6 @@ class ShowQuickviewAction(InterfaceAction):
Quickview(self.gui, self.gui.library_view, index) Quickview(self.gui, self.gui.library_view, index)
self.current_instance.show() self.current_instance.show()
def library_changed(self, db):
if self.current_instance and not self.current_instance.is_closed:
self.current_instance.set_database(db)

View File

@ -108,6 +108,15 @@ class Quickview(QDialog, Ui_Quickview):
self.search_button.clicked.connect(self.do_search) self.search_button.clicked.connect(self.do_search)
view.model().new_bookdisplay_data.connect(self.book_was_changed) view.model().new_bookdisplay_data.connect(self.book_was_changed)
def set_database(self, db):
self.db = db
self.items.blockSignals(True)
self.books_table.blockSignals(True)
self.items.clear()
self.books_table.setRowCount(0)
self.books_table.blockSignals(False)
self.items.blockSignals(False)
# search button # search button
def do_search(self): def do_search(self):
if self.last_search is not None: if self.last_search is not None: