Book list should track edit metadata dialog

Fix regression in 1.3 that caused the book list to not track the
ecurrent book when using Next/Previous in the edit metadata dialog.
This commit is contained in:
Kovid Goyal 2013-09-15 08:56:47 +05:30
parent ac2dd2f7a2
commit 615cd01acb

View File

@ -296,7 +296,12 @@ class EditMetadataAction(InterfaceAction):
list(range(self.gui.library_view.model().rowCount(QModelIndex())))
current_row = row_list.index(cr)
with self.gui.library_view.preserve_state():
view = self.gui.library_view.alternate_views.current_view
try:
hpos = view.horizontalScrollBar().value()
except Exception:
hpos = 0
changed, rows_to_refresh = self.do_edit_metadata(row_list, current_row)
m = self.gui.library_view.model()
@ -311,6 +316,11 @@ class EditMetadataAction(InterfaceAction):
self.gui.cover_flow.dataChanged()
m.current_changed(current, previous)
self.gui.tags_view.recount()
if self.gui.library_view.alternate_views.current_view is view:
if hasattr(view, 'restore_hpos'):
view.restore_hpos(hpos)
else:
view.horizontalScrollBar().setValue(hpos)
def do_edit_metadata(self, row_list, current_row):
from calibre.gui2.metadata.single import edit_metadata