Skip to content

Commit

Permalink
DRYer
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Aug 7, 2023
1 parent 956ef2d commit 2f55fd3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/calibre/gui2/actions/edit_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
from calibre.utils.localization import ngettext
from polyglot.builtins import iteritems

DATA_FILES_ICON_NAME = 'unpack-book.png'


class EditMetadataAction(InterfaceAction):

Expand Down Expand Up @@ -106,7 +108,7 @@ def genesis(self):
shortcut=_('M'), triggered=self.merge_books)
self.action_merge.setMenu(mb)
self.action_manage_data_files = cm(
'manage_data_files', _('Manage data files'), icon='unpack-book.png', triggered=self.manage_data_files)
'manage_data_files', _('Manage data files'), icon=DATA_FILES_ICON_NAME, triggered=self.manage_data_files)

self.qaction.triggered.connect(self.edit_metadata)
ac = QAction(_('Copy URL to show book in calibre'), self.gui)
Expand Down
3 changes: 2 additions & 1 deletion src/calibre/gui2/metadata/single.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def setupUi(self, *args): # {{{
self.prev_button = QPushButton(QIcon.ic('back.png'), _('Previous'),
self)
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
self.data_files_button = QPushButton(QIcon.ic('unpack-book.png'), _('Data files'), self)
from calibre.gui2.actions.edit_metadata import DATA_FILES_ICON_NAME
self.data_files_button = QPushButton(QIcon.ic(DATA_FILES_ICON_NAME), _('Data files'), self)
self.data_files_button.setShortcut(QKeySequence('Alt+Space'))
self.data_files_button.setToolTip(_('Manage the extra data files associated with this book [{}]').format(
self.data_files_button.shortcut().toString(QKeySequence.SequenceFormat.NativeText)))
Expand Down

0 comments on commit 2f55fd3

Please sign in to comment.