Пример #1
0
 def do_edit_bulk_metadata(self, rows, book_ids):
     # Prevent the TagView from updating due to signals from the database
     self.gui.tags_view.blockSignals(True)
     changed = False
     try:
         current_tab = 0
         while True:
             dialog = MetadataBulkDialog(self.gui, rows,
                                         self.gui.library_view.model(),
                                         current_tab)
             if dialog.changed:
                 changed = True
             if not dialog.do_again:
                 break
             current_tab = dialog.central_widget.currentIndex()
     finally:
         self.gui.tags_view.blockSignals(False)
     if changed:
         m = self.gui.library_view.model()
         m.refresh(reset=False)
         m.research()
         self.gui.tags_view.recount()
         if self.gui.cover_flow:
             self.gui.cover_flow.dataChanged()
         self.gui.library_view.select_rows(book_ids)
Пример #2
0
 def do_edit_bulk_metadata(self, rows, book_ids):
     # Prevent the TagView from updating due to signals from the database
     self.gui.tags_view.blockSignals(True)
     changed = False
     refresh_books = set(book_ids)
     try:
         current_tab = 0
         while True:
             dialog = MetadataBulkDialog(self.gui, rows,
                                         self.gui.library_view.model(),
                                         current_tab, refresh_books)
             if dialog.changed:
                 changed = True
             if not dialog.do_again:
                 break
             current_tab = dialog.central_widget.currentIndex()
     finally:
         self.gui.tags_view.blockSignals(False)
     if changed:
         refresh_books |= dialog.refresh_books
         m = self.gui.library_view.model()
         if gprefs['refresh_book_list_on_bulk_edit']:
             m.refresh(reset=False)
             m.research()
         else:
             m.refresh_ids(refresh_books)
         self.gui.tags_view.recount()
         self.gui.refresh_cover_browser()
         self.gui.library_view.select_rows(book_ids)
Пример #3
0
 def edit_bulk_metadata(self, checked):
     '''
     Edit metadata of selected books in library in bulk.
     '''
     rows = [r.row() for r in \
             self.gui.library_view.selectionModel().selectedRows()]
     m = self.gui.library_view.model()
     ids = [m.id(r) for r in rows]
     if not rows or len(rows) == 0:
         d = error_dialog(self.gui, _('Cannot edit metadata'),
                          _('No books selected'))
         d.exec_()
         return
     # Prevent the TagView from updating due to signals from the database
     self.gui.tags_view.blockSignals(True)
     changed = False
     try:
         current_tab = 0
         while True:
             dialog = MetadataBulkDialog(self.gui, rows,
                                         self.gui.library_view.model(),
                                         current_tab)
             if dialog.changed:
                 changed = True
             if not dialog.do_again:
                 break
             current_tab = dialog.central_widget.currentIndex()
     finally:
         self.gui.tags_view.blockSignals(False)
     if changed:
         m = self.gui.library_view.model()
         m.refresh(reset=False)
         m.research()
         self.gui.tags_view.recount()
         if self.gui.cover_flow:
             self.gui.cover_flow.dataChanged()
         self.gui.library_view.select_rows(ids)