mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 23:03:26 +02:00
Merge from trunk
This commit is contained in:
commit
83447f533c
5 changed files with 29 additions and 5 deletions
|
|
@ -41,4 +41,23 @@
|
|||
# Order is 0 for ascending, 1 for descending
|
||||
# For example, set it to [('authors',0),('title',0)] to sort by
|
||||
# title within authors.
|
||||
sort_columns_at_startup = None
|
||||
sort_columns_at_startup = None
|
||||
|
||||
# Format to be used for publication date
|
||||
# A string controlling how the publication date is displayed in the GUI
|
||||
# d the day as number without a leading zero (1 to 31)
|
||||
# dd the day as number with a leading zero (01 to 31)
|
||||
# ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun').
|
||||
# dddd the long localized day name (e.g. 'Monday' to 'Qt::Sunday').
|
||||
# M the month as number without a leading zero (1-12)
|
||||
# MM the month as number with a leading zero (01-12)
|
||||
# MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec').
|
||||
# MMMM the long localized month name (e.g. 'January' to 'December').
|
||||
# yy the year as two digit number (00-99)
|
||||
# yyyy the year as four digit number
|
||||
# For example, given the date of 9 Jan 2010, the following formats show
|
||||
# MMM yyyy ==> Jan 2010 yyyy ==> 2010 dd MMM yyyy ==> 09 Jan 2010
|
||||
# MM/yyyy ==> 01/2010 d/M/yy ==> 9/1/10 yy ==> 10
|
||||
# default if not set: MMM yyyy
|
||||
gui_pubdate_display_format = 'MMM yyyy'
|
||||
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ def economist_parse_index(self):
|
|||
key = None
|
||||
for tag in soup.findAll(['h1', 'h2']):
|
||||
text = ''.join(tag.findAll(text=True))
|
||||
if tag.name in ('h1', 'h2') and 'Classified ads' in text:
|
||||
break
|
||||
if tag.name == 'h1':
|
||||
if 'Classified ads' in text:
|
||||
break
|
||||
if 'The world this week' in text or 'The world this year' in text:
|
||||
index_started = True
|
||||
if not index_started:
|
||||
|
|
|
|||
|
|
@ -126,7 +126,6 @@ def getter(self):
|
|||
class DateEdit(QDateEdit):
|
||||
|
||||
def focusInEvent(self, x):
|
||||
print 'focus in'
|
||||
self.setSpecialValueText('')
|
||||
|
||||
def focusOutEvent(self, x):
|
||||
|
|
|
|||
|
|
@ -313,6 +313,9 @@ def __init__(self, window, row, db, accepted_callback=None, cancel_all=False):
|
|||
self.cpixmap = None
|
||||
self.cover.setAcceptDrops(True)
|
||||
self.pubdate.setMinimumDate(QDate(100,1,1))
|
||||
pubdate_format = tweaks['gui_pubdate_display_format']
|
||||
if pubdate_format is not None:
|
||||
self.pubdate.setDisplayFormat(pubdate_format)
|
||||
self.date.setMinimumDate(QDate(100,1,1))
|
||||
|
||||
self.connect(self.cover, SIGNAL('cover_changed(PyQt_PyObject)'), self.cover_dropped)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,10 @@ def displayText(self, val, locale):
|
|||
d = val.toDate()
|
||||
if d == UNDEFINED_QDATE:
|
||||
return ''
|
||||
return d.toString('MMM yyyy')
|
||||
format = tweaks['gui_pubdate_display_format']
|
||||
if format is None:
|
||||
format = 'MMM yyyy'
|
||||
return d.toString(format)
|
||||
|
||||
def createEditor(self, parent, option, index):
|
||||
qde = QStyledItemDelegate.createEditor(self, parent, option, index)
|
||||
|
|
|
|||
Loading…
Reference in a new issue