mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit metadata dialog: When clicking Next and Previous preserve the current tab of the edit comments widget. Fixes #1467129 [[Enhancement] HTML View in Metadata](https://bugs.launchpad.net/calibre/+bug/1467129)
This commit is contained in:
parent
7ac8bf12b7
commit
0c88e6c5e2
@ -730,6 +730,14 @@ class Editor(QWidget): # {{{
|
||||
self.editor.html = unicode(self.code_edit.toPlainText())
|
||||
self.source_dirty = False
|
||||
|
||||
@dynamic_property
|
||||
def tab(self):
|
||||
def fget(self):
|
||||
return 'code' if self.tabs.currentWidget() is self.code_edit else 'wyswyg'
|
||||
def fset(self, val):
|
||||
self.tabs.setCurrentWidget(self.code_edit if val == 'code' else self.wyswyg)
|
||||
return property(fget=fget, fset=fset)
|
||||
|
||||
def wyswyg_dirtied(self, *args):
|
||||
self.wyswyg_dirty = True
|
||||
|
||||
|
@ -527,6 +527,7 @@ class MetadataSingleDialogBase(ResizableDialog):
|
||||
# break_cycles has already been called, don't know why this should
|
||||
# happen but a user reported it
|
||||
return True
|
||||
self.comments_tab_at_apply = self.comments.tab
|
||||
for widget in self.basic_metadata_widgets:
|
||||
try:
|
||||
if hasattr(widget, 'validate_for_commit'):
|
||||
@ -634,6 +635,8 @@ class MetadataSingleDialogBase(ResizableDialog):
|
||||
self.button_box.button(self.button_box.Ok).setDefault(True)
|
||||
self.button_box.button(self.button_box.Ok).setFocus(Qt.OtherFocusReason)
|
||||
self(self.db.id(self.row_list[self.current_row]))
|
||||
if getattr(self, 'comments_tab_at_apply', None) == 'code':
|
||||
self.comments.tab = 'code'
|
||||
|
||||
def break_cycles(self):
|
||||
# Break any reference cycles that could prevent python
|
||||
|
Loading…
x
Reference in New Issue
Block a user