mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Metadata review dialog: Add merge comments action
This commit is contained in:
parent
e42ff008ba
commit
88b73af727
@ -508,6 +508,14 @@ class CompareSingle(QWidget):
|
||||
m.actions()[0].setIcon(button.icon())
|
||||
m.addAction(_('Merge tags')).triggered.connect(self.merge_tags)
|
||||
m.actions()[1].setIcon(QIcon.ic('merge.png'))
|
||||
elif field == 'comments':
|
||||
button.m = m = QMenu(button)
|
||||
button.setMenu(m)
|
||||
button.setPopupMode(QToolButton.ToolButtonPopupMode.DelayedPopup)
|
||||
m.addAction(button.toolTip()).triggered.connect(button.click)
|
||||
m.actions()[0].setIcon(button.icon())
|
||||
m.addAction(_('Merge Comments')).triggered.connect(self.merge_comments)
|
||||
m.actions()[1].setIcon(QIcon.ic('merge.png'))
|
||||
|
||||
if cls is CoverView:
|
||||
neww.zoom_requested.connect(self.zoom_requested)
|
||||
@ -560,6 +568,12 @@ class CompareSingle(QWidget):
|
||||
if extra:
|
||||
neww.value = val + extra
|
||||
|
||||
def merge_comments(self):
|
||||
widgets = self.widgets['comments']
|
||||
neww, oldw = widgets[:2]
|
||||
val = oldw.current_val
|
||||
neww.current_val = (neww.current_val or '') + '\n\n' + (val or '')
|
||||
|
||||
def __call__(self, oldmi, newmi):
|
||||
self.current_mi = newmi
|
||||
self.initial_vals = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user