Fix #2086143 [[Enhancement] Please add icons to right click menu shown when right clicking the format in the Edit metadata window](https://bugs.launchpad.net/calibre/+bug/2086143)

This commit is contained in:
Kovid Goyal 2024-10-31 13:07:01 +05:30
parent b1e1b816d7
commit 17406e009d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -821,6 +821,7 @@ class OrigAction(QAction):
def __init__(self, fmt, parent):
self.fmt = fmt.replace('ORIGINAL_', '')
QAction.__init__(self, _('Restore %s from the original')%self.fmt, parent)
self.setIcon(QIcon.ic('edit-undo.png'))
self.triggered.connect(self._triggered)
def _triggered(self):
@ -834,6 +835,7 @@ class ViewAction(QAction):
def __init__(self, item, parent):
self.item = item
QAction.__init__(self, _('&View {} format').format(item.ext.upper()), parent)
self.setIcon(QIcon.ic('view.png'))
self.triggered.connect(self._triggered)
def _triggered(self):
@ -847,6 +849,7 @@ class EditAction(QAction):
def __init__(self, item, parent):
self.item = item
QAction.__init__(self, _('&Edit')+' '+item.ext.upper(), parent)
self.setIcon(QIcon.ic('edit_book.png'))
self.triggered.connect(self._triggered)
def _triggered(self):
@ -893,7 +896,7 @@ class FormatList(_FormatList):
action = OrigAction(fmt, cm)
action.restore_fmt.connect(self.restore_fmt)
cm.addAction(action)
ac = QAction(_('Open book folder'), cm)
ac = QAction(QIcon.ic('document_open.png'), _('Open book folder'), cm)
ac.triggered.connect(self.open_book_folder)
cm.addAction(ac)
cm.popup(event.globalPos())