From c68a36d3c18e93c6f967695f6fe46b90a968d6d3 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Sat, 18 Dec 2010 18:14:40 +0000
Subject: [PATCH 01/13] Make the author_sort display tweak work in the content
server
---
resources/default_tweaks.py | 20 ++++++++++----------
src/calibre/gui2/tag_view.py | 2 +-
src/calibre/library/server/browse.py | 8 ++++++--
src/calibre/library/server/opds.py | 8 +++++++-
4 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/resources/default_tweaks.py b/resources/default_tweaks.py
index 6d4f7a405f..a420cd7d44 100644
--- a/resources/default_tweaks.py
+++ b/resources/default_tweaks.py
@@ -43,17 +43,17 @@ author_sort_copy_method = 'invert'
# Set which author field to display in the tags pane (the list of authors,
# series, publishers etc on the left hand side). The choices are author and
-# author_sort. This tweak affects only the tags pane, and only what is displayed
-# under the authors category. Please note that if you set this to author_sort,
-# it is very possible to see duplicate names in the list becasue although it is
-# guaranteed that author names are unique, there is no such guarantee for
-# author_sort values. Showing duplicates won't break anything, but it could
-# lead to some confusion. When using 'author_sort', the tooltip will show the
-# author's name.
+# author_sort. This tweak affects only what is displayed under the authors
+# category in the tags pane and content server. Please note that if you set this
+# to author_sort, it is very possible to see duplicate names in the list because
+# although it is guaranteed that author names are unique, there is no such
+# guarantee for author_sort values. Showing duplicates won't break anything, but
+# it could lead to some confusion. When using 'author_sort', the tooltip will
+# show the author's name.
# Examples:
-# tags_pane_use_field_for_author_name = 'author'
-# tags_pane_use_field_for_author_name = 'author_sort'
-tags_pane_use_field_for_author_name = 'author'
+# categories_use_field_for_author_name = 'author'
+# categories_use_field_for_author_name = 'author_sort'
+categories_use_field_for_author_name = 'author'
# Set whether boolean custom columns are two- or three-valued.
diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py
index a0e26cf77c..478f6b042f 100644
--- a/src/calibre/gui2/tag_view.py
+++ b/src/calibre/gui2/tag_view.py
@@ -412,7 +412,7 @@ class TagTreeItem(object): # {{{
def tag_data(self, role):
tag = self.tag
if tag.category == 'authors' and \
- tweaks['tags_pane_use_field_for_author_name'] == 'author_sort':
+ tweaks['categories_use_field_for_author_name'] == 'author_sort':
name = tag.sort
tt_author = True
else:
diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py
index 37f024c08d..b1c4a4c2f9 100644
--- a/src/calibre/library/server/browse.py
+++ b/src/calibre/library/server/browse.py
@@ -15,7 +15,7 @@ from calibre import isbytestring, force_unicode, fit_image, \
prepare_string_for_xml as xml
from calibre.utils.ordered_dict import OrderedDict
from calibre.utils.filenames import ascii_filename
-from calibre.utils.config import prefs
+from calibre.utils.config import prefs, tweaks
from calibre.utils.icu import sort_key
from calibre.utils.magick import Image
from calibre.library.comments import comments_to_html
@@ -151,7 +151,11 @@ def get_category_items(category, items, restriction, datatype, prefix): # {{{
'
{1}
'
'
{2}
')
rating, rstring = render_rating(i.avg_rating, prefix)
- name = xml(i.name)
+ if i.category == 'authors' and \
+ tweaks['categories_use_field_for_author_name'] == 'author_sort':
+ name = xml(i.sort)
+ else:
+ name = xml(i.name)
if datatype == 'rating':
name = xml(_('%d stars')%int(i.avg_rating))
id_ = i.id
diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py
index cd0b80d4f0..e447c6966c 100644
--- a/src/calibre/library/server/opds.py
+++ b/src/calibre/library/server/opds.py
@@ -22,6 +22,7 @@ from calibre.library.server.utils import format_tag_string, Offsets
from calibre import guess_type, prepare_string_for_xml as xml
from calibre.utils.icu import sort_key
from calibre.utils.ordered_dict import OrderedDict
+from calibre.utils.config import tweaks
BASE_HREFS = {
0 : '/stanza',
@@ -113,8 +114,13 @@ def CATALOG_ENTRY(item, item_kind, base_href, version, updated,
count = (_('%d books') if item.count > 1 else _('%d book'))%item.count
if ignore_count:
count = ''
+ if item.category == 'authors' and \
+ tweaks['categories_use_field_for_author_name'] == 'author_sort':
+ name = xml(item.sort)
+ else:
+ name = xml(item.name)
return E.entry(
- TITLE(item.name + ('' if not add_kind else ' (%s)'%item_kind)),
+ TITLE(name + ('' if not add_kind else ' (%s)'%item_kind)),
ID(id_),
UPDATED(updated),
E.content(count, type='text'),
From 19c4afd22212c34a1da81e400806a8d1675c8952 Mon Sep 17 00:00:00 2001
From: Charles Haley <>
Date: Sun, 19 Dec 2010 09:53:12 +0000
Subject: [PATCH 02/13] Fix #7949: Plug Board vs Series metadata change - bad
behavior in 0.7.34
---
src/calibre/ebooks/metadata/book/base.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/calibre/ebooks/metadata/book/base.py b/src/calibre/ebooks/metadata/book/base.py
index f0844e3711..22752ca09e 100644
--- a/src/calibre/ebooks/metadata/book/base.py
+++ b/src/calibre/ebooks/metadata/book/base.py
@@ -463,6 +463,8 @@ class Metadata(object):
other_lang = getattr(other, 'language', None)
if other_lang and other_lang.lower() != 'und':
self.language = other_lang
+ if not getattr(self, 'series', None):
+ self.series_index = None
def format_series_index(self, val=None):
from calibre.ebooks.metadata import fmt_sidx
From fb1c5286ceaab21af850864bbd02a0c9763d9509 Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 09:13:10 -0700
Subject: [PATCH 03/13] Fix #7960 (Updated recipe for La Nacion)
---
resources/recipes/lanacion.recipe | 2 ++
1 file changed, 2 insertions(+)
diff --git a/resources/recipes/lanacion.recipe b/resources/recipes/lanacion.recipe
index 19f6c1c897..050cb2e79c 100644
--- a/resources/recipes/lanacion.recipe
+++ b/resources/recipes/lanacion.recipe
@@ -78,4 +78,6 @@ class Lanacion(BasicNewsRecipe):
]
def preprocess_html(self, soup):
+ for item in soup.findAll(style=True):
+ del item['style']
return self.adeify_images(soup)
From d76a416eb2b97708d7f493b6bc82c54ce6f724b0 Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 09:54:00 -0700
Subject: [PATCH 04/13] PocketBook 701 driver: Swap the main memory and card
drives on windows
---
src/calibre/devices/eb600/driver.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/calibre/devices/eb600/driver.py b/src/calibre/devices/eb600/driver.py
index bc8b87533c..246b753fa8 100644
--- a/src/calibre/devices/eb600/driver.py
+++ b/src/calibre/devices/eb600/driver.py
@@ -266,3 +266,12 @@ class POCKETBOOK701(USBMS):
VENDOR_NAME = 'ANDROID'
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = '__UMS_COMPOSITE'
+ def windows_sort_drives(self, drives):
+ if len(drives) < 2: return drives
+ main = drives.get('main', None)
+ carda = drives.get('carda', None)
+ if main and carda:
+ drives['main'] = carda
+ drives['carda'] = main
+ return drives
+
From 4f9b1dd20a3f60b38b943434afc24b73662d4244 Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 11:16:11 -0700
Subject: [PATCH 05/13] E-book viewer: Remove workaround for font-face rules as
QtWebKit supports loading fonts directly as of Qt 4.7
---
src/calibre/ebooks/oeb/iterator.py | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/calibre/ebooks/oeb/iterator.py b/src/calibre/ebooks/oeb/iterator.py
index 10180541a1..6820709b3e 100644
--- a/src/calibre/ebooks/oeb/iterator.py
+++ b/src/calibre/ebooks/oeb/iterator.py
@@ -257,7 +257,6 @@ class EbookIterator(object):
s.max_page = s.start_page + s.pages - 1
self.toc = self.opf.toc
- self.find_embedded_fonts()
self.read_bookmarks()
return self
From a5410546c14f4326d5f07da8f82dad0d0f535a3f Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 11:53:06 -0700
Subject: [PATCH 06/13] Fix #7973 (Support for LG Optimus S (LS670) Running
Android 2.2.1)
---
src/calibre/devices/android/driver.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py
index f2a5752bd4..fecfa88ea5 100644
--- a/src/calibre/devices/android/driver.py
+++ b/src/calibre/devices/android/driver.py
@@ -24,7 +24,7 @@ class ANDROID(USBMS):
0xc92 : [0x100], 0xc97: [0x226]},
# Eken
- 0x040d : { 0x8510 : [0x0001] },
+ 0x040d : { 0x8510 : [0x0001], 0x0851 : [0x1] },
# Motorola
0x22b8 : { 0x41d9 : [0x216], 0x2d67 : [0x100], 0x41db : [0x216],
@@ -49,8 +49,9 @@ class ANDROID(USBMS):
# Dell
0x413c : { 0xb007 : [0x0100, 0x0224]},
- # Eken?
- 0x040d : { 0x0851 : [0x0001]},
+ # LG
+ 0x1004 : { 0x61cc : [0x100] },
+
}
EBOOK_DIR_MAIN = ['eBooks/import', 'wordplayer/calibretransfer', 'Books']
EXTRA_CUSTOMIZATION_MESSAGE = _('Comma separated list of directories to '
@@ -59,7 +60,7 @@ class ANDROID(USBMS):
EXTRA_CUSTOMIZATION_DEFAULT = ', '.join(EBOOK_DIR_MAIN)
VENDOR_NAME = ['HTC', 'MOTOROLA', 'GOOGLE_', 'ANDROID', 'ACER',
- 'GT-I5700', 'SAMSUNG', 'DELL', 'LINUX']
+ 'GT-I5700', 'SAMSUNG', 'DELL', 'LINUX', 'GOOGLE']
WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE',
'__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897',
'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID',
From 7bc9608367f528632be7cf589878e26a4259a5c4 Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 17:41:12 -0700
Subject: [PATCH 07/13] Fix #7966 (Request for Samsung Galaxy Tab Support)
---
src/calibre/devices/android/driver.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/calibre/devices/android/driver.py b/src/calibre/devices/android/driver.py
index fecfa88ea5..492b00617d 100644
--- a/src/calibre/devices/android/driver.py
+++ b/src/calibre/devices/android/driver.py
@@ -64,9 +64,9 @@ class ANDROID(USBMS):
WINDOWS_MAIN_MEM = ['ANDROID_PHONE', 'A855', 'A853', 'INC.NEXUS_ONE',
'__UMS_COMPOSITE', '_MB200', 'MASS_STORAGE', '_-_CARD', 'SGH-I897',
'GT-I9000', 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID',
- 'SCH-I500_CARD', 'SPH-D700_CARD', 'MB810']
+ 'SCH-I500_CARD', 'SPH-D700_CARD', 'MB810', 'GT-P1000']
WINDOWS_CARD_A_MEM = ['ANDROID_PHONE', 'GT-I9000_CARD', 'SGH-I897',
- 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID']
+ 'FILE-STOR_GADGET', 'SGH-T959', 'SAMSUNG_ANDROID', 'GT-P1000_CARD']
OSX_MAIN_MEM = 'HTC Android Phone Media'
From ff466758af508b73259c8ea037339229e057b498 Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 17:46:00 -0700
Subject: [PATCH 08/13] ...
---
src/calibre/devices/misc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/calibre/devices/misc.py b/src/calibre/devices/misc.py
index 68f4dba9a9..52952356f8 100644
--- a/src/calibre/devices/misc.py
+++ b/src/calibre/devices/misc.py
@@ -104,7 +104,7 @@ class PDNOVEL(USBMS):
VENDOR_NAME = 'ANDROID'
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = '__UMS_COMPOSITE'
- THUMBNAIL_HEIGHT = 144
+ THUMBNAIL_HEIGHT = 130
EBOOK_DIR_MAIN = 'eBooks'
SUPPORTS_SUB_DIRS = False
From 9582cded9d429a86cba155ded434b32e78a3a5aa Mon Sep 17 00:00:00 2001
From: Kovid Goyal
Date: Sun, 19 Dec 2010 18:57:11 -0700
Subject: [PATCH 09/13] More work on the comments editor
---
imgsrc/{edit_copy.svg => edit-copy.svg} | 0
imgsrc/edit-cut.svg | 831 +++++
imgsrc/edit-paste.svg | 3302 +++++++++++++++++
imgsrc/swap.svg | 722 ----
.../images/{edit_copy.png => edit-copy.png} | Bin
resources/images/edit-cut.png | Bin 0 -> 11657 bytes
resources/images/edit-paste.png | Bin 0 -> 4949 bytes
resources/images/edit-redo.png | Bin 0 -> 3383 bytes
resources/images/edit-undo.png | Bin 0 -> 1986 bytes
resources/images/format-text-subscript.png | Bin 0 -> 7332 bytes
resources/images/format-text-superscript.png | Bin 0 -> 7279 bytes
resources/images/swap.png | Bin 13638 -> 10850 bytes
src/calibre/gui2/comments_editor.py | 64 +-
src/calibre/gui2/viewer/main.ui | 2 +-
14 files changed, 4183 insertions(+), 738 deletions(-)
rename imgsrc/{edit_copy.svg => edit-copy.svg} (100%)
create mode 100644 imgsrc/edit-cut.svg
create mode 100644 imgsrc/edit-paste.svg
delete mode 100644 imgsrc/swap.svg
rename resources/images/{edit_copy.png => edit-copy.png} (100%)
create mode 100644 resources/images/edit-cut.png
create mode 100644 resources/images/edit-paste.png
create mode 100644 resources/images/edit-redo.png
create mode 100644 resources/images/edit-undo.png
create mode 100644 resources/images/format-text-subscript.png
create mode 100644 resources/images/format-text-superscript.png
diff --git a/imgsrc/edit_copy.svg b/imgsrc/edit-copy.svg
similarity index 100%
rename from imgsrc/edit_copy.svg
rename to imgsrc/edit-copy.svg
diff --git a/imgsrc/edit-cut.svg b/imgsrc/edit-cut.svg
new file mode 100644
index 0000000000..f078b52e04
--- /dev/null
+++ b/imgsrc/edit-cut.svg
@@ -0,0 +1,831 @@
+
+
+
diff --git a/imgsrc/edit-paste.svg b/imgsrc/edit-paste.svg
new file mode 100644
index 0000000000..d22a8bb7dd
--- /dev/null
+++ b/imgsrc/edit-paste.svg
@@ -0,0 +1,3302 @@
+
+
+
\ No newline at end of file
diff --git a/imgsrc/swap.svg b/imgsrc/swap.svg
deleted file mode 100644
index aa62316b34..0000000000
--- a/imgsrc/swap.svg
+++ /dev/null
@@ -1,722 +0,0 @@
-
-
-
diff --git a/resources/images/edit_copy.png b/resources/images/edit-copy.png
similarity index 100%
rename from resources/images/edit_copy.png
rename to resources/images/edit-copy.png
diff --git a/resources/images/edit-cut.png b/resources/images/edit-cut.png
new file mode 100644
index 0000000000000000000000000000000000000000..b995283754579ac4e4ddbf15ca791fa58bd45c90
GIT binary patch
literal 11657
zcmW++cRZDE8-EVRp6M9LICSDCx%3j%I
zzqj|(r~IL3+|PYo-*w%g8fr=uq>Q8x1W{m=Q7cvK^z1jA&k6?mRH)QuXj9RvF@m>=wngC$D@qD<45L%3}0^ZVc7}qJvAC@TvJdM
zR*bwmt%e$*YbpUzVMp
z=GMP_DZ)UQw7RtCsm7dYp?=UHKCpL@vFK}xXF*I6
z`%r>J8p?`rw{WvKGqi?oLtGJx76Irmgcgh;u|N8{4MYhoLf@dVNX1)hVSj4Tcn?Ba
zIw3S9(6i}bIyN-4^Y`Rn-Jc|j8Vf73PTL%Wl|zM)29?=b{GBKH?j9Z&^J5hj(H0K0
z&sAjbT<~g{TGh8|=cDKqG_~L|)O0+0+htH#wq4gaIUYo2MuYW-ZBt{r4>!iE)Da4j
zOqBOw0#WX{UElDiHGYX-hvxg!A9mnScf``8US1q8Uy?~*8)>`oC|vkw7BmKnm#q%&
zI^Ak%`P|&xtfq;muc@iQpErYbJ#VGm9B=XW&&$r9D@S3_JUqpIo7KNAXt88#g03Qb
z1SqXJ{y@7;9;ceg+E>TBuMrA&!*a}e6L`0xbvwH71hp#Z-+Vh;yl4M&LlZ#&xrNj5
zo*dULXBd*ThE+K;qq0aplNB8czF9
zw8#eWrN?Srb1zqha=RbvKpb&B7t=mlQ&dRSHSEIfAI_K
zVv3pwbXXwsLytzPEPAY{NhFhfj0RB`WvhmXiJD5Ph$FiUHIg{6u&^+x)^lr`zxjCS
zCO;Ogg_mqUsNzq8CDBNP&bwLtUxiO@_Tx*V!|h6N%fwpguWoFJ!)MtGWpUvZFvhhMe+q0SzL&%5kN3{5Ox?C$
z_>)z*8ay^nsO_{|eg~RaNYs*Q-7n`naG9E#I*Vd{$oM#z7>8n$l4@Cdr)$zPI@XHJ
zY$+`K`fnvS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