mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04: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
@ -822,6 +822,7 @@ class CoversView(QListView): # {{{
|
||||
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 @@ class CoversView(QListView): # {{{
|
||||
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…
x
Reference in New Issue
Block a user