mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Book details window: Double clicking on the cover now shows it in the default system image viewer. Fixes #1901379 [[Enhancement] Add ability to open cover by double clicking on it in the Book details window](https://bugs.launchpad.net/calibre/+bug/1901379)
This commit is contained in:
parent
ae222c64f3
commit
3e9c653b8a
@ -39,6 +39,10 @@ class Cover(CoverView):
|
||||
def choose_open_with(self):
|
||||
self.choose_open_with_requested.emit()
|
||||
|
||||
def mouseDoubleClickEvent(self, ev):
|
||||
ev.accept()
|
||||
self.open_with_requested.emit(None)
|
||||
|
||||
|
||||
class Configure(Dialog):
|
||||
|
||||
|
@ -7,16 +7,17 @@ __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import functools
|
||||
|
||||
from PyQt5.Qt import (
|
||||
QAction, QApplication, QIcon, QLabel, QMenu, QPainter, QSizePolicy,
|
||||
QSplitter, QStackedWidget, QStatusBar, QStyle, QStyleOption, Qt, QTabBar, QTimer,
|
||||
QAction, QApplication, QIcon, QLabel, QMenu, QPainter, QSizePolicy, QSplitter,
|
||||
QStackedWidget, QStatusBar, QStyle, QStyleOption, Qt, QTabBar, QTimer,
|
||||
QToolButton, QVBoxLayout, QWidget
|
||||
)
|
||||
|
||||
from calibre.constants import __appname__, get_version, ismacos
|
||||
from calibre.customize.ui import find_plugin
|
||||
from calibre.gui2 import config, error_dialog, gprefs, is_widescreen, open_url
|
||||
from calibre.gui2 import (
|
||||
config, error_dialog, gprefs, is_widescreen, open_local_file, open_url
|
||||
)
|
||||
from calibre.gui2.book_details import BookDetails
|
||||
from calibre.gui2.layout_menu import LayoutMenu
|
||||
from calibre.gui2.library.alternate_views import GridView
|
||||
@ -731,6 +732,9 @@ class LayoutMixin(object): # {{{
|
||||
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:
|
||||
open_local_file(cpath)
|
||||
return
|
||||
from calibre.gui2.open_with import run_program
|
||||
run_program(entry, cpath, self)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user