From 577f9d8df1e405efa60b0857a9fdf3182e948b90 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 9 Jun 2012 19:57:11 +0530 Subject: [PATCH 1/5] Updated Birmignham Post --- recipes/birmingham_post.recipe | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/recipes/birmingham_post.recipe b/recipes/birmingham_post.recipe index 0d04667782..ae5d2c9ce9 100644 --- a/recipes/birmingham_post.recipe +++ b/recipes/birmingham_post.recipe @@ -5,11 +5,11 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe): timefmt = '' __author__ = 'Dave Asbury' cover_url = 'http://1.bp.blogspot.com/_GwWyq5eGw9M/S9BHPHxW55I/AAAAAAAAB6Q/iGCWl0egGzg/s320/Birmingham+post+Lite+front.JPG' - oldest_article = 1 - max_articles_per_feed = 20 + oldest_article = 2 + max_articles_per_feed = 12 remove_empty_feeds = True remove_javascript = True - auto_cleanup = True + #auto_cleanup = True language = 'en_GB' @@ -17,9 +17,12 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe): keep_only_tags = [ - #dict(name='h1',attrs={'id' : 'article-headline'}), - #dict(attrs={'class':['article-meta-author','article-meta-date','article main','art-o art-align-center otm-1 ']}), - #dict(name='p') + dict(name='h1',attrs={'id' : 'article-headline'}), + dict(attrs={'class':['article-meta-author','article-meta-date','article main','art-o art-align-center otm-1 ']}), + dict(name='div',attrs={'class' : 'article-image full'}), + dict(attrs={'clas' : 'art-o art-align-center otm-1 '}), + dict(name='div',attrs={'class' : 'article main'}), +#dict(name='p') #dict(attrs={'id' : 'three-col'}) ] remove_tags = [ @@ -28,7 +31,7 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe): ] feeds = [ #(u'News',u'http://www.birminghampost.net/news/rss.xml'), - (u'Local News', u'http://www.birminghampost.net/news/west-midlands-news/rss.xml'), + (u'West Mids. News', u'http://www.birminghampost.net/news/west-midlands-news/rss.xml'), (u'UK News', u'http://www.birminghampost.net/news/uk-news/rss.xml'), (u'Sports',u'http://www.birminghampost.net/midlands-birmingham-sport/rss.xml'), (u'Bloggs & Comments',u'http://www.birminghampost.net/comment/rss.xml') From 9f4cf02f86eb1951a18d20d1b815b159609485f7 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jun 2012 09:20:22 +0530 Subject: [PATCH 2/5] ... --- src/calibre/gui2/preferences/adding.ui | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/preferences/adding.ui b/src/calibre/gui2/preferences/adding.ui index f04d55ff28..0ce78447e0 100644 --- a/src/calibre/gui2/preferences/adding.ui +++ b/src/calibre/gui2/preferences/adding.ui @@ -183,10 +183,17 @@ Author matching is exact. - - Ignore files with the following extensions when automatically adding - - + + + + + Ignore files with the following extensions when automatically adding + + + true + + + From 461f9653862e712e386a7d5697df82b168a3bff0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jun 2012 09:23:07 +0530 Subject: [PATCH 3/5] Update Neue Zurcher Zeitung --- recipes/nzz_ger.recipe | 44 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/recipes/nzz_ger.recipe b/recipes/nzz_ger.recipe index 09e011a1dc..001c8075da 100644 --- a/recipes/nzz_ger.recipe +++ b/recipes/nzz_ger.recipe @@ -1,6 +1,6 @@ __license__ = 'GPL v3' -__copyright__ = '2009-2010, Darko Miletic ' +__copyright__ = '2009-2010, Darko Miletic , 2012 Bernd Leinfelder ' ''' www.nzz.ch @@ -10,7 +10,7 @@ from calibre.web.feeds.recipes import BasicNewsRecipe class Nzz(BasicNewsRecipe): title = 'NZZ Online' - __author__ = 'Darko Miletic' + __author__ = 'Darko Miletic, Bernd Leinfelder' description = 'Laufend aktualisierte Nachrichten, Analysen und Hintergruende zu Politik, Wirtschaft, Kultur und Sport' publisher = 'NZZ AG' category = 'news, politics, nachrichten, Switzerland' @@ -41,31 +41,31 @@ class Nzz(BasicNewsRecipe): ,'publisher' : publisher } - keep_only_tags = [dict(name='div', attrs={'class':'zone'})] - remove_tags_before = dict(name='p', attrs={'class':'dachzeile'}) - remove_tags_after=dict(name='p', attrs={'class':'fussnote'}) + remove_attributes=['width','height','lang'] + remove_tags_before = dict(id='main') + remove_tags_after = dict(id='articleBodyText') remove_tags = [ dict(name=['object','link','base','meta','iframe']) - ,dict(attrs={'id':'content_rectangle_1'}) - ,dict(attrs={'class':['weiterfuehrendeLinks','fussnote','video']}) + ,dict(id='social-media-floater') + ,dict(name='div',attrs={'class':['box']}) + ] feeds = [ - (u'International' , u'http://www.nzz.ch/nachrichten/international?rss=true') - ,(u'Schweiz' , u'http://www.nzz.ch/nachrichten/schweiz?rss=true') - ,(u'Wirtschaft' , u'http://www.nzz.ch/nachrichten/wirtschaft/aktuell?rss=true') - ,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/nachrichten?rss=true') - ,(u'Zuerich' , u'http://www.nzz.ch/nachrichten/zuerich?rss=true') - ,(u'Sport' , u'http://www.nzz.ch/nachrichten/sport?rss=true') - ,(u'Panorama' , u'http://www.nzz.ch/nachrichten/panorama?rss=true') - ,(u'Kultur' , u'http://www.nzz.ch/nachrichten/kultur/aktuell?rss=true') - ,(u'Wissenschaft' , u'http://www.nzz.ch/nachrichten/wissenschaft?rss=true') - ,(u'Medien' , u'http://www.nzz.ch/nachrichten/medien?rss=true') - ,(u'Reisen' , u'http://www.nzz.ch/magazin/reisen?rss=true') + (u'International' , u'http://www.nzz.ch/aktuell/international.rss') + ,(u'Schweiz' , u'http://www.nzz.ch/aktuell/schweiz.rss') + ,(u'Wirtschaft' , u'http://www.nzz.ch/aktuell/wirtschaft/uebersicht.rss') + ,(u'Finanzmaerkte' , u'http://www.nzz.ch/finanzen/uebersicht/finanznachrichten.rss') + ,(u'Zuerich' , u'http://www.nzz.ch/aktuell/zuerich/uebersicht.rss') + ,(u'Sport' , u'http://www.nzz.ch/aktuell/sport/uebersicht.rss') + ,(u'Panorama' , u'http://www.nzz.ch/aktuell/panorama.rss') + ,(u'Kultur' , u'http://www.nzz.ch/aktuell/feuilleton/uebersicht.rss') + ,(u'Wissenschaft' , u'http://www.nzz.ch/wissen/uebersicht.rss') + ,(u'Reisen' , u'http://www.nzz.ch/lebensart/reisen-freizeit.rss') + ,(u'Auto Mobil' , u'http://www.nzz.ch/lebensart/auto-mobil.rss') + ,(u'Digital' , u'http://www.nzz.ch/lebensart/digital.rss') + ,(u'Stil' , u'http://www.nzz.ch/lebensart/stil.rss') + ,(u'Wein-Keller' , u'http://www.nzz.ch/lebensart/wein-keller.rss') ] - def preprocess_html(self, soup): - for item in soup.findAll(style=True): - del item['style'] - return self.adeify_images(soup) From e378c4d5990f76b0bb4a6494da86bdc246dd7781 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jun 2012 09:56:09 +0530 Subject: [PATCH 4/5] Fix #1011030 (Search result not highlighted in tag browser) --- src/calibre/gui2/tag_browser/view.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/tag_browser/view.py b/src/calibre/gui2/tag_browser/view.py index edf62be7df..9331194328 100644 --- a/src/calibre/gui2/tag_browser/view.py +++ b/src/calibre/gui2/tag_browser/view.py @@ -25,13 +25,19 @@ class TagDelegate(QStyledItemDelegate): # {{{ def paint(self, painter, option, index): item = index.data(Qt.UserRole).toPyObject() QStyledItemDelegate.paint(self, painter, option, index) + widget = self.parent() + style = QApplication.style() if widget is None else widget.style() + self.initStyleOption(option, index) + if item.boxed: + r = style.subElementRect(style.SE_ItemViewItemFocusRect, option, + widget) + painter.save() + painter.drawLine(r.bottomLeft(), r.bottomRight()) + painter.restore() if item.type != TagTreeItem.TAG: return if (item.tag.state == 0 and config['show_avg_rating'] and item.tag.avg_rating is not None): - self.initStyleOption(option, index) - widget = self.parent() - style = QApplication.style() if widget is None else widget.style() r = style.subElementRect(style.SE_ItemViewItemDecoration, option, widget) icon = option.icon @@ -48,6 +54,7 @@ class TagDelegate(QStyledItemDelegate): # {{{ icon.On) painter.restore() + # }}} class TagsView(QTreeView): # {{{ From d088f888d08121e7e2279ba3b68f0658d14c783e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 10 Jun 2012 11:03:58 +0530 Subject: [PATCH 5/5] Remove the bright yellow lines indicating hidden sections as they dont seem to communicate that very well to most users. We will just have to rely on the buttons in the bottom right corner to indicate sections are hidden. --- resources/default_tweaks.py | 6 ------ src/calibre/gui2/init.py | 3 ++- src/calibre/gui2/widgets.py | 9 +-------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py index 92323d0f0f..9f848dc5ce 100644 --- a/resources/default_tweaks.py +++ b/resources/default_tweaks.py @@ -442,12 +442,6 @@ metadata_edit_custom_column_order = [] # calibre. public_smtp_relay_delay = 301 -#: Remove the bright yellow lines at the edges of the book list -# Control whether the bright yellow lines at the edges of book list are drawn -# when a section of the user interface is hidden. Changes will take effect -# after a restart of calibre. -draw_hidden_section_indicators = True - #: The maximum width and height for covers saved in the calibre library # All covers in the calibre library will be resized, preserving aspect ratio, # to fit within this size. This is to prevent slowdowns caused by extremely diff --git a/src/calibre/gui2/init.py b/src/calibre/gui2/init.py index 95e8c79382..d6332d71ac 100644 --- a/src/calibre/gui2/init.py +++ b/src/calibre/gui2/init.py @@ -238,10 +238,11 @@ class LayoutMixin(object): # {{{ # }}} self.status_bar = StatusBar(self) + stylename = unicode(self.style().objectName()) for x in button_order: button = getattr(self, x+'_splitter').button button.setIconSize(QSize(24, 24)) - if isosx: + if isosx and stylename != u'Calibre': button.setStyleSheet(''' QToolButton { background: none; border:none; padding: 0px; } QToolButton:checked { background: rgba(0, 0, 0, 25%); } diff --git a/src/calibre/gui2/widgets.py b/src/calibre/gui2/widgets.py index c9a3061295..4332bb651b 100644 --- a/src/calibre/gui2/widgets.py +++ b/src/calibre/gui2/widgets.py @@ -21,7 +21,7 @@ from calibre.gui2 import (NONE, error_dialog, pixmap_to_data, gprefs, from calibre.gui2.filename_pattern_ui import Ui_Form from calibre import fit_image from calibre.ebooks import BOOK_EXTENSIONS -from calibre.utils.config import prefs, XMLConfig, tweaks +from calibre.utils.config import prefs, XMLConfig from calibre.gui2.progress_indicator import ProgressIndicator as _ProgressIndicator from calibre.gui2.dnd import (dnd_has_image, dnd_get_image, dnd_get_files, IMAGE_EXTENSIONS, dnd_has_extension, DownloadDialog) @@ -1000,13 +1000,6 @@ class SplitterHandle(QSplitterHandle): if oh != self.highlight: self.update() - def paintEvent(self, ev): - QSplitterHandle.paintEvent(self, ev) - if self.highlight and tweaks['draw_hidden_section_indicators']: - painter = QPainter(self) - painter.setClipRect(ev.rect()) - painter.fillRect(self.rect(), Qt.yellow) - def mouseDoubleClickEvent(self, ev): self.double_clicked.emit(self)