mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Windows: Make recently opened books show up in the jump lists for the viewer and the editor
This commit is contained in:
parent
2353d5926e
commit
ff3cc55f21
@ -15,7 +15,7 @@ from PyQt5.Qt import (
|
||||
QDialogButtonBox, QIcon, QInputDialog, QUrl, pyqtSignal)
|
||||
|
||||
from calibre import prints, isbytestring
|
||||
from calibre.constants import cache_dir
|
||||
from calibre.constants import cache_dir, iswindows
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory, TemporaryDirectory
|
||||
from calibre.ebooks.oeb.base import urlnormalize
|
||||
from calibre.ebooks.oeb.polish.main import SUPPORTED, tweak_polish
|
||||
@ -342,6 +342,13 @@ class Boss(QObject):
|
||||
recent_books.insert(0, path)
|
||||
tprefs['recent-books'] = recent_books[:10]
|
||||
self.gui.update_recent_books()
|
||||
if iswindows:
|
||||
try:
|
||||
from win32com.shell import shell, shellcon
|
||||
shell.SHAddToRecentDocs(shellcon.SHARD_PATHW, path)
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
if ef:
|
||||
if isinstance(ef, type('')):
|
||||
ef = [ef]
|
||||
|
@ -1000,6 +1000,13 @@ class EbookViewer(MainWindow):
|
||||
pass
|
||||
vh.insert(0, pathtoebook)
|
||||
vprefs.set('viewer_open_history', vh[:50])
|
||||
if iswindows:
|
||||
try:
|
||||
from win32com.shell import shell, shellcon
|
||||
shell.SHAddToRecentDocs(shellcon.SHARD_PATHW, pathtoebook)
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
self.build_recent_menu()
|
||||
self.view.set_book_data(self.iterator)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user