Browser viewer: Fix Go to Location not working for positions. Fixes #1920250 [[Content server viewer] Error when trying to go to position in book](https://bugs.launchpad.net/calibre/+bug/1920250)

This commit is contained in:
Kovid Goyal 2021-03-22 11:25:02 +05:30
parent 1387cfc39f
commit 69261e96f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
# License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net> # License: GPL v3 Copyright: 2016, Kovid Goyal <kovid at kovidgoyal.net>
from __python__ import bound_methods, hash_literals from __python__ import bound_methods, hash_literals
import traceback
from elementmaker import E from elementmaker import E
from gettext import gettext as _ from gettext import gettext as _
@ -125,7 +126,7 @@ def create_location_overlay(current_position_data, book, overlay, container):
ui_operations.goto_book_position(float(src)) ui_operations.goto_book_position(float(src))
except: except:
error_dialog(_('Not a valid book position'), _( error_dialog(_('Not a valid book position'), _(
'{} is not a valid book position').format(src)) '{} is not a valid book position').format(src), traceback.format_exc())
else: else:
overlay.hide() overlay.hide()

View File

@ -72,7 +72,7 @@ class ReadUI:
ui_operations.goto_cfi = self.goto_cfi.bind(self) ui_operations.goto_cfi = self.goto_cfi.bind(self)
ui_operations.goto_frac = self.goto_frac.bind(self) ui_operations.goto_frac = self.goto_frac.bind(self)
ui_operations.goto_book_position = self.goto_book_position.bind(self) ui_operations.goto_book_position = self.goto_book_position.bind(self)
ui_operations.goto_book_position = self.goto_reference.bind(self) ui_operations.goto_reference = self.goto_reference.bind(self)
ui_operations.delete_book = self.delete_book.bind(self) ui_operations.delete_book = self.delete_book.bind(self)
ui_operations.focus_iframe = self.focus_iframe.bind(self) ui_operations.focus_iframe = self.focus_iframe.bind(self)
ui_operations.toggle_toc = self.toggle_toc.bind(self) ui_operations.toggle_toc = self.toggle_toc.bind(self)