Skip to content
Permalink
Browse files
Windows: Make recently opened books show up in the jump lists for the…
… viewer and the editor
  • Loading branch information
kovidgoyal committed Feb 1, 2017
1 parent 2353d59 commit ff3cc55f21c4cb650079c1440b81d3d0e5004dfe
Showing with 15 additions and 1 deletion.
  1. +8 −1 src/calibre/gui2/tweak_book/boss.py
  2. +7 −0 src/calibre/gui2/viewer/main.py
@@ -15,7 +15,7 @@
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 @@ def book_opened(self, job):
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 @@ def load_ebook(self, pathtoebook, open_at=None, reopen_at=None):
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)

0 comments on commit ff3cc55

Please sign in to comment.