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):
title = u'Financial Times'
__author__ = 'Darko Miletic'
__author__ = 'Darko Miletic and Sujata Raman'
description = 'Financial world news'
oldest_article = 2
language = 'en'
@ -21,9 +21,9 @@ class FinancialTimes(BasicNewsRecipe):
needs_subscription = True
simultaneous_downloads= 1
delay = 1
LOGIN = 'https://registration.ft.com/registration/barrier/login'
def get_browser(self):
br = BasicNewsRecipe.get_browser()
if self.username is not None and self.password is not None:
@ -33,7 +33,7 @@ class FinancialTimes(BasicNewsRecipe):
br['password'] = self.password
br.submit()
return br
keep_only_tags = [ dict(name='div', attrs={'id':'cont'}) ]
remove_tags_after = dict(name='p', attrs={'class':'copyright'})
remove_tags = [
@ -48,12 +48,12 @@ class FinancialTimes(BasicNewsRecipe):
a{color:#003399;}
.container{font-size:x-small;}
h3{font-size:x-small;color:#003399;}
'''
feeds = [
(u'UK' , u'http://www.ft.com/rss/home/uk' )
,(u'US' , u'http://www.ft.com/rss/home/us' )
,(u'Asia' , u'http://www.ft.com/rss/home/asia' )
,(u'Middle East', u'http://www.ft.com/rss/home/middleeast')
'''
feeds = [
(u'UK' , u'http://www.ft.com/rss/home/uk' )
,(u'US' , u'http://www.ft.com/rss/home/us' )
,(u'Asia' , u'http://www.ft.com/rss/home/asia' )
,(u'Middle East', u'http://www.ft.com/rss/home/middleeast')
]
def preprocess_html(self, soup):

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_forward, SIGNAL('triggered(bool)'), self.forward)
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)'),
lambda x: self.goto_page(x/100.))
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:
self.goto_page(pos)
def goto_page_num(self):
num = self.pos.value()
self.goto_page(num)
def forward(self, x):
pos = self.history.forward()