mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 03:04:42 +02:00
Allow right clicking on covers to copy them in the metadata cover download dialog. Fixes #1251793 [[FEATURE REQUEST] copy image for downloaded covers](https://bugs.launchpad.net/calibre/+bug/1251793)
This commit is contained in:
parent
bd009f3e83
commit
1f0f3038c1
1 changed files with 7 additions and 0 deletions
|
|
@ -822,6 +822,7 @@ def show_context_menu(self, point):
|
|||
if idx and idx.isValid() and not idx.data(Qt.UserRole).toPyObject():
|
||||
m = QMenu()
|
||||
m.addAction(QIcon(I('view.png')), _('View this cover at full size'), self.show_cover)
|
||||
m.addAction(QIcon(I('edit-copy.png')), _('Copy this cover to clipboard'), self.copy_cover)
|
||||
m.exec_(QCursor.pos())
|
||||
|
||||
def show_cover(self):
|
||||
|
|
@ -832,6 +833,12 @@ def show_cover(self):
|
|||
d = ImageView(self, pmap, unicode(idx.data(Qt.DisplayRole).toString()), geom_name='metadata_download_cover_popup_geom')
|
||||
d(use_exec=True)
|
||||
|
||||
def copy_cover(self):
|
||||
idx = self.currentIndex()
|
||||
pmap = self.model().cover_pixmap(idx)
|
||||
if pmap is not None:
|
||||
QApplication.clipboard().setPixmap(pmap)
|
||||
|
||||
# }}}
|
||||
|
||||
class CoversWidget(QWidget): # {{{
|
||||
|
|
|
|||
Loading…
Reference in a new issue