mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When reviewing downloaded metadata, add a button to view the book being reviewed. Fixes #1184546 (View the eBook when reviewing download metadata)
This commit is contained in:
parent
20f476c6fb
commit
1595268b09
@ -229,7 +229,8 @@ class EditMetadataAction(InterfaceAction):
|
|||||||
revert_tooltip=_('Discard the downloaded value for: %s'),
|
revert_tooltip=_('Discard the downloaded value for: %s'),
|
||||||
intro_msg=_('The downloaded metadata is on the left and the original metadata'
|
intro_msg=_('The downloaded metadata is on the left and the original metadata'
|
||||||
' is on the right. If a downloaded value is blank or unknown,'
|
' is on the right. If a downloaded value is blank or unknown,'
|
||||||
' the original value is used.')
|
' the original value is used.'),
|
||||||
|
action_button=(_('&View Book'), I('view.png'), self.gui.iactions['View'].view_historical),
|
||||||
)
|
)
|
||||||
if d.exec_() == d.Accepted:
|
if d.exec_() == d.Accepted:
|
||||||
nid_map = {}
|
nid_map = {}
|
||||||
|
@ -440,6 +440,7 @@ class CompareMany(QDialog):
|
|||||||
reject_all_tooltip=None,
|
reject_all_tooltip=None,
|
||||||
revert_tooltip=None,
|
revert_tooltip=None,
|
||||||
intro_msg=None,
|
intro_msg=None,
|
||||||
|
action_button=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
QDialog.__init__(self, parent)
|
QDialog.__init__(self, parent)
|
||||||
self.l = l = QVBoxLayout()
|
self.l = l = QVBoxLayout()
|
||||||
@ -480,6 +481,11 @@ class CompareMany(QDialog):
|
|||||||
b.setIcon(QIcon(I('minus.png')))
|
b.setIcon(QIcon(I('minus.png')))
|
||||||
if reject_button_tooltip:
|
if reject_button_tooltip:
|
||||||
b.setToolTip(reject_button_tooltip)
|
b.setToolTip(reject_button_tooltip)
|
||||||
|
if action_button is not None:
|
||||||
|
self.acb = b = bb.addButton(action_button[0], bb.ActionRole)
|
||||||
|
b.setIcon(QIcon(action_button[1]))
|
||||||
|
self.action_button_action = action_button[2]
|
||||||
|
b.clicked.connect(self.action_button_clicked)
|
||||||
self.nb = b = bb.addButton(_('&Next') if self.total > 1 else _('&OK'), bb.ActionRole)
|
self.nb = b = bb.addButton(_('&Next') if self.total > 1 else _('&OK'), bb.ActionRole)
|
||||||
b.setIcon(QIcon(I('forward.png' if self.total > 1 else 'ok.png')))
|
b.setIcon(QIcon(I('forward.png' if self.total > 1 else 'ok.png')))
|
||||||
b.clicked.connect(partial(self.next_item, True))
|
b.clicked.connect(partial(self.next_item, True))
|
||||||
@ -498,6 +504,9 @@ class CompareMany(QDialog):
|
|||||||
self.restoreGeometry(geom)
|
self.restoreGeometry(geom)
|
||||||
b.setFocus(Qt.OtherFocusReason)
|
b.setFocus(Qt.OtherFocusReason)
|
||||||
|
|
||||||
|
def action_button_clicked(self):
|
||||||
|
self.action_button_action(self.ids[0])
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
gprefs.set('diff_dialog_geom', bytearray(self.saveGeometry()))
|
gprefs.set('diff_dialog_geom', bytearray(self.saveGeometry()))
|
||||||
super(CompareMany, self).accept()
|
super(CompareMany, self).accept()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user