mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Bulk metadata edit: option to not refresh after edit
Bulk metadata edit: Add a checkbox to prevent the refreshing of the book list after the bulk edit. This means that the book list will not be resorted and any existing search/virtual library will not be refreshed. Useful if you have a large library as the refresh can be slow.
This commit is contained in:
parent
b18b6e98b9
commit
278a13abc3
@ -110,6 +110,7 @@ defs['bd_overlay_cover_size'] = False
|
|||||||
defs['tags_browser_category_icons'] = {}
|
defs['tags_browser_category_icons'] = {}
|
||||||
defs['cover_browser_reflections'] = True
|
defs['cover_browser_reflections'] = True
|
||||||
defs['extra_row_spacing'] = 0
|
defs['extra_row_spacing'] = 0
|
||||||
|
defs['refresh_book_list_on_bulk_edit'] = True
|
||||||
del defs
|
del defs
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ from functools import partial
|
|||||||
|
|
||||||
from PyQt4.Qt import QMenu, QModelIndex, QTimer, QIcon
|
from PyQt4.Qt import QMenu, QModelIndex, QTimer, QIcon
|
||||||
|
|
||||||
from calibre.gui2 import error_dialog, Dispatcher, question_dialog
|
from calibre.gui2 import error_dialog, Dispatcher, question_dialog, gprefs
|
||||||
from calibre.gui2.dialogs.metadata_bulk import MetadataBulkDialog
|
from calibre.gui2.dialogs.metadata_bulk import MetadataBulkDialog
|
||||||
from calibre.gui2.dialogs.confirm_delete import confirm
|
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||||
from calibre.gui2.dialogs.device_category_editor import DeviceCategoryEditor
|
from calibre.gui2.dialogs.device_category_editor import DeviceCategoryEditor
|
||||||
@ -366,8 +366,11 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
self.gui.tags_view.blockSignals(False)
|
self.gui.tags_view.blockSignals(False)
|
||||||
if changed:
|
if changed:
|
||||||
m = self.gui.library_view.model()
|
m = self.gui.library_view.model()
|
||||||
|
if gprefs['refresh_book_list_on_bulk_edit']:
|
||||||
m.refresh(reset=False)
|
m.refresh(reset=False)
|
||||||
m.research()
|
m.research()
|
||||||
|
else:
|
||||||
|
m.refresh_ids(book_ids)
|
||||||
self.gui.tags_view.recount()
|
self.gui.tags_view.recount()
|
||||||
if self.gui.cover_flow:
|
if self.gui.cover_flow:
|
||||||
self.gui.cover_flow.dataChanged()
|
self.gui.cover_flow.dataChanged()
|
||||||
|
@ -317,6 +317,8 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
|
|||||||
Ui_MetadataBulkDialog.__init__(self)
|
Ui_MetadataBulkDialog.__init__(self)
|
||||||
self.model = model
|
self.model = model
|
||||||
self.db = model.db
|
self.db = model.db
|
||||||
|
self.refresh_book_list.setChecked(gprefs['refresh_book_list_on_bulk_edit'])
|
||||||
|
self.refresh_book_list.toggled.connect(self.save_refresh_booklist)
|
||||||
self.ids = [self.db.id(r) for r in rows]
|
self.ids = [self.db.id(r) for r in rows]
|
||||||
self.box_title.setText('<p>' +
|
self.box_title.setText('<p>' +
|
||||||
_('Editing meta information for <b>%d books</b>') %
|
_('Editing meta information for <b>%d books</b>') %
|
||||||
@ -380,6 +382,9 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
|
|||||||
self.authors.setFocus(Qt.OtherFocusReason)
|
self.authors.setFocus(Qt.OtherFocusReason)
|
||||||
self.exec_()
|
self.exec_()
|
||||||
|
|
||||||
|
def save_refresh_booklist(self, *args):
|
||||||
|
gprefs['refresh_book_list_on_bulk_edit'] = bool(self.refresh_book_list.isChecked())
|
||||||
|
|
||||||
def save_state(self, *args):
|
def save_state(self, *args):
|
||||||
gprefs['bulk_metadata_window_geometry'] = \
|
gprefs['bulk_metadata_window_geometry'] = \
|
||||||
bytearray(self.saveGeometry())
|
bytearray(self.saveGeometry())
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>950</width>
|
<width>950</width>
|
||||||
<height>576</height>
|
<height>577</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
@ -1113,7 +1113,7 @@ not multiple and the destination field is multiple</string>
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>934</width>
|
<width>934</width>
|
||||||
<height>213</height>
|
<height>256</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="testgrid">
|
<layout class="QGridLayout" name="testgrid">
|
||||||
@ -1170,6 +1170,20 @@ not multiple and the destination field is multiple</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="refresh_book_list">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>If enabled, the book list will be re-sorted and any existing
|
||||||
|
search or Virtual LIbrary will be refreshed after the edit
|
||||||
|
is completed. This can be slow on large libraries.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Refresh book list after edit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="button_box">
|
<widget class="QDialogButtonBox" name="button_box">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -1180,6 +1194,8 @@ not multiple and the destination field is multiple</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
@ -1241,7 +1257,6 @@ not multiple and the destination field is multiple</string>
|
|||||||
<tabstop>scrollArea</tabstop>
|
<tabstop>scrollArea</tabstop>
|
||||||
<tabstop>central_widget</tabstop>
|
<tabstop>central_widget</tabstop>
|
||||||
<tabstop>query_field</tabstop>
|
<tabstop>query_field</tabstop>
|
||||||
<tabstop>button_box</tabstop>
|
|
||||||
<tabstop>save_button</tabstop>
|
<tabstop>save_button</tabstop>
|
||||||
<tabstop>remove_button</tabstop>
|
<tabstop>remove_button</tabstop>
|
||||||
<tabstop>search_field</tabstop>
|
<tabstop>search_field</tabstop>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user