Fix #4220 (E-Book Viewer position in book navigation is broken)

This commit is contained in:
Kovid Goyal 2009-12-15 09:22:24 -07:00
parent 2042052a92
commit 6e25583bc0
2 changed files with 14 additions and 11 deletions

View File

@ -10,7 +10,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
class FinancialTimes(BasicNewsRecipe): class FinancialTimes(BasicNewsRecipe):
title = u'Financial Times' title = u'Financial Times'
__author__ = 'Darko Miletic' __author__ = 'Darko Miletic and Sujata Raman'
description = 'Financial world news' description = 'Financial world news'
oldest_article = 2 oldest_article = 2
language = 'en' language = 'en'

View File

@ -228,7 +228,7 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
self.connect(self.action_bookmark, SIGNAL('triggered(bool)'), self.bookmark) self.connect(self.action_bookmark, SIGNAL('triggered(bool)'), self.bookmark)
self.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward) self.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
self.connect(self.action_preferences, SIGNAL('triggered(bool)'), lambda x: self.view.config(self)) self.connect(self.action_preferences, SIGNAL('triggered(bool)'), lambda x: self.view.config(self))
self.connect(self.pos, SIGNAL('valueChanged(double)'), self.goto_page) self.pos.editingFinished.connect(self.goto_page_num)
self.connect(self.vertical_scrollbar, SIGNAL('valueChanged(int)'), self.connect(self.vertical_scrollbar, SIGNAL('valueChanged(int)'),
lambda x: self.goto_page(x/100.)) lambda x: self.goto_page(x/100.))
self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'), self.find) self.connect(self.search, SIGNAL('search(PyQt_PyObject, PyQt_PyObject)'), self.find)
@ -319,6 +319,9 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
if pos is not None: if pos is not None:
self.goto_page(pos) self.goto_page(pos)
def goto_page_num(self):
num = self.pos.value()
self.goto_page(num)
def forward(self, x): def forward(self, x):
pos = self.history.forward() pos = self.history.forward()