Example #1
0
 def show_cover(self):
     idx = self.currentIndex()
     pmap = self.model().cover_pixmap(idx)
     if pmap is None and idx.row() == 0:
         pmap = self.model().cc
     if pmap is not None:
         from calibre.gui2.image_popup import ImageView
         d = ImageView(self, pmap, unicode_type(idx.data(Qt.ItemDataRole.DisplayRole) or ''), geom_name='metadata_download_cover_popup_geom')
         d(use_exec=True)
Example #2
0
 def bd_open_cover_with(self, book_id, entry):
     cpath = self.current_db.new_api.format_abspath(book_id,
                                                    '__COVER_INTERNAL__')
     if cpath:
         if entry is None:
             pm = QPixmap()
             pm.load(cpath)
             pm.setDevicePixelRatio(self.devicePixelRatioF())
             if pm.isNull():
                 open_local_file(cpath)
             else:
                 from calibre.gui2.image_popup import ImageView
                 iv = ImageView(QApplication.instance().focusWindow(),
                                pm,
                                QUrl.fromLocalFile(cpath),
                                geom_name='book_details_image_view')
                 iv(use_exec=True)
             return
         from calibre.gui2.open_with import run_program
         run_program(entry, cpath, self)