diff --git a/manual/gui.rst b/manual/gui.rst index ddfb9c42bd..9d74c62ac1 100644 --- a/manual/gui.rst +++ b/manual/gui.rst @@ -716,6 +716,8 @@ calibre has several keyboard shortcuts to save you time and mouse movement. Thes - Edit book * - :kbd:`V` - View + * - :kbd:`Shift+V` + - View last read book * - :kbd:`Alt+V/Cmd+V in macOS` - View specific format * - :kbd:`Alt+Shift+J` diff --git a/src/calibre/gui2/actions/view.py b/src/calibre/gui2/actions/view.py index 6012debec5..d6cd999cff 100644 --- a/src/calibre/gui2/actions/view.py +++ b/src/calibre/gui2/actions/view.py @@ -63,6 +63,10 @@ class ViewAction(InterfaceAction): self.clear_history_action = cm('clear history', _('Clear recently viewed list'), triggered=self.clear_history) self.history_actions = [self.clear_sep1] + self.action_view_last_read = ac = self.create_action( + spec=(_('Continue reading previous book'), None, _('Continue reading the last opened book'), 'shift+v'), attr='action_view_last_read') + ac.triggered.connect(self.view_last_read) + self.gui.addAction(ac) def initialization_complete(self): self.build_menus(self.gui.current_db) @@ -82,6 +86,12 @@ class ViewAction(InterfaceAction): ac.view_historical.connect(self.view_historical) self.history_actions.append(ac) + def view_last_read(self): + history = self.gui.current_db.new_api.pref('gui_view_history', []) + for book_id, title in history: + self.view_historical(book_id) + break + def browse_annots(self): self.gui.iactions['Browse Annotations'].show_browser()