def populate_book_box(self): self._book_box.remove_all_children() for book in self._view_model.books: book_element = BookElement(book) book_element.connect("play-pause-clicked", self._play_book_clicked) book_element.connect("open-book-overview", self._open_book_overview_clicked) book_element.connect("book-removed", self._on_book_removed) book_element.show_all() self._book_box.add(book_element)
def refresh_content(self): """ Refresh all content. """ # First clear the boxes childs = self.book_box.get_children() for element in childs: self.book_box.remove(element) self.populate_author_reader() self.filter_author_reader(tools.get_glib_settings().get_boolean("hide-offline")) for b in db.books(): self.book_box.add(BookElement(b)) self.book_box.show_all() return False