Commit graph

31278 commits

Author SHA1 Message Date
Kovid Goyal
6b224f2a35
Use an all files filter when adding links unless treat as image is checked 2019-10-07 07:09:52 +05:30
Kovid Goyal
e6b44cf5fa
PDF Output: Ignore 4 byte differences in glyph sizes when merging. Fixes #1846982 [Conversion from ePub to PDF fails](https://bugs.launchpad.net/calibre/+bug/1846982) 2019-10-07 06:57:17 +05:30
Kovid Goyal
2207a86ea7
Better error message when there is a glyph mismatch 2019-10-07 06:41:14 +05:30
Kovid Goyal
c668fec87b
Edit metadata: Use a border rather than background color to indicate correct title and author sort values. Works better with dark themes. Fixes #1846967 [Private bug](https://bugs.launchpad.net/calibre/+bug/1846967) 2019-10-07 06:19:20 +05:30
Kovid Goyal
d84626293c
PDF Output: Fix a bug that prevented the first style property in the header or footer template from being applied 2019-10-06 23:07:56 +05:30
Kovid Goyal
77dc63cab9
Fix typo in dropbox fw version in kobo driver 2019-10-06 22:53:43 +05:30
Kovid Goyal
7e49092f17
Move scrollbar suppression into the load pipeline and only suppress until load is completed 2019-10-06 22:51:54 +05:30
Kovid Goyal
0ccedfdcc7
Viewer: Add an option to display a scrollbar 2019-10-06 22:36:57 +05:30
Kovid Goyal
42ae6dea61
... 2019-10-06 21:09:56 +05:30
Kovid Goyal
d3c0452d6f
Viewer: Hide the browser provided scrollbar that flashes momentarily on page load. Fixes #1846922 [Scroll bar in new viewer](https://bugs.launchpad.net/calibre/+bug/1846922) 2019-10-06 20:20:57 +05:30
Kovid Goyal
0e8d5d3793
Merge branch 'master' of https://github.com/davidfor/calibre 2019-10-06 19:19:32 +05:30
David
48d1bf424c Bump supported Kobo firmware version
Plus add a tag for Dropbox support. Will be adding something for that
later, but, won't harm anything at the moment.
2019-10-07 00:43:09 +11:00
Andrey Efremov
906b8773c5 FB2 Output: Remove extra space in short tags 2019-10-06 18:27:17 +07:00
Andrey Efremov
0f5b72b437 FB2 Output: Use short xlink namespace 2019-10-06 18:27:17 +07:00
Andrey Efremov
88159288a8 FB2 Output: Remove extra line breaks and prettify XML markup 2019-10-06 18:27:17 +07:00
Andrey Efremov
6071352d67 FB2 Output: Fix id for PNG images 2019-10-06 18:27:17 +07:00
Andrey Efremov
2ce345e5dd FB2 Output: Speed up image data splitting 2019-10-06 15:20:38 +07:00
Kovid Goyal
73077b2207
Same fix for bottom margin as well 2019-10-06 12:36:01 +05:30
Kovid Goyal
cd2049befd
Viewer: Fix clicking on margins causing keyboard shortcuts to not work until the main text is clicked on again 2019-10-06 12:34:11 +05:30
Kovid Goyal
87be626af7
Viewer: Add options to control scrolling using the mouse in paged mode.
Fixes #1846800 [Feature request: Add an option for mouse scroll to scroll by screen fulls rather than a single page](https://bugs.launchpad.net/calibre/+bug/1846800)
2019-10-06 12:32:22 +05:30
Kovid Goyal
db583073de
Viewer: Add a keyboard shortcut (Ctrl+m) to toggle between paged mode and flow mode 2019-10-06 08:58:19 +05:30
Kovid Goyal
91438dd8f1
Viewer: Fix a couple of bugs in flow mode. Scrolling to anchors was not working and remembering last read position was not working 2019-10-06 08:46:53 +05:30
Kovid Goyal
995e9ecd79
Viewer: Allow copying images by right clicking on them. Fixes #1846903 [Right Click Copy Image v 4](https://bugs.launchpad.net/calibre/+bug/1846903) 2019-10-06 08:08:10 +05:30
Kovid Goyal
5e25ebd6f1
Viewer: Fix text after comments not being rendered. Fixes #1846875 [text after HTML comment in epub is not displayed](https://bugs.launchpad.net/calibre/+bug/1846875) 2019-10-06 07:21:40 +05:30
Kovid Goyal
e93a01aa3d
Content server: Make the book size useable in custom book list templates. Fixes #1846839 [Custom book list template doesn't work with {size}](https://bugs.launchpad.net/calibre/+bug/1846839) 2019-10-05 12:50:05 +05:30
Kovid Goyal
a87c59e8c8
Viewer: Add a preference under Miscellaneous to allow only a single instance of the viewer 2019-10-05 12:35:23 +05:30
Kovid Goyal
fc9bbd7ca2
String changes 2019-10-05 12:09:53 +05:30
Kovid Goyal
34d3011726
Get rid of busy loop retries for connecting to inspector dock 2019-10-05 11:10:38 +05:30
Kovid Goyal
d2d188215c
Editor: Fix inspector not working when running from source. Fixes #1846819 [Editor Inspector doesn't work when running from source](https://bugs.launchpad.net/calibre/+bug/1846819) 2019-10-05 11:03:19 +05:30
Kovid Goyal
e0630cadd3
Viewer: Fix failing to open books if path to cache contains symbolic links. Fixes #1846834 [symlinked .cache cause calibre 4 reader fail](https://bugs.launchpad.net/calibre/+bug/1846834) 2019-10-05 10:27:48 +05:30
Kovid Goyal
e9250df828
Prevent esc key from closing the loading msg and the initial open book screen 2019-10-05 10:23:12 +05:30
Kovid Goyal
b72922e94c
Fix a regression that broke reading metadata from ODT files that do not have keywords. Fixes #1846828 [e-book reader does not read .odt files](https://bugs.launchpad.net/calibre/+bug/1846828) 2019-10-05 10:11:19 +05:30
Kovid Goyal
644071ff0c
Viewer: When restoring from fullscreen go back to maximized state if window was maximized when entering full screen. Fixes #1846753 [Window Size not retained when exiting from full screen in ebook-viewer](https://bugs.launchpad.net/calibre/+bug/1846753) 2019-10-05 10:07:46 +05:30
Kovid Goyal
46dbd9b24b
Use macOS specific modifier names in UI 2019-10-05 07:26:15 +05:30
Kovid Goyal
f542ac933d
Viewer: Add a configurable Quit shortcut 2019-10-05 06:59:58 +05:30
Kovid Goyal
13e2bf077f
Fix weirdness when closing customize individual shortcut panel 2019-10-04 22:44:01 +05:30
Kovid Goyal
95c71e3cd0
Viewer: Fix shortcut changes not being applied after pressing OK if shortcut list is closed by pressing Esc. Fixes #1846765 [ebook viewer preferences not saved](https://bugs.launchpad.net/calibre/+bug/1846765) 2019-10-04 22:39:09 +05:30
Kovid Goyal
67aca61d0c
Avoid zero-div 2019-10-04 20:00:59 +05:30
Kovid Goyal
8ef6938e03
Viewer: Allow showing the "position in book" as was displayed in the top left of the viewer in calibre 3 in the header and footer. Fixes #1846700 [Absolute position for book viewer](https://bugs.launchpad.net/calibre/+bug/1846700) 2019-10-04 19:55:17 +05:30
Kovid Goyal
cc54251368
Increase rename retries since we could have file sync programs in the mix as well 2019-10-04 18:51:56 +05:30
Kovid Goyal
f0b3091a18
Viewer: Fix loading progress screen sometimes getting stuck if changing pages rapidly with mouse wheel. Fixes #1846751 [New Viewer App gets stuck at "Loading next section from … please wait…" when scrolling](https://bugs.launchpad.net/calibre/+bug/1846751) 2019-10-04 18:50:45 +05:30
Kovid Goyal
7ca2f68e53
Comments editor: Workaround for Qt converting ids into anchors 2019-10-04 15:42:25 +05:30
Kovid Goyal
b55ef85fd7
Possible workaround for some windows machines where the viewer is getting access denied errors while renaming a directory 2019-10-04 15:20:58 +05:30
Kovid Goyal
2b536dd02f
Remove unused code 2019-10-04 13:29:08 +05:30
Kovid Goyal
b02eb9df01
Viewer: When there is empty text for an header footer section render it as blank instead of moving the remaining sections to the left 2019-10-04 13:12:52 +05:30
Kovid Goyal
749460cbfc
Better fixes for publish pipeline issues 2019-10-04 07:35:09 +05:30
Kovid Goyal
173c250162
version 4.0.0 2019-10-04 05:56:13 +05:30
Kovid Goyal
b6de056d57
Another epub:type mapping 2019-10-04 05:49:00 +05:30
Kovid Goyal
769cf0da51
Automatically migrate some epub|type selectors 2019-10-04 05:43:25 +05:30
Kovid Goyal
abe30ca2fb
Editor Live CSS: Dont fail totally if the stylesheet uses namespaced selectors
Fixes #1846538 [Private bug](https://bugs.launchpad.net/calibre/+bug/1846538)
2019-10-04 05:14:26 +05:30
Kovid Goyal
839919dbbc
pep8 2019-10-03 21:19:42 +05:30
Kovid Goyal
beb9727757
Add a function to get the outline from a PDF file 2019-10-03 18:12:45 +05:30
Kovid Goyal
1c22993e00
Move outline creation into its own file 2019-10-03 16:51:33 +05:30
Kovid Goyal
350494d016
After inserting a hyperlink restore text format
allows typing after inserting the link in the previous text style
2019-10-02 12:36:05 +05:30
Kovid Goyal
113be27352
Coments editor should not explicitly underline inserted links 2019-10-02 12:23:50 +05:30
Kovid Goyal
18398aafea
Insert hyperlink should preserve formatting of selected text 2019-10-02 12:21:16 +05:30
Kovid Goyal
c28cb6a1d2
Bump beta version 2019-10-01 10:23:24 +05:30
Kovid Goyal
3274ecfa83
Fix autoreload failure when appcache is not available 2019-10-01 10:07:21 +05:30
Kovid Goyal
b23b1adcf1
Browser viewer: Fix page turn not working on chrome for android at file boundaries
Apparently chrome has started returning fractional numbers for scroll
position
2019-10-01 10:03:48 +05:30
Tomasz Długosz
1433e3225c woblink store: fix link 2019-09-30 22:59:17 +00:00
Kovid Goyal
6bed097e07
Use a generated image cover for coverless EPUB files as well 2019-09-30 19:25:57 +05:30
Kovid Goyal
d9d20f0310
Fix penultimate cfi being saved on exit 2019-09-30 15:34:19 +05:30
Kovid Goyal
0ce7e45327
Better fix for ctrl+letter 2019-09-30 09:38:43 +05:30
Kovid Goyal
c034aeca4a
Workaround for ctrl+f/t not working on windows 2019-09-30 09:22:46 +05:30
Kovid Goyal
06a9c77ace
Keyboard shortcuts for next/previous section 2019-09-30 08:44:39 +05:30
Kovid Goyal
e1e9b023af
... 2019-09-30 08:32:03 +05:30
Kovid Goyal
5a66e094e3
Allow using Esc key to close modal dialogs 2019-09-30 08:30:08 +05:30
Kovid Goyal
47ddd8165c
Pass focus back to iframe after closing modal dialogs 2019-09-30 08:23:25 +05:30
Kovid Goyal
9ee721093e
Focus iframe when closing search box 2019-09-30 08:09:12 +05:30
Kovid Goyal
c67dacd033
Oops forgot output sentinel when getting result from forked compiler 2019-09-29 20:38:33 +05:30
Kovid Goyal
7647c265e1
... 2019-09-29 20:19:06 +05:30
Kovid Goyal
98fbdadd5c
Fix compilation of rapydscript in a process that cannot use webengine, such as the main calibre GUI 2019-09-29 20:14:20 +05:30
Kovid Goyal
234b25da4d
More viewer settings migrations fixes 2019-09-29 19:23:12 +05:30
Kovid Goyal
162d836d90
Remove double dots from hostnames when sending SMTP EHLO 2019-09-28 18:37:10 +05:30
Kovid Goyal
8d520400c5
... 2019-09-28 11:39:16 +05:30
Kovid Goyal
d126f52d4c
Allow using arrow keys n book details page to move between next/previous books
Fixes #1845672 [Use arrow keys to browse on calibre-server](https://bugs.launchpad.net/calibre/+bug/1845672)
2019-09-28 09:13:57 +05:30
Kovid Goyal
0638361025
String changes 2019-09-28 08:29:22 +05:30
Kovid Goyal
2a553f1b68
String change 2019-09-27 19:49:14 +05:30
Kovid Goyal
990dce338d
PDF Output: Fix footer sometimes appearing as header when no header is specified 2019-09-27 10:42:53 +05:30
Kovid Goyal
77a0a77723
Fix needing to restart viewer for changes in the background image 2019-09-27 09:11:06 +05:30
Eli Schwartz
26871566ce
Nexto store: remove use of type('') with better xpath
There's no need to run regular expressions on a str(list()) of lxml
element results, to see if anything contains a string -- simply use the
XPath grammar contains() and check if any results were returned.
2019-09-26 20:15:25 -04:00
Kovid Goyal
448b412c9d
Bump beta version 2019-09-26 15:25:38 +05:30
Kovid Goyal
6db937bca6
Dont use simple-link for next buttons 2019-09-26 13:26:29 +05:30
Kovid Goyal
0641384bc7
Server: Use overlay buttons as next/prev on boo details page
See #1845417 ([Enhancement] Book details on calibre-server)
2019-09-26 11:55:30 +05:30
Kovid Goyal
ff162a2b8f
Fix #1845416 [Repetition in error message](https://bugs.launchpad.net/calibre/+bug/1845416) 2019-09-26 09:30:32 +05:30
Kovid Goyal
d83698bdd2
Viewer: Allow using ctrl+wheel to change font size 2019-09-26 06:36:51 +05:30
Kovid Goyal
ddd5b0315e
Use calibre code rather than Qt to get font names. More robust. Appears
that on windows QRawFont chokes on OTF fonts with CFF outlines
2019-09-25 14:21:28 +05:30
Kovid Goyal
317a2b9a14
Viewer: Allow fading the background image by blending it with the background color 2019-09-25 11:25:40 +05:30
Kovid Goyal
7d6d5b71c6
Use a URL for the web viewer background image setting 2019-09-25 10:34:40 +05:30
Kovid Goyal
3b1753f134
Code to control background attachment 2019-09-25 10:09:38 +05:30
Kovid Goyal
ac6271d4c0
Merge branch 'patch-2' of https://github.com/zazaho/calibre-1 2019-09-25 06:08:01 +05:30
Kovid Goyal
0fb8b26f6e
Merge branch 'patch-1' of https://github.com/zazaho/calibre-1 2019-09-25 06:05:19 +05:30
Sacha
c68bb58ffa
Avoid error on python3 about str and bytes
When I launch the calibre application build for python3 I get two errors about expecting bytes not str and the other way around.
in src/calibre/devices/mtp/driver.py and src/calibre/devices/mtp/unix/driver.py
I found that theses edits remove the error.
2019-09-24 22:43:43 +02:00
Sacha
01a549eae6
Avoid error on python3 about str and bytes
When I launch the calibre application build for python3 I get two errors about expecting bytes not str and the other way around.
in src/calibre/devices/mtp/driver.py and src/calibre/devices/mtp/unix/driver.py
I found that theses edits remove the error.
2019-09-24 22:40:48 +02:00
Kovid Goyal
92ffeebb4a
Work on viewer setting for background image 2019-09-24 20:21:25 +05:30
Kovid Goyal
62d38e6706
Use a single class for blue links 2019-09-24 18:16:18 +05:30
Kovid Goyal
15cb1aaccc
Fix examples link not working in user stylesheets prefs 2019-09-24 17:52:32 +05:30
Kovid Goyal
d35e5c78ed
Set background color on ifrae rather than iframe contents 2019-09-24 17:05:27 +05:30
Kovid Goyal
0ed3a5e636
FB2 Output: Dont convert PNG images to JPEG as FB2 supports PNG
Fixes #1844911 [ebook-convert hangs when converting to FB2](https://bugs.launchpad.net/calibre/+bug/1844911)
2019-09-22 20:15:16 +05:30
Kovid Goyal
d9ee5cc326
Qt change makes ampersand visible in wizard welcome message 2019-09-22 18:29:16 +05:30
Kovid Goyal
119e6bfb7b
PDF Output: Fix typo that broke option to output toc in PDF is the last file in the input document is shorter than the generated toc 2019-09-22 18:15:54 +05:30
Kovid Goyal
db486c684f
Viewer: Show full path to book in the metadata display
Fixes #1843312 [ENHANCEMENT: ePub Reader metadata should show filepath for current open ePub book](https://bugs.launchpad.net/calibre/+bug/1843312)
2019-09-20 11:19:05 +05:30
Kovid Goyal
519c87d989
... 2019-09-20 08:30:35 +05:30
Kovid Goyal
7661bb00d1
Viewer: Add option under Page layout to control if the aspect ratio of the cover is preserved or not 2019-09-19 21:51:54 +05:30
Kovid Goyal
ae7a86e73b
... 2019-09-19 20:25:02 +05:30
Kovid Goyal
b4fe349df8
Use a generated image cover instead of a plain text one 2019-09-19 20:24:38 +05:30
Kovid Goyal
7bef47a452
Bump beta version
Stupid EPUB cover handling bug.
2019-09-19 18:31:01 +05:30
Kovid Goyal
4e6353468b
Fix small cover images not being vertically centered 2019-09-19 18:29:24 +05:30
Kovid Goyal
1e57c4180e
Proper fix for EPUB files without title pages 2019-09-19 18:16:09 +05:30
Kovid Goyal
4aa0ee3ccd
... 2019-09-19 15:35:48 +05:30
Kovid Goyal
ba89de0def
Add a fonts sub-menu to the comments editor context menu
Matches the v3 context menu
2019-09-19 15:28:32 +05:30
Kovid Goyal
268f36b8cc
Bump beta version 2019-09-19 13:26:51 +05:30
Kovid Goyal
c2e1e00f09
Set UI font size for viewer in pixels
Seems to match the actual font size in the main UI better on Linux with
both hidpi on and off.
2019-09-19 11:22:19 +05:30
Kovid Goyal
c60dbbda8f
EPUB3 metadata: Recognize a creator as an author even if his first role is not aut 2019-09-19 10:52:31 +05:30
Kovid Goyal
d459097e3f
Fix duplicate file read 2019-09-19 08:10:43 +05:30
Kovid Goyal
a31474804f
When inserting a link, preserve the currently selected text, if any 2019-09-19 08:06:26 +05:30
Kovid Goyal
3c2653eb33
typo 2019-09-18 14:11:59 +05:30
Kovid Goyal
997595dfd4
Viewer: Add option to hide mouse-over tooltips 2019-09-17 19:47:00 +05:30
Kovid Goyal
4d7045d92d
Also have right clicking hide the controls help 2019-09-17 19:22:23 +05:30
Kovid Goyal
0c5c492333
On macOS have to control-click since there is no right mouse button 2019-09-17 19:20:31 +05:30
Kovid Goyal
d1badedfc7
... 2019-09-17 18:22:05 +05:30
Kovid Goyal
2d9c0c709d
Viewer: Dont show a blank title page for books with not titlepage 2019-09-17 18:18:07 +05:30
Kovid Goyal
eb7ee8b9ef
Merge branch 'master' of https://github.com/davidfor/calibre 2019-09-17 17:52:46 +05:30
David
0cc6f3628c Bump dbversion in KoboTouch driver
A last minute change from Kobo bumped the database version in the release for the Libra H2O.
2019-09-17 22:19:23 +10:00
Kovid Goyal
721c3e3725
Edit Book: Show the font name in a tooltip when hovering over the font file in the File Browser 2019-09-17 17:40:25 +05:30
Kovid Goyal
9cc6842006
Allow setting remaining standard calibre metadata in ODT files 2019-09-17 15:29:28 +05:30
Kovid Goyal
d2eca068fc
Use lxml to set ODT metadata as well 2019-09-17 13:57:48 +05:30
Kovid Goyal
329f4d262e
Use lxml to read ODT metadata 2019-09-17 10:26:19 +05:30
Kovid Goyal
9790713949
Merge branch '1841506_Embed_MetaData_odt' of https://github.com/pieplu/calibre
Fixes #1841506 [Embed MetaData do not works with .odt files](https://bugs.launchpad.net/calibre/+bug/1841506)
2019-09-17 09:30:51 +05:30
Kovid Goyal
2336168f00
Fallback to keywords if there is no keyword 2019-09-17 09:10:51 +05:30
Alexis Piéplu
5dfbe32c13 Use encode('utf-8') insted str on odt ste_metadata
1841506
2019-09-16 22:55:50 -04:00
Alexis Piéplu
b4bdf7445b Fix typo keywords -> keyword
On get_metadata for odt file
1844210
2019-09-16 22:17:31 -04:00
Alexis Piéplu
10cd485766 Implement setMetadata for odt files
1841506
2019-09-16 22:02:20 -04:00
Kovid Goyal
d1248f8260
Fix the re_group() and eval() formatter functions not working 2019-09-17 07:03:47 +05:30
Kovid Goyal
370ed05c57
Fix series index always 1 in header/footer in the viewer 2019-09-16 21:05:33 +05:30
Kovid Goyal
6d2d0d8201
Skip the webengine build test on macOS build VM as it is flaky 2019-09-16 13:56:41 +05:30
Kovid Goyal
e0f5a5aab4
typo 2019-09-16 13:35:41 +05:30
Kovid Goyal
f680f10ead
typo 2019-09-16 13:31:09 +05:30
Kovid Goyal
523850de45
Fix translation warnings
Apparently msgfmt does not like unicode
2019-09-16 11:23:06 +05:30
Kovid Goyal
7f0469e044
Bump beta version 2019-09-16 11:15:39 +05:30
Kovid Goyal
9448bf3537
Since we can set the user agent font size in the standalone viewer, use that instead of overriding the font size of <html> 2019-09-16 11:13:45 +05:30
Kovid Goyal
15a512f3c8
Typo 2019-09-16 11:09:17 +05:30
Kovid Goyal
2ca39a8066
Fix images longer than a page being rendered on multiple pages instead of being rescaled
Apparently in newer blink engines bounding rect height is set to viewport
height for images even if they stretch over multiple columns.
2019-09-16 11:07:01 +05:30
Kovid Goyal
599d3dbddc
Only add element for user stylesheet if needed and add it to html rather
than body
2019-09-16 10:05:42 +05:30
Kovid Goyal
62810e5111
p3 compat: Dont compare None to float 2019-09-16 08:53:32 +05:30
Kovid Goyal
ad384c7fd8
Only set the users font size on <html> not <body>
There are apparently books out their that rely on being able to control
the font size of <body>.
2019-09-16 08:43:54 +05:30
Kovid Goyal
ecaa920e06
bypass cache on reload 2019-09-15 05:01:34 +05:30
Kovid Goyal
d8281cad6b
Setting the URL is not really a clear operation 2019-09-15 05:00:38 +05:30
Kovid Goyal
97087b89ab
Fix Inspector not working in the viewer 2019-09-15 04:56:44 +05:30
Kovid Goyal
277d1f8bad
Report blocked navigation requests 2019-09-15 04:52:00 +05:30
Kovid Goyal
b900419810
Micro optimization 2019-09-15 04:34:23 +05:30
Kovid Goyal
f3f244c41b
Indicate if the viewer code is being compiled or not 2019-09-14 08:58:36 +05:30
Kovid Goyal
c946f3239e
Bump beta version 2019-09-13 21:00:08 +05:30
Kovid Goyal
e95ab50cba
A demo plugin that shows how to run webengine from a user interface plugin 2019-09-13 20:55:06 +05:30
Kovid Goyal
737bfa44cb
Remove ViewerPlugin since the new viewer currently has no plugin architecture 2019-09-13 20:14:18 +05:30
Kovid Goyal
e8f5b51b6c
Also apply book details stylesheet to comments editor widget 2019-09-13 14:14:19 +05:30
Kovid Goyal
4d937e2d5d
Make refresh of book details panel after preferences work when there is no current index as well 2019-09-13 14:04:46 +05:30
Kovid Goyal
77141acd8b
Forgot to also use central css for details popup 2019-09-13 13:54:26 +05:30
Kovid Goyal
901f1b1b74
Centralize all CSS used by book details 2019-09-13 13:52:46 +05:30
Kovid Goyal
a37805bdc9
Add some UI to edit the book details CSS 2019-09-13 13:21:15 +05:30
Kovid Goyal
286f69bf9d
Fix get_debug_executable() 2019-09-13 11:33:44 +05:30
Kovid Goyal
61005add0d
Add support for run-local to calibre restart and run_calibre_debug 2019-09-13 10:28:26 +05:30
Kovid Goyal
5f090e1175
Make the page turn left/right margins less obstrusive 2019-09-13 09:13:38 +05:30
Kovid Goyal
25639069db
Show viewer controls help twice not once on first run 2019-09-13 09:13:38 +05:30
Kovid Goyal
1a442ec1d1
Only show th eloading spinner is loading takes more than 200ms 2019-09-13 09:13:38 +05:30
Kovid Goyal
8871de91f3
... 2019-09-13 09:13:37 +05:30
Kovid Goyal
1668365156
Micro optimization 2019-09-13 09:13:37 +05:30
Kovid Goyal
043f9a5b88
Workaround for error in scroll_to() on some japanese books with vertical text 2019-09-13 09:13:37 +05:30
Kovid Goyal
e93404f98a
Bump beta version 2019-09-13 09:13:37 +05:30
Kovid Goyal
bc54f9dbbb
Viewer: Fix rendering of fullscreen images using SVG markup 2019-09-13 09:13:37 +05:30
Kovid Goyal
400450f193
Fix down key in flow mode acting as up key 2019-09-13 09:13:37 +05:30
Kovid Goyal
d04234555d
Fix incorrect invocation of scrollBy 2019-09-13 09:13:37 +05:30
Kovid Goyal
cb5107472a
Allow titles to wrap in vertical layout of book details 2019-09-13 09:13:36 +05:30
Kovid Goyal
4b1a4861b8
Bump beta version 2019-09-13 09:13:36 +05:30
Kovid Goyal
86a1499ca7
Editor: Fix changes in CSS files not being picked up by the preview panel 2019-09-13 09:13:36 +05:30
Kovid Goyal
1d64be1032
Avoid error print on shutdown 2019-09-13 09:13:36 +05:30
Kovid Goyal
26b44e936c
Remove unused import 2019-09-13 09:13:36 +05:30
Kovid Goyal
9c0346bbb1
QTextBrowser should not require explicit link color override 2019-09-13 09:13:36 +05:30
Kovid Goyal
f069848639
Use the calibre user interface font family and size for viewer chrome 2019-09-13 09:13:36 +05:30
Kovid Goyal
25bc0dc6c5
Also make the Context Menu key a shortcut for showing viewer chrome 2019-09-13 09:13:36 +05:30
Kovid Goyal
d5bb19f8ec
Only import Pillow from PIL 2019-09-13 09:13:36 +05:30
Kovid Goyal
3a6ad1e03a
Add a build test for PIL JPEG support 2019-09-13 09:13:36 +05:30
Kovid Goyal
9607e1dc45
Bump beta version 2019-09-13 09:13:35 +05:30
Kovid Goyal
f83e99c9b5
Preserve scroll position in list of keyboard shortcuts when customizing a shortcut 2019-09-13 09:13:35 +05:30
Kovid Goyal
fe0cfc3bea
Use the book text colors for the loading screen
Makes it less obtrusive
2019-09-13 09:13:35 +05:30
Kovid Goyal
7198248ce9
Fix error when installing a new editor plugin because of web engine initialization 2019-09-13 09:13:35 +05:30
Kovid Goyal
1551df845c
Default to js version 6 when compiling RS 2019-09-13 09:13:35 +05:30
Kovid Goyal
bc6d38c8e3
Restore external RS compiler
While webengine is faster that duktape, the external compiler
still beats it.
2019-09-13 09:13:35 +05:30
Kovid Goyal
e8b21b2f29
Avoid a rare error when calculating CFI 2019-09-13 09:13:35 +05:30
Kovid Goyal
b6c3253fb9
Fix font settings for Editor preview not working 2019-09-13 09:13:35 +05:30
Kovid Goyal
a6097fab4a
Fix default font family type not being respected in the viewer settings 2019-09-13 09:13:35 +05:30
Kovid Goyal
2e50e22aa7
Also refuse to open .app urls 2019-09-13 09:13:35 +05:30
Kovid Goyal
85394a43a8
Fix comments not being displayed to the side in the horizontal book display panel
Thanks to limitations of Qt's HTML support we cant any longer have
comments text wrap around the rest of the metadata. Now the rest of the
metadata and the comments are display in 2:3 fixed columns
2019-09-13 09:13:35 +05:30
Kovid Goyal
1e96510e00
Fix manual not building 2019-09-13 09:13:34 +05:30
Kovid Goyal
b2b5395139
Windows: Fix library usage stats incorrect after import of data 2019-09-13 09:13:34 +05:30
Kovid Goyal
465195026b
Better test failure messages 2019-09-13 09:13:34 +05:30
Kovid Goyal
da4fc37684
Bump version number to beta level 2019-09-13 09:13:34 +05:30
Kovid Goyal
f10e278d74
PDF Output: Fix incorrect rendering when the same font is used at multiple sizes in the document
Chromium produces width arrays in the font descriptors that contain
different values for the same glyph in different font subsets, so rather
than merging the arrays, use the actual width values from the font.

As per the PDF spec the values in these arrays must match the underlying
font anyway.
2019-09-13 09:12:39 +05:30
Kovid Goyal
7366d8f57a
Check glyph definition sizes are identical when merging ttf fonts 2019-09-13 09:12:39 +05:30
Kovid Goyal
c77156d47b
Fix failing test on py3 2019-09-13 09:12:39 +05:30
Kovid Goyal
a3ac1900f6
Work on windows CI 2019-09-13 09:12:39 +05:30
Kovid Goyal
2f2b3cf638
Fix crashes when using webengine on windows with no native GUI
Tell Qt to use the software OpenGL renderer in headless mode on windows.
2019-09-13 09:12:39 +05:30
Kovid Goyal
e06094c458
Dont use the external rapydscript tool, since web engine is fast enough 2019-09-13 09:12:37 +05:30
Kovid Goyal
f233cbd7f8
Nicer failure check 2019-09-13 09:12:37 +05:30
Kovid Goyal
46f5413b34
Port the RS gettext funcs to use webengine 2019-09-13 09:12:37 +05:30
Kovid Goyal
1fbfffd772
Use range iteration for some more loops 2019-09-13 09:12:37 +05:30
Kovid Goyal
bc68e6e735
Fix crash when altering links in PDF
Cannot create new dest arrays while iterating over all objects, since
doing so alters the set of all objects
2019-09-13 09:12:37 +05:30
Kovid Goyal
d1ee01b421
Fix header/fotter + added toc not working 2019-09-13 09:12:37 +05:30
Kovid Goyal
9bea79b1bb
... 2019-09-13 09:12:37 +05:30
Kovid Goyal
0319ad478a
Use atomic_rename 2019-09-13 09:12:36 +05:30
Kovid Goyal
7f1519989f
Catch all exceptions when altering links 2019-09-13 09:12:36 +05:30
Kovid Goyal
8d0f0cef93
Fix compiler warnings 2019-09-13 09:12:36 +05:30
Kovid Goyal
a12da69ba9
Decrease min height for compress losslessly dialog 2019-09-13 09:12:36 +05:30
Kovid Goyal
9a1e55153b
... 2019-09-13 09:12:36 +05:30
Kovid Goyal
03ea489695
Use a fixed size hint for the inspector dock since it starts out empty 2019-09-13 09:12:36 +05:30
Kovid Goyal
9eba7a5f60
Ensure inspector dock connect works 2019-09-13 09:12:36 +05:30
Kovid Goyal
c238a249af
Remove last references to QT_PLUGIN_PATH 2019-09-13 09:12:36 +05:30
Kovid Goyal
89f5a0b183
Do not run the webengine build test on windows as it causes a crash on exit under cygwin+ssh 2019-09-13 09:12:36 +05:30
Kovid Goyal
cb091ea844
Suppress compiler warning for unused parameter 2019-09-13 09:12:35 +05:30
Kovid Goyal
994befe846
Properly port in_paged_mode 2019-09-13 09:12:35 +05:30
Kovid Goyal
22a1481bcd
De-vendor hunspell 2019-09-13 09:12:35 +05:30
Kovid Goyal
58f5577a13
Get rid of QT_PLUGIN_PATH on macOS 2019-09-13 09:12:35 +05:30
Kovid Goyal
e00835e5c6
Get the GUI apps working on macOS with proper doc integration 2019-09-13 09:12:35 +05:30
Kovid Goyal
dcca1a9ec6
Only redraw actual spinner items 2019-09-13 09:12:34 +05:30
Kovid Goyal
a7453e877a
Simplify launching of console utilities on macOS 2019-09-13 09:12:34 +05:30
Kovid Goyal
b8968a82f8
Fix PDF conversion failling when temp dir has symlinks 2019-09-13 09:12:34 +05:30
Kovid Goyal
133ed8968f
Add a plist to the utils bundle
Also move it to where it is easy to sign
2019-09-13 09:12:34 +05:30
Kovid Goyal
b5a16dc10c
Ensure webengine test does not hang 2019-09-13 09:12:34 +05:30
Kovid Goyal
22e3558a05
Move the utilities into their own bundle 2019-09-13 09:12:34 +05:30
Kovid Goyal
16ea6403a0
typo 2019-09-13 09:12:34 +05:30
Kovid Goyal
c7a2178d24
Handle links with a target in the standalone viewer 2019-09-13 09:12:34 +05:30
Kovid Goyal
566bfe6df2
Fix scroll by page always scrolling forward in flow mode 2019-09-13 09:12:34 +05:30
Kovid Goyal
fa93b0d605
... 2019-09-13 09:12:34 +05:30
Kovid Goyal
f4f29c84c0
... 2019-09-13 09:12:33 +05:30
Kovid Goyal
5e6623bcda
Show home page if opening book fails 2019-09-13 09:12:33 +05:30
Kovid Goyal
20f6152a95
... 2019-09-13 09:12:33 +05:30
Kovid Goyal
0f0df3b5e2
Get webengine loading in the binary build 2019-09-13 09:12:33 +05:30
Kovid Goyal
afd483f11a
Actions to copy text/URL and view image 2019-09-13 09:12:33 +05:30
Kovid Goyal
f70eed9da3
Add build test for Qt WebEngine 2019-09-13 09:12:32 +05:30
Kovid Goyal
921110eb46
Code to migrate old viewer preferences 2019-09-13 09:12:32 +05:30
Kovid Goyal
c1ac799c0b
Get Esc working in any panel 2019-09-13 09:12:32 +05:30
Kovid Goyal
36af3928b0
Dont respond to keypresses while the overlay is visible 2019-09-13 09:12:32 +05:30
Kovid Goyal
21f5fbdf1d
Make the controls help page nicer 2019-09-13 09:12:32 +05:30
Kovid Goyal
351bae75b0
Specialize controls help for standalone viewer 2019-09-13 09:12:32 +05:30
Kovid Goyal
8b62a6bcbb
Coupe of misc shortcuts 2019-09-13 09:12:32 +05:30
Kovid Goyal
e58a50e7ed
Shortcut for toggling fullscreen 2019-09-13 09:12:32 +05:30
Kovid Goyal
ece5180a80
Add shortcuts to change font size 2019-09-13 09:12:32 +05:30
Kovid Goyal
3d4dae9d08
Fix find not working backwards across loads 2019-09-13 09:12:32 +05:30
Kovid Goyal
5e05b450a3
Implement search shortcuts 2019-09-13 09:12:32 +05:30
Kovid Goyal
566855ed55
Shortcuts for UI panels 2019-09-13 09:12:32 +05:30
Kovid Goyal
1102216d9f
Get back and forward working in the standalone viewer 2019-09-13 09:12:31 +05:30
Kovid Goyal
a4f1b54421
Back/forward keyboard shortcuts 2019-09-13 09:12:31 +05:30
Kovid Goyal
e1ce4976e6
Update keyboard shortcuts when changed 2019-09-13 09:12:31 +05:30
Kovid Goyal
c106d48163
UI for changing keyboard shortcuts is done 2019-09-13 09:12:31 +05:30
Kovid Goyal
e91e414687
Work on preferences UI for keyboard shortcuts 2019-09-13 09:12:31 +05:30
Kovid Goyal
2523d6605e
Get rid of legacy keycodes mapping 2019-09-13 09:12:31 +05:30
Kovid Goyal
82fcdf6272
Refactor keyboard handling in the viewer
No longer uses deprecated APIs
2019-09-13 09:12:31 +05:30
Kovid Goyal
2548babf59
UI to manage lookup sources 2019-09-13 09:12:31 +05:30
Kovid Goyal
31118409ae
... 2019-09-13 09:12:31 +05:30
Kovid Goyal
37bde2c949
... 2019-09-13 09:12:31 +05:30
Kovid Goyal
755cf383a3
Only remove elements when doing a google dictionary search 2019-09-13 09:12:31 +05:30
Kovid Goyal
1f9ac958e2
Clean up dock creation 2019-09-13 09:12:31 +05:30
Kovid Goyal
ded9e3ef70
Word lookup now works 2019-09-13 09:12:30 +05:30
Kovid Goyal
3772cfbfba
Work on word lookup 2019-09-13 09:12:30 +05:30
Kovid Goyal
5503ad9d12
Make currently selected text available to the overlay 2019-09-13 09:12:30 +05:30
Kovid Goyal
b480086d00
Ensure iframe is focused after controls help is shown 2019-09-13 09:12:30 +05:30
Kovid Goyal
102be318d8
Ensure iframe has focus after overlay is closed
Also use the regular overlay mechanism for metadata and
location overlays
2019-09-13 09:12:30 +05:30
Kovid Goyal
782c088bb9
Properly remove all attributes when unserializing HTML from the existin
HTML, HEAD and BODY tags
2019-09-13 09:12:30 +05:30
Kovid Goyal
dc887b9780
Fix delete book invocation 2019-09-13 09:12:30 +05:30
Kovid Goyal
59b6c17ac2
Implement --open-at 2019-09-13 09:12:30 +05:30
Kovid Goyal
031b14fc78
Implement Go to location (with CFI) 2019-09-13 09:12:30 +05:30
Kovid Goyal
cd71b471e1
Implement --continue 2019-09-13 09:12:30 +05:30
Kovid Goyal
4476d63b27
Add an action to show the chrome dev tools in the viewer 2019-09-13 09:12:30 +05:30
Kovid Goyal
5ba3eb19db
Fix display of basic metadata in standalone viewer 2019-09-13 09:12:30 +05:30
Kovid Goyal
95aa3a50c2
Implement opening of local ebook files 2019-09-13 09:12:29 +05:30
Kovid Goyal
48a2990600
Set viewer window title 2019-09-13 09:12:29 +05:30
Kovid Goyal
7cfe60f705
Implement remaining two misc prefs 2019-09-13 09:12:29 +05:30
Kovid Goyal
d9c1eb14d7
Implement preference to restore window geometry 2019-09-13 09:12:29 +05:30
Kovid Goyal
95dc6a06ad
UI for misc settings 2019-09-13 09:12:29 +05:30
Kovid Goyal
c14adff36e
Add a restore defaults button to font preferences 2019-09-13 09:12:29 +05:30
Kovid Goyal
7914ad4244
UI for viewer font settings 2019-09-13 09:12:29 +05:30
Kovid Goyal
6100a4eeee
Cleanup insertion of translations data 2019-09-13 09:12:29 +05:30
Kovid Goyal
eeca114876
Wire up the bookmarks panel fully 2019-09-13 09:12:29 +05:30
Kovid Goyal
13be0d6712
... 2019-09-13 09:12:29 +05:30
Kovid Goyal
332f1e7e63
Fix popup footnotes not working in viewer 2019-09-13 09:12:29 +05:30
Kovid Goyal
45fa8525ba
Implement toggling of bookmarks panel 2019-09-13 09:12:29 +05:30
Kovid Goyal
d97db810c0
Start work on bookmarks panel 2019-09-13 09:12:28 +05:30
Kovid Goyal
34f48e00d2
... 2019-09-13 09:12:28 +05:30
Kovid Goyal
63cac76d80
Code to sort CFIs in JS 2019-09-13 09:12:28 +05:30
Kovid Goyal
f6371bce85
DRYer 2019-09-13 09:12:28 +05:30
Kovid Goyal
4f486558de
Add translations for the viewer interface 2019-09-13 09:12:28 +05:30
Kovid Goyal
0c7bcb0f8c
Implement full screen 2019-09-13 09:12:28 +05:30
Kovid Goyal
146b5dc6e3
Show the current ToC node in bold 2019-09-13 09:12:28 +05:30
Kovid Goyal
39d08d70fa
Disable cocoa's window tabbing and special menu items 2019-09-13 09:12:28 +05:30
Kovid Goyal
08081eaebb
Implement searching and clicking in the ToC 2019-09-13 09:12:28 +05:30
Kovid Goyal
02d8563efc
Work on adding an external dockable ToC panel 2019-09-13 09:12:28 +05:30
Kovid Goyal
98ecf220e6
Get changing font size and colors working 2019-09-13 09:12:28 +05:30
Kovid Goyal
9edb593773
Move forward_gesture() to ui_operations 2019-09-13 09:12:28 +05:30
Kovid Goyal
377b90ea0d
Implement reloading of book 2019-09-13 09:12:27 +05:30
Kovid Goyal
b2be6727f6
Load book data 2019-09-13 09:12:27 +05:30
Kovid Goyal
8b8bec6e6a
Get calibre-debug -w working again 2019-09-13 09:12:27 +05:30
Kovid Goyal
bb03370e5a
... 2019-09-13 09:12:27 +05:30
Kovid Goyal
cbd40617f3
Use short lines when serializing bookmarks 2019-09-13 09:12:27 +05:30
Kovid Goyal
563b926e4b
Store annotations in EPUB files 2019-09-13 09:12:27 +05:30
Kovid Goyal
bc8fdc4ced
Code to update cached conversions 2019-09-13 09:12:27 +05:30
Kovid Goyal
55fbc89eb6
Slow an initial load spinner while book is being rendered 2019-09-13 09:12:27 +05:30
Kovid Goyal
67fcb5345d
DRYer 2019-09-13 09:12:27 +05:30
Kovid Goyal
a38defca58
Implement loading of annotations from multiple sources 2019-09-13 09:12:27 +05:30
Kovid Goyal
742f322f89
Implement save/restore of last read position 2019-09-13 09:12:27 +05:30
Kovid Goyal
2eefa97a1d
When displaying book, ensure the iframe has focus 2019-09-13 09:12:27 +05:30
Kovid Goyal
85b8ee0130
Use the newer technique for setting app uid 2019-09-13 09:12:26 +05:30
Kovid Goyal
8cb9dc1ca1
py3: Fix compilation of viewer code 2019-09-13 09:12:26 +05:30
Kovid Goyal
cd64459718
Fix errors reported in the console for listeners that use preventDefault() 2019-09-13 09:12:26 +05:30
Kovid Goyal
84c8544e14
Cleanup python str -> podofo str 2019-09-13 09:12:26 +05:30
Kovid Goyal
bc4c988fce
typo 2019-09-13 09:12:26 +05:30
Kovid Goyal
66eebb954d
Fix building on py2 2019-09-13 09:12:26 +05:30
Kovid Goyal
e4c763d23e
Add support for maths to PDF output 2019-09-13 09:12:26 +05:30
Kovid Goyal
0f02312390
De-dup images in the PDF 2019-09-13 09:12:26 +05:30
Kovid Goyal
bdebe91156
Spped up fonts_are_identical 2019-09-13 09:12:26 +05:30
Kovid Goyal
e77df26174
Fix merging of loca tables 2019-09-13 09:12:26 +05:30
Kovid Goyal
dd5961af10
Write the loca table in optimum format
Also update the head and maxp tables when subsetting
2019-09-13 09:12:26 +05:30
Kovid Goyal
7b6dc6eed9
Dont bother merging identical TrueType fonts, simply pick one and discard the rest 2019-09-13 09:12:25 +05:30
Kovid Goyal
bf602f48ed
Detect font usage inside XObjects as well 2019-09-13 09:12:25 +05:30
Kovid Goyal
c842a82a0f
When replacing font references do it in XObjects as well 2019-09-13 09:12:25 +05:30
Kovid Goyal
227679985f
Implement imposing headers/footers onto their target pages 2019-09-13 09:12:25 +05:30
Kovid Goyal
848d91c6d8
Hide overflow from headers/footers 2019-09-13 09:12:25 +05:30
Kovid Goyal
b8dc1d791c
Dont use iframes for header/footers
This breaks backwards compat with javascript, but backwards compat is
not really preserved anyway. Much better performance without iframes
2019-09-13 09:12:25 +05:30
Kovid Goyal
e64b8b11fb
Ensure no resources are loaded from outside the container 2019-09-13 09:12:25 +05:30
Kovid Goyal
8fcd240844
Dont need settle_time for header/footer rendering 2019-09-13 09:12:25 +05:30
Kovid Goyal
93b5adacdb
Add support for _SECTION_ in templates 2019-09-13 09:12:25 +05:30
Kovid Goyal
4e3e0f8461
Work on adding headers/footers 2019-09-13 09:12:25 +05:30
Kovid Goyal
316d0c35a1
... 2019-09-13 09:12:25 +05:30
Kovid Goyal
b6c8d9da5e
Dont bother hashing object numbers, just use them directly as the hash 2019-09-13 09:12:25 +05:30
Kovid Goyal
e080435407
Just use size as hash 2019-09-13 09:12:24 +05:30
Kovid Goyal
66b7037cd2
Deduplicate Type3 glyph definitions 2019-09-13 09:12:24 +05:30
Kovid Goyal
32d483b3ce
Cleaner exception handling 2019-09-13 09:12:24 +05:30
Kovid Goyal
157c5a1cb7
py3 porting 2019-09-13 09:12:24 +05:30
Kovid Goyal
6057bcbb5a
Also delete DescendantFonts of Type0 fonts 2019-09-13 09:12:24 +05:30
Kovid Goyal
7f3bd476d3
Add support for removing unused Type3 fonts as well 2019-09-13 09:12:24 +05:30
Kovid Goyal
470193f222
Restore the --uncompressed-pdf option 2019-09-13 09:12:24 +05:30
Kovid Goyal
0d1b99a4a4
Implement merging of cmaps 2019-09-13 09:12:24 +05:30
Kovid Goyal
b573c33d1c
Merging fonts now works for truetype fonts 2019-09-13 09:12:24 +05:30
Kovid Goyal
c383a2ce25
Add a tooltip documenting the use of the custom URL field 2019-09-13 09:12:24 +05:30
Kovid Goyal
d304e08ec1
Code to merge W arrays 2019-09-13 09:12:24 +05:30
Kovid Goyal
d994cf7895
Work on merging fonts 2019-09-13 09:12:24 +05:30
Kovid Goyal
929f65ecf2
Optionally get font data when listing fonts 2019-09-13 09:12:23 +05:30
Kovid Goyal
0705abf946
Convert individual HTML files separately
Merge fonts instead.
2019-09-13 09:12:23 +05:30
Kovid Goyal
19ca8d8bd8
Couple more PDF utilities 2019-09-13 09:12:23 +05:30
Kovid Goyal
4bf5b9c755
Use a namedtuple for margins
Makes it hashable
2019-09-13 09:12:23 +05:30
Kovid Goyal
b2472ea80a
Fix link updating not working 2019-09-13 09:12:23 +05:30
Kovid Goyal
6a56d253dc
Make AnchorLocation mutable 2019-09-13 09:12:23 +05:30
Kovid Goyal
4a362c31b0
Dont load calibre fonts since webengine does not use them anyway 2019-09-13 09:12:23 +05:30
Kovid Goyal
6caf7cf77a
Remove unused fonts from generated PDF 2019-09-13 09:12:23 +05:30
Kovid Goyal
24a344546e
DRYer 2019-09-13 09:12:23 +05:30
Kovid Goyal
4132a874d9
Just use a space char for links 2019-09-13 09:12:23 +05:30
Kovid Goyal
1e9517f40f
When listing fonts check if they are used 2019-09-13 09:12:23 +05:30
Kovid Goyal
dfc09ede98
Get the tests to pass with webengine 2019-09-13 09:12:22 +05:30
Kovid Goyal
a528cef0ee
py3 fixes 2019-09-13 09:12:22 +05:30
Kovid Goyal
10e5d3c486
Code to get used fonts in a page 2019-09-13 09:12:22 +05:30
Kovid Goyal
c4e3fda682
Code to list fonts in a PDF file 2019-09-13 09:12:22 +05:30
Kovid Goyal
e575be49e3
Add support for page number mapping 2019-09-13 09:12:22 +05:30
Kovid Goyal
43d7e2119a
Implement printable ToC for PDF Output 2019-09-13 09:12:22 +05:30
Kovid Goyal
089789dd19
Report progress in PDF text output plugin 2019-09-13 09:12:22 +05:30
Kovid Goyal
9f87cd7f99
Add a note about using page margins from the input document 2019-09-13 09:12:22 +05:30
Kovid Goyal
974070ef93
Log toc entry resolution failures 2019-09-13 09:12:22 +05:30
Kovid Goyal
32e83987d6
PDF Outline generation now works 2019-09-13 09:12:22 +05:30
Kovid Goyal
39dae008c2
Use PdfDestination to create destinations 2019-09-13 09:12:22 +05:30
Kovid Goyal
27c200ea8d
Run conversion of each margin group to PDF in parallel 2019-09-13 09:12:22 +05:30
Kovid Goyal
f0584b8fdb
Get document links working when PDF is generated in parts 2019-09-13 09:12:21 +05:30
Kovid Goyal
7b03c7567c
Some TODOs 2019-09-13 09:12:21 +05:30
Kovid Goyal
0cebe16938
Get anchor locations from PDF segments 2019-09-13 09:12:21 +05:30
Kovid Goyal
600f71fda6
Fix preview going to top anchor not working 2019-09-13 09:12:21 +05:30
Kovid Goyal
5067454aa4
PDF Output: Add support for document margins 2019-09-13 09:12:21 +05:30
Kovid Goyal
19fc96cb31
Remove no longer implementable option 2019-09-13 09:12:21 +05:30
Kovid Goyal
6814d9e424
Report progress writing images 2019-09-13 09:12:21 +05:30
Kovid Goyal
56a3427b99
Use PDFStream to set metadata for image PDFs
No need to reparse via PoDoFo
2019-09-13 09:12:21 +05:30
Kovid Goyal
22ba6c3ab7
Pass JPEG images unmodified when creating PDF image pages 2019-09-13 09:12:21 +05:30
Kovid Goyal
4815c6167e
Use the calibre PDF engine for image to PDF conversion
Will allow us to pass through JPG images unmodified
2019-09-13 09:12:21 +05:30
Kovid Goyal
8029b3cc83
Code to add cover to textual PDF output 2019-09-13 09:12:21 +05:30
Kovid Goyal
6c78ae2105
Nicer page break insertion 2019-09-13 09:12:20 +05:30
Kovid Goyal
87b86d86a8
Implement setting metadata in textual PDFs 2019-09-13 09:12:20 +05:30
Kovid Goyal
b25766f6aa
Basic PDF output works 2019-09-13 09:12:20 +05:30
Kovid Goyal
4abfcc46ab
Implement PDF Output font options 2019-09-13 09:12:20 +05:30
Kovid Goyal
d52134a6cd
Move Qt initialization to earlier in the conversion pipeline 2019-09-13 09:12:20 +05:30
Kovid Goyal
9315b2bec4
Use full page mode when printing images to PDF 2019-09-13 09:12:20 +05:30
Kovid Goyal
4ee889d3d9
py3 compat 2019-09-13 09:12:20 +05:30
Kovid Goyal
f4941219b9
Code to extract anchor positions from PDF files generated by web engine 2019-09-13 09:12:20 +05:30
Kovid Goyal
c8619893e0
remove unused code 2019-09-13 09:12:20 +05:30
Kovid Goyal
7803f3de36
Rename viewer2 to viewer 2019-09-13 09:12:20 +05:30
Kovid Goyal
8634fb30f6
Set metadata when outputting comic PDF 2019-09-13 09:12:20 +05:30
Kovid Goyal
0470df53d5
Make the PoDoFo metadata setting code re-useable 2019-09-13 09:12:19 +05:30
Kovid Goyal
b5b0891421
Start work on porting the PDF output plugin to use web engine 2019-09-13 09:12:19 +05:30
Kovid Goyal
b7e57597a3
Implement context menu for comments editor 2019-09-13 09:12:19 +05:30
Kovid Goyal
8abe395507
Implement support for images and links 2019-09-13 09:12:19 +05:30
Kovid Goyal
ba28b2e5f7
Make the block style actions checkable
Also use the same values for margins as used by Qt
2019-09-13 09:12:19 +05:30
Kovid Goyal
53caa824cf
Implement foreground 2019-09-13 09:12:19 +05:30
Kovid Goyal
35e531a737
Implement the block alignment actions 2019-09-13 09:12:19 +05:30
Kovid Goyal
5ac8d64c55
Implement underline and strikethrough 2019-09-13 09:12:19 +05:30
Kovid Goyal
fcb72c0075
Make the list actions toggles 2019-09-13 09:12:19 +05:30
Kovid Goyal
9c5aaade6f
Implement bold and italic toggles 2019-09-13 09:12:19 +05:30
Kovid Goyal
93fc64184e
DRYer 2019-09-13 09:12:19 +05:30
Kovid Goyal
04d58d6877
Implement insertion of <hr> 2019-09-13 09:12:19 +05:30
Kovid Goyal
77e2524174
Use <s> for strikethrough 2019-09-13 09:12:18 +05:30
Kovid Goyal
356f65cd5b
Remove format should work even with no selection 2019-09-13 09:12:18 +05:30
Kovid Goyal
a737b0e786
Use implicit styling for character styles where possible 2019-09-13 09:12:18 +05:30
Kovid Goyal
dca67dae61
Cleanup markup produced by QTextEdit
Also use the same technique for headings as used by
Qt itself.
2019-09-13 09:12:18 +05:30
Kovid Goyal
eee6720f99
Implement block formatting 2019-09-13 09:12:18 +05:30
Kovid Goyal
5cba1261f5
Implement text-indent 2019-09-13 09:12:18 +05:30
Kovid Goyal
badb775611
Implement super/sub-script 2019-09-13 09:12:18 +05:30
Kovid Goyal
ed843864a0
Implement list support 2019-09-13 09:12:18 +05:30
Kovid Goyal
943f5c00b1
Top row of comments editor implemented 2019-09-13 09:12:18 +05:30
Kovid Goyal
69ad2e2984
Get rid of remaining mainFrame references 2019-09-13 09:12:18 +05:30
Kovid Goyal
4ae788561b
... 2019-09-13 09:12:18 +05:30
Kovid Goyal
f410ca5e78
Implement clear 2019-09-13 09:12:17 +05:30
Kovid Goyal
25eb65e156
Work on replacing webkit in the comments editor 2019-09-13 09:12:17 +05:30
Kovid Goyal
371e5f9813
... 2019-09-13 09:12:17 +05:30
Kovid Goyal
9805f3a644
DRYer 2019-09-13 09:12:17 +05:30
Kovid Goyal
070ad5351e
Remove old viewer and coffeescript and viewer resources
Since the PDF output code is also going to be replaced, none
of this is required.
2019-09-13 09:12:17 +05:30
Kovid Goyal
2224f8e7ae
Ensure hang timer is stopped 2019-09-13 09:12:17 +05:30
Kovid Goyal
ff8965d510
Make embedded compiler behave more like external one 2019-09-13 09:12:17 +05:30
Kovid Goyal
055c2a9f2f
Ensure rendering of HTML does not hang 2019-09-13 09:12:17 +05:30
Kovid Goyal
d14acdaf67
py3: Port one more execfile() 2019-09-13 09:12:16 +05:30
Kovid Goyal
82083ddbb8
Drop the dependency on dukpy
The dukpy tests are failing on windows with VS 2017. Instead use Web
Engine to compile rapydscript code, when the rapydscript binary is not
present.
2019-09-13 09:12:16 +05:30
Kovid Goyal
a6576f0eff
LRF Output: Disable the table as image option
Implementing it using WebEngine is too painful and LRF is a useless
format anyway.
2019-09-13 09:12:16 +05:30
Kovid Goyal
6f86896da8
Dont use WebKit to render HTML for EPUB covers 2019-09-13 09:12:16 +05:30
Kovid Goyal
27798beaf6
Use a separate process for the ToC Editor from the main GUI
This is needed because the main GUI does not use web engine
2019-09-13 09:12:16 +05:30
Kovid Goyal
a304b67ce3
Remove WebKit from the ToC Editor 2019-09-13 09:12:16 +05:30
Kovid Goyal
e3fd6f9bff
Do not use WebKit to display book details
We are phasing out WebKit
2019-09-13 09:12:16 +05:30
Kovid Goyal
27c5324269
viewer2: Make serialization of book metadata more robust 2019-09-13 09:12:16 +05:30
Kovid Goyal
188c59b6e8
py3: webengine misc fixes 2019-09-13 09:12:16 +05:30
Kovid Goyal
1eaef1fe3a
py3: base64 port 2019-09-13 09:12:15 +05:30
Kovid Goyal
85fcea41fb
Finish porting of web store dialog to QtWebEngine 2019-09-13 09:12:15 +05:30
Kovid Goyal
c8e78749eb
Start work on migrating get books internal browser to web engine 2019-09-13 09:12:15 +05:30
Kovid Goyal
581c5d8988
Remove unneccessary reference to QWebView in .ui file 2019-09-13 09:12:15 +05:30
Kovid Goyal
47d2364a80
Explicitly use system proxy in QNetwork 2019-09-13 09:12:15 +05:30
Kovid Goyal
9c897eb926
Some more iteritems fixes 2019-09-13 09:12:15 +05:30
Kovid Goyal
08dfee0766
Register the clbr: fake network scheme with web engine 2019-09-13 09:12:15 +05:30
Kovid Goyal
289c42b87f
Make the current CFI available in python 2019-09-13 09:12:15 +05:30
Kovid Goyal
2c15434bab
DRYer 2019-09-13 09:12:15 +05:30
Kovid Goyal
1ccc979081
Use new mathjax location in viewer2 2019-09-13 09:12:15 +05:30
Kovid Goyal
f990929bef
Add code to handle unpatched MathJax 2019-09-13 09:12:14 +05:30
Kovid Goyal
e4e313f1d6
Proper fix for random crashes 2019-09-13 09:12:14 +05:30
Kovid Goyal
46c646e49d
Ensure the QWebEngineProfile has a parent 2019-09-13 09:12:14 +05:30
Kovid Goyal
a3ac8282d4
Fix loading of mathjax files 2019-09-13 09:12:14 +05:30
Kovid Goyal
bd99a17186
Back to loading mathjax via blob urls
Fucking stupid Content Security Policy
2019-09-13 09:12:14 +05:30
Kovid Goyal
8d27d68dff
Simplify loading of MathJax files 2019-09-13 09:12:14 +05:30
Kovid Goyal
c64349dc6b
... 2019-09-13 09:12:14 +05:30
Kovid Goyal
57a4f1c91d
Implement loading of mathjax files 2019-09-13 09:12:14 +05:30
Kovid Goyal
4a721d36a5
Load UI css at startup 2019-09-13 09:12:13 +05:30
Kovid Goyal
03f1a3eb48
Store a reference to the host widget 2019-09-13 09:12:13 +05:30
Kovid Goyal
4f87ea3ccc
Also serialize cover when rendering books for viewer 2019-09-13 09:12:13 +05:30
Kovid Goyal
56baf848fc
Make the Inspector dock widget work 2019-09-13 09:12:13 +05:30
Kovid Goyal
fa23f3d43f
Add a dock for the inspector 2019-09-13 09:12:13 +05:30
Kovid Goyal
c4295355a2
... 2019-09-13 09:12:13 +05:30
Kovid Goyal
8234dc5436
Load HTML resources for viewer 2019-09-13 09:12:13 +05:30
Kovid Goyal
f721d49e32
Loading resources now works 2019-09-13 09:12:13 +05:30
Kovid Goyal
a2fd1ca90f
... 2019-09-13 09:12:13 +05:30
Kovid Goyal
387b5b2ed5
Implement get_file() 2019-09-13 09:12:13 +05:30
Kovid Goyal
da04475ff1
Also load metadata when loading manifest 2019-09-13 09:12:13 +05:30
Kovid Goyal
d62024d1b1
Fix error reporting in the new viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
783ff58129
Implement basic settings storage for new viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
b862af3844
More work on the new viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
8b0cdbad13
Connect up the Qt bridge in the viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
25ef13c6ee
... 2019-09-13 09:12:12 +05:30
Kovid Goyal
b83a299bfd
Remove call to read_data() as it no longer exists 2019-09-13 09:12:12 +05:30
Kovid Goyal
9b3d5d486b
Work on reafactoring read_book module to make it useable in standalone viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
953734320b
... 2019-09-13 09:12:12 +05:30
Kovid Goyal
6e14daac89
Infrastructure for loading viewer js 2019-09-13 09:12:12 +05:30
Kovid Goyal
7b75c67e15
More work on the new viewer 2019-09-13 09:12:12 +05:30
Kovid Goyal
559adc51a2
Basic web view implementation for the new viewer 2019-09-13 09:12:11 +05:30
Kovid Goyal
f6edb4de07
Make cache expiring code a little more robust 2019-09-13 09:12:11 +05:30
Kovid Goyal
521181280b
Try twice to delete cache entries on windows
Thanks to the idiotic mandatory file locking, we can never be sure that
some stupid windows service like an antivirus/filesync program has not locked
the cache files.
2019-09-13 09:12:11 +05:30
Kovid Goyal
59b9357c0c
Add tests for the new viewer cache 2019-09-13 09:12:11 +05:30
Kovid Goyal
67cce4e563
Caching system for conversion of books into useable form in the new viewer 2019-09-13 09:12:11 +05:30
Kovid Goyal
2c669bf853
More work on the new viewer 2019-09-13 09:12:11 +05:30
Kovid Goyal
200d38d2f5
Start work on new viewer implementation 2019-09-13 09:12:11 +05:30
Kovid Goyal
1216ed3200
Change fake protocol scheme to clbr 2019-09-13 09:12:11 +05:30
Kovid Goyal
0f0470a9ee
Live CSS: Fix properties from more distant ancestors overriding properties from nearer ancestors with the same specificity 2019-09-13 09:12:11 +05:30
Kovid Goyal
44fa281f86
... 2019-09-13 09:12:11 +05:30
Kovid Goyal
eebafd9454
More work on live css, basically works 2019-09-13 09:12:11 +05:30
Kovid Goyal
8c1a3e0467
Move the live css related client side code into its own module 2019-09-13 09:12:10 +05:30
Kovid Goyal
4eb75032db
Start work on porting live css 2019-09-13 09:12:10 +05:30
Kovid Goyal
8aa52dbcba
Do not restart render process on normal termination 2019-09-13 09:12:10 +05:30
Kovid Goyal
2bd6939fbd
Only show dead renderer error once 2019-09-13 09:12:10 +05:30
Kovid Goyal
7c09812742
Only load the inspector on demand 2019-09-13 09:12:10 +05:30
Kovid Goyal
c6d6716965
Try restarting the render process on crash
Also only load the link reports web view on demand
2019-09-13 09:12:10 +05:30
Kovid Goyal
c9b2578b33
Fix preview not scrolling to anchor when clicking an internal link to another html file in the book 2019-09-13 09:12:10 +05:30
Kovid Goyal
92fe190f63
Drop use of Qt Web Channel
One less possible cause of lifetime related crashes/leaks.  Plus my
custom solution has a nicer interface. It's slower but since
communication between python and js is not a bottleneck...
2019-09-13 09:12:10 +05:30
Kovid Goyal
883717039e
Go to anchor explicitly in the preview 2019-09-13 09:12:10 +05:30
Kovid Goyal
50ed25a6d9
Dont assume head exists 2019-09-13 09:12:10 +05:30
Kovid Goyal
cae36d2cc1
Avoind double serialization of sourceline address 2019-09-13 09:12:10 +05:30
Kovid Goyal
37c277d684
Fix split button 2019-09-13 09:12:09 +05:30
Kovid Goyal
67f3422438
Port addition of css for split marker 2019-09-13 09:12:09 +05:30
Kovid Goyal
38836de4e1
Make a webengine utils module 2019-09-13 09:12:09 +05:30
Kovid Goyal
561edbe1ea
Two-way syncing work again 2019-09-13 09:12:09 +05:30
Kovid Goyal
5e55554454
Restore inspector functionality for the preview pane 2019-09-13 09:12:09 +05:30
Kovid Goyal
00a9d0f275
Migrate editor coffee script to rapydscript 2019-09-13 09:12:09 +05:30
Kovid Goyal
943f07b1fd
... 2019-09-13 09:12:09 +05:30
Kovid Goyal
c5366521eb
Context menu works 2019-09-13 09:12:09 +05:30
Kovid Goyal
fe25b8d8f6
Search functionality works 2019-09-13 09:12:09 +05:30
Kovid Goyal
84a884e49e
Loading documents in preview panel works 2019-09-13 09:12:09 +05:30
Kovid Goyal
8877445c78
work on porting editor preview to web engine 2019-09-13 09:12:09 +05:30
Kovid Goyal
40cc61397b
Replace webkit with webengine in the reports tool 2019-09-13 09:12:09 +05:30
Kovid Goyal
290c74fd73
pep8 2019-09-13 08:16:46 +05:30
Kovid Goyal
10bfd1406b
version 3.48.0 2019-09-13 08:16:01 +05:30
Kovid Goyal
31a7a043d3
... 2019-09-13 07:26:45 +05:30
Kovid Goyal
1bb9f07886
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-09-13 07:16:13 +05:30
Kovid Goyal
2866bffecf
Merge branch 'master' of https://github.com/davidfor/calibre 2019-09-13 07:13:43 +05:30
Eli Schwartz
2876724325
py3: make tcr input/output work
Fix tcr compression by unifying bytearrays on python2/python3 and acting
appropriately.
2019-09-12 19:51:20 -04:00
Eli Schwartz
8311b26205
wip: tcr compression
regex flags do not need "u" when the search string does not make use of the feature

In python3, re.U is the default for unicode strings. For byte strings,
which is what we use, it is a fatal error.
2019-09-12 19:47:19 -04:00
David
f964c130ab Add support for Kobo Libra H2O 2019-09-13 07:32:56 +10:00
Kovid Goyal
51d4b5a5e9
fixes for last py3 merge 2019-09-12 21:13:52 +05:30
Eli Schwartz
73caf890e6
finish up using universal __future__s
This finally transitions the entire codebase to passing:

python3 setup.py unicode_check
2019-09-12 10:57:06 -04:00
Eli Schwartz
7358e09e88
use context managers to open files for reading 2019-09-12 10:57:06 -04:00
Kovid Goyal
2ded6daf02
Merge branch 'master' of https://github.com/davidfor/calibre 2019-09-12 18:37:58 +05:30
David
8266ccd8c5 Fix some annotation fetching issues for Kobo devices
There have been some long-term problems with missed annotations for
kepubs. Plus a bug in the latest firmware causes problems with epub that
don't have a ToC entry for every file.
2019-09-12 22:51:35 +10:00
Kovid Goyal
2b8ac505e2
py3 porting 2019-09-11 16:22:01 +05:30
Kovid Goyal
eb37632940
py3 porting 2019-09-11 15:55:30 +05:30
Kovid Goyal
2742bd7e29
Dont use BS to generate NCX files for ebook catalogs
It is very slow and buggy
2019-09-11 10:46:59 +05:30
Kovid Goyal
1b4f77d0ac
Dont use BS to generate OPF files for ebook catalogs
It is extremely buggy
2019-09-11 07:52:44 +05:30
Kovid Goyal
cdc26fa38e
Fix for last py3 merge 2019-09-10 20:51:42 +05:30
Kovid Goyal
976ee75b7b
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-09-10 18:47:30 +05:30
Kovid Goyal
24868ee39c
Fix #1843361 [Welcome screen strings does not change language](https://bugs.launchpad.net/calibre/+bug/1843361) 2019-09-10 18:11:33 +05:30
Kovid Goyal
de505a1a34
Fix from last py3 merge 2019-09-10 17:34:27 +05:30
Eli Schwartz
cdc2e21a77
use raw strings where possible to avoid escaping 2019-09-10 01:13:21 -04:00
Eli Schwartz
975b9ac168
py3: more work toward universal _future__s 2019-09-10 01:13:21 -04:00
Eli Schwartz
8078bf0931
py3: etree.tostring emits bytes, and must be written using binary mode 2019-09-10 00:55:12 -04:00
Eli Schwartz
d78e4807c3
py3: write unicode bom without using bytes() type
Since the file is opened in utf-8 mode, it needs to be written to using
unicode text, not a b'' string. In python3, '\xef\xbb\xbf' becomes ''
which is definitely not a BOM. Writing the unicode escaped codepoint
allows the codecs.open() encoding to correctly choose the right bytes
for the BOM and insert it as needed.
2019-09-10 00:55:09 -04:00
Eli Schwartz
670c5ebe6a
misc cleanup 2019-09-10 00:55:07 -04:00
Eli Schwartz
1c5ea10a34
list comprehension is faster than the function call overhead of list() 2019-09-10 00:55:03 -04:00
Eli Schwartz
9320e2fe22
where possible, open files using context managers 2019-09-10 00:54:46 -04:00
Eli Schwartz
cb29d11996
sorted always returns a list 2019-09-10 00:54:40 -04:00
Kovid Goyal
b3e57ddfae
... 2019-09-08 20:11:31 +05:30
Kovid Goyal
16b7f100ed
Another fix for last py3 merge 2019-09-08 15:25:39 +05:30
Kovid Goyal
609400ceba
Fix for last py3 merge 2019-09-08 15:17:39 +05:30
Kovid Goyal
ec3238d1cd
Fix remaining set([]) 2019-09-08 14:07:59 +05:30
Eli Schwartz
f04ea0f22e
use raw strings where possible to avoid escaping 2019-09-08 13:46:50 +05:30
Eli Schwartz
3a3ae2590e
more work toward universal __future__s 2019-09-08 13:46:50 +05:30
Eli Schwartz
db9ebeb2d5
do not cast unicode_literals string to str()
It throws off unicode_check and is wasteful anyway...
2019-09-08 13:46:50 +05:30
Eli Schwartz
c05fdfa1c6
use unicode_type instead of introspecting type('') 2019-09-08 13:46:50 +05:30
Eli Schwartz
519cf86786
sorted() is always a list and takes any iterable 2019-09-08 13:46:50 +05:30
Eli Schwartz
00559bef8f
misc cleanup 2019-09-08 13:46:50 +05:30
Kovid Goyal
91066f2010
version 3.47.1 2019-09-08 13:46:50 +05:30
Kovid Goyal
0b03e331c2
Fix #1842183 [calibre.exe uses CPU during idle with Download cover popup window open](https://bugs.launchpad.net/calibre/+bug/1842183) 2019-09-08 13:46:49 +05:30
Charles Haley
8281ab4318 Bug #1842158: fix regression in commit <b8b5c4e> 25 July 2019 08:52:35. 2019-08-31 11:54:12 +01:00
Kovid Goyal
5dad6c60ee
Fix a regression that broke restarting calibre on macOS 2019-08-31 14:04:17 +05:30
Kovid Goyal
20486dd0a3
Remove unused code 2019-08-31 08:21:42 +05:30
Kovid Goyal
1156e8209a
Book details: Fix a regression in the previous release that broke the right click search the internet function
Fixes #1842090 ["Search the internet for..." right-click options fail](https://bugs.launchpad.net/calibre/+bug/1842090)
2019-08-30 20:57:05 +05:30
Kovid Goyal
05834f0b42
PDF Input: Fix < and > in the text not being correctly handled 2019-08-30 08:03:08 +05:30
Kovid Goyal
b0fe64571e
Fix regex for py3 2019-08-30 07:56:18 +05:30
Kovid Goyal
260c330da3
pep8 2019-08-30 06:41:15 +05:30
Kovid Goyal
9796c9f80c
version 3.47.0 2019-08-30 06:35:07 +05:30
Kovid Goyal
85ccc7bdfc
Dont pass on requests to open executables to the OS from ebooks/metadata
This is because some OSes (windows) actually launch these executables
without asking the user
2019-08-29 20:15:00 +05:30
Kovid Goyal
9cf6125f19
misc fixes from last py3 merge 2019-08-29 18:20:49 +05:30
Kovid Goyal
da5b6f898f
... 2019-08-29 13:18:18 +05:30
Eli Schwartz
b4dfa7378f
py3: more work toward universal __future__s 2019-08-28 16:57:11 -04:00
Eli Schwartz
cf24ed3d00
misc cleanup set([]) 2019-08-28 16:57:11 -04:00
Eli Schwartz
d12af03e00
__future__.unicode_literals: don't use r'C:\U' as python2 dislikes it
You get this instead:

SyntaxError: (unicode error) 'rawunicodeescape' codec can't decode bytes in position 2-3: truncated \uXXXX

It does work fine in python3 with native unicode str()
2019-08-28 16:57:11 -04:00
Eli Schwartz
dde0e3cd9d
py3: make sure division is really floored 2019-08-28 16:57:11 -04:00
Eli Schwartz
c9f8ffedb1
micro-optimization: sorted() can take any iterable and returns a list
So there is no need to convert everything to lists before and after.
Also, all_formats is immediately converted to a set, and kept that way,
so it does not need to always be accessed as set(all_formats).
2019-08-28 16:57:11 -04:00
Eli Schwartz
04a37cdf3b
simplify building list of input/output formats
QComboBox.addItems() accepts any iterable, and there's no reason to use
map plus a list comprehension to operate on the same data.

- input_formats will currently be lowercase, output_formats is uppercase.
  Without documenting this inconsistent internal API, don't rely on it.

- While all builtin output plugins should have unicode_literals compatible
  file_type attributes, at least this assumption might break for custom
  plugins, so continue mapping to unicode_type.

Well, at least we can reduce the number of allocated lists.
2019-08-28 16:57:11 -04:00
Kovid Goyal
f8f464efc0
Content server OPDS: Handle form encoded search queries. Fixes #1841464 [calibre server search by URL with multiple words not working](https://bugs.launchpad.net/calibre/+bug/1841464) 2019-08-27 13:42:03 +05:30
Kovid Goyal
60c0290e1c
py3 compat: Fix right clicking in file list not working 2019-08-24 07:32:00 +05:30
Kovid Goyal
6b448bf935
misc fixes for previous py3 merge 2019-08-21 20:57:06 +05:30
Kovid Goyal
9c49e000d1
... 2019-08-21 20:48:18 +05:30
Kovid Goyal
179d5812b1
More set([]) -> set() 2019-08-21 20:44:14 +05:30
Kovid Goyal
967006043b
Dont use > to test for non-empty strings 2019-08-21 19:56:30 +05:30
Kovid Goyal
ae35cdd814
Fix #1033 (py3: When changing a dict, iterate over a copy of its items) 2019-08-21 19:47:11 +05:30
Kovid Goyal
efd5eefa0f
Micro-optimization 2019-08-21 19:45:27 +05:30
Kovid Goyal
7b936ee3ea
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-08-21 14:03:23 +05:30
Kovid Goyal
60d4bbf57d
py3 compat 2019-08-20 21:09:20 +05:30
Eli Schwartz
80beb72b65
py3: more work toward universal __future__s 2019-08-20 07:56:02 -04:00
Eli Schwartz
1cd54361c0
micro-optimize: use sorted(generator) instead of sorted(newlist)
Or just use the initial value.
2019-08-20 07:55:54 -04:00
Eli Schwartz
074e3ff829
py3: use QByteArray().data() to get bytestring instead of str()
b'1' can be mapped into an int, but 'b"1"' cannot. Also rename one
instance -- the QMimeData class requires using the data() method to
retrieve content, and QByteArray uses data() to retrieve the raw bytes,
but once we get to data.data().data() it's a bit ridiculous. So make the
first one be called md, as is used in other mime handling code too.
2019-08-20 07:52:42 -04:00
Eli Schwartz
6ce8e01801
py3: use for loop/hardcode instead of map to process many arguments
Even though we adapted to python3 by using a tuple to ensure the
function is actually applied, this still uses a surprising language
feature then allocate a tuple that is immediately tossed away.
2019-08-20 07:52:42 -04:00
Eli Schwartz
f7aa4cda79
simplify path construction with os.path.join 2019-08-20 07:52:41 -04:00
Eli Schwartz
2fe269a161
Use https urls where possible. 2019-08-20 07:52:41 -04:00
Eli Schwartz
96c71e7ae4
QbyteArray().data() is always bytes and does not need to be cast to it
a dbus.ByteArray() can simply be initialized from the QByteArray
directly.
2019-08-20 07:52:41 -04:00
Eli Schwartz
d0a30b1f84
py3: add string_or_unicode to polyglot
To facilitate universal __future__s, we prefer native_string_type to
str. Since we cannot compare things as instance(f, (str, unicode_type))
and it gets a bit ridiculous to compare:

from polyglot.builtins import native_string_type, unicode_type
isinstance(f, (native_string_type, unicode_type))

allow using isinstance(f, string_or_unicode) instead. This matches the
existing string_or_bytes comparator.
2019-08-20 07:52:41 -04:00
Eli Schwartz
24cd46cc70
misc cleanup set([]) 2019-08-20 07:52:41 -04:00
Kovid Goyal
06755d5eba
Fix an error when adding files from clipboard and file is of unknown type 2019-08-20 16:08:40 +05:30
Kovid Goyal
ced7df0b20
Remove unnecessary list comprehension 2019-08-20 14:16:26 +05:30
Kovid Goyal
1a53ef945a
Dont rely on the shell to restart calibre on macOS 2019-08-20 14:14:10 +05:30
Kovid Goyal
ac9f1fc2d9
change wording slightly 2019-08-14 08:50:06 +05:30
Kovid Goyal
c5aeaa8c8a
Cleanup HTML metadata parsing 2019-08-12 10:10:50 +05:30
Kovid Goyal
44e54bffc4
Merge branch 'html_identifier_import' of https://github.com/cszucko/calibre 2019-08-12 09:00:10 +05:30
Christopher Szucko
b12c75c904 Add unit tests for HTML metadata imports 2019-08-11 10:14:15 -05:00
Christopher Szucko
a81ff78c0a Escape HTML entities in comments 2019-08-11 10:13:25 -05:00
Christopher Szucko
8cbaa3a9e2 Fix importing ratings from HTML metadata
The HTML import was assuming ratings were out of 5 but the internal representation is out of 10
2019-08-11 10:13:25 -05:00
Christopher Szucko
d36a23d795 Refactor HTML metadata parsing
Use an HTMLParser rather than regex, only parse the document once, and add handling for multiple values for authors, tags, and languages
2019-08-11 10:13:25 -05:00
Kovid Goyal
5d1379fbec
Speed up restoring original format by doing a rename rather than a copy and re-add. Fixes #1839733 [Restore pre conversion originals very slow](https://bugs.launchpad.net/calibre/+bug/1839733) 2019-08-11 19:23:50 +05:30
Kovid Goyal
91a0659a9c
EPUB 3: Fix setting metadata in EPUB 3 files with a title not working 2019-08-10 22:15:36 +05:30
Kovid Goyal
b808ee0078
... 2019-08-10 22:12:53 +05:30
Kovid Goyal
93911255f6
Fix #1028 ( Fix podofo convert pystring to PdfString bug ) 2019-08-10 19:34:11 +05:30
Kovid Goyal
e1e3f41065
py3: Another fix 2019-08-10 13:30:51 +05:30
Kovid Goyal
92e5dcb078
py3: more future imports 2019-08-10 13:25:22 +05:30
Kovid Goyal
b71bd6478b
Workaround for weird PyQt return with error set in the conversion dialog
Probably a regression in the latest version of PyQt, but rather than
track it down, easier to just get rid of the .ui file anyway.
2019-08-10 13:05:36 +05:30
Kovid Goyal
38b5c97eeb
Cleanup 2019-08-10 11:47:10 +05:30
Kovid Goyal
6099c69d6f
PML Input: Modernize the generated HTML a bit. Fixes #1839689 [Some PML conversions cause FlightCrew errors](https://bugs.launchpad.net/calibre/+bug/1839689) 2019-08-10 07:15:35 +05:30
Christopher Szucko
9c846f3b51 Support Dublin Core id tags when importing HTML
All of the below formats are supported and would be interpreted as "foo:bar"
<meta name="DC.identifier" scheme="foo" content="bar" />
<meta name="dc:identifier.foo" content="bar/>
<meta name="DCTERMS:identifier" scheme="foo" content="bar" />
<meta name="dcterms.identifier.foo" content="bar" />
2019-08-09 09:38:49 -05:00
Kovid Goyal
c1663d3cc8
HTMLZ Output: Fix svg content from HTML files that contain only SVG being removed. Fixes #1839522 [all images wrapped in <svg> element are lost in htmlz output](https://bugs.launchpad.net/calibre/+bug/1839522) 2019-08-09 15:57:18 +05:30
Kovid Goyal
ab708af9da
Fix #1839494 [Application crashes on changing icons](https://bugs.launchpad.net/calibre/+bug/1839494) 2019-08-08 22:29:03 +05:30
Kovid Goyal
6042ed1dc5
A better fix for python3.7 smtplib breakage 2019-08-08 19:54:59 +05:30
Kovid Goyal
b1623bc558
py3: More fixes 2019-08-08 19:29:23 +05:30
Kovid Goyal
69ea54fa15
py3: more fixes 2019-08-07 22:35:58 +05:30
Kovid Goyal
5e7c625685
Use mbcs encoding when passing filenames to windows 2019-08-07 20:16:23 +05:30
Kovid Goyal
470e6b56fe
See if not using a temp file fixes the weird test failure on travis 2019-08-07 20:07:33 +05:30
Kovid Goyal
b4a8771232
Content server: Fix OPDS feed for category based browsing listing restricted books, even though these books cannot be actually downloaded. Fixes #1839173 [opds feed shows other books with same tags when those books are not allowed.](https://bugs.launchpad.net/calibre/+bug/1839173) 2019-08-07 19:44:21 +05:30
Kovid Goyal
bf8059aeb0
py3 compat 2019-08-07 19:27:42 +05:30
Kovid Goyal
520cf5f39f
macOS: Fix a regression that could cause a crash on exit if any books were deleted while calibre was running. Fixes #1839044 [calibre crash when deleting ebook](https://bugs.launchpad.net/calibre/+bug/1839044) 2019-08-06 11:46:15 +05:30
Kovid Goyal
ec0515d409
Utility function to detect if a PDF is encrypted 2019-08-05 12:11:48 +05:30
Kovid Goyal
6d449818c2
Cleanup conversion of python strings to podofo strings 2019-07-31 18:22:02 +05:30
Kovid Goyal
3255ecbcf1
Simplify podofo str->unicode conversion 2019-07-31 16:28:04 +05:30
Kovid Goyal
91b812b718
Improve PoDoFo test a bit 2019-07-31 16:14:18 +05:30
Kovid Goyal
3c0d352c89
Remove metadata from conversion_options API docs since using it to set metadata is really not a good idea 2019-07-31 15:49:22 +05:30
Kovid Goyal
67298f3c5a
Preserve tag order when reading metadata from MOBI files 2019-07-31 15:44:40 +05:30
Kovid Goyal
4da23549bf
Misc CHM Input fixes
Mostly to deal with chm files with broken filename encoding
2019-07-30 19:31:06 +05:30
Kovid Goyal
05ae6894a5
... 2019-07-29 10:48:54 +05:30
Kovid Goyal
7d4695f37e
Merge branch 'comicbookinfo_language' of https://github.com/PhiBabin/calibre 2019-07-28 05:21:06 +05:30
Philippe Babin
24874293c1 Add missing 'language' field to ComicBookInfo metadata for .CBR files. 2019-07-27 17:45:33 -04:00
Kovid Goyal
d98b2e0b9c
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-07-25 14:16:25 +05:30
Eli Schwartz
d01e441905
py3: read in raw data files as binary
Not specifying the mode means it will be open in text mode which can
munge linebreaks on some platforms and yields the wrong type of string
on py3.
2019-07-25 01:30:54 -04:00
Eli Schwartz
d50a6ddc1b
use context managers to open files 2019-07-25 01:30:54 -04:00
Kovid Goyal
219bcc3864
py3 compat for gaierror retry 2019-07-25 10:46:06 +05:30
Kovid Goyal
4cd004d4d9
More ancient linux compiler support 2019-07-25 09:39:37 +05:30
Kovid Goyal
6eeb85ebe6
Dont use auto in master since it is still built with ancient compilers on linux 2019-07-25 09:10:15 +05:30
Kovid Goyal
b8b5c4e14e
Various fixes for the last py3 merge 2019-07-25 08:52:35 +05:30
Kovid Goyal
c84d019ef7
Get more information from podofo exceptions 2019-07-24 19:51:33 +05:30
Eli Schwartz
3959c4fdca
simplify check for non-zero content in set()
There's no point in casting to list just to compare to [], since
set/list/tuple will evaluate to false when empty. So we can do less work
in fewer characters.
2019-07-23 17:30:45 -04:00
Eli Schwartz
8b75e8c3e3
use floor division instead of math.floor 2019-07-23 17:30:45 -04:00
Eli Schwartz
4b280adcc9
py3: more work towards universal __future__s 2019-07-23 17:30:38 -04:00
Eli Schwartz
2212dfc649
fix imports from the wrong module
when module_a.submodule_a imports module_b, then module_c should not use
"from module_a.submodule_a import module_b"
2019-07-23 17:29:48 -04:00
Eli Schwartz
b9fb80d9b0
use raw strings where possible to avoid escaping issues 2019-07-23 17:29:48 -04:00
Kovid Goyal
80c6de0eb9
LIT Output: Fix regression in 3.41 caused by py3 porting that broke conversion of some files to LIT. Fixes #1837561 [Lit conversion error (Conversion options changed from default)](https://bugs.launchpad.net/calibre/+bug/1837561) 2019-07-23 20:08:12 +05:30
Eli Schwartz
4694efcfc9
Open With: don't raise KeyError if cache exists and there are new dirs
If the cache failed to load, it is initialized as a defaultdict and all
mtimes compare as 0. If the cache did load, however, then an ordinary
dict was used, and if new icon directories appeared on the system since
the cache creation, they would raise a KeyError and Open With would not
load data.

Fix by using a defaultdict in all cases, but initializing with the
contents of the cache if possible.

Discovered when crazy applications added crazy subdirectories in
/usr/share/pixmaps (???) and suddenly calibre failed to do the right
thing, but the same should apply if the system adds a new icon theme.
2019-07-23 01:11:19 -04:00
Kovid Goyal
acc6beaad8
Preferences->Ignored devices: Add a button to reset the list of devices that calibre is allowed to manage 2019-07-20 14:59:54 +05:30
Zbigniew Jędrzejewski-Szmek
9480360bc8 py3: another warning about invalid escape 2019-07-19 16:26:02 +02:00
Zbigniew Jędrzejewski-Szmek
0156785a14 py3: fix invalid escapes
python3.8 warns about strings which try to escape characters which do
not need that. To avoid the warning, the backslash should be escaped.
(Behaviour is functionally the same, so e.g. '\$' is still the same as
r'\$', except for the warning.)
2019-07-19 16:22:21 +02:00
Kovid Goyal
90714baef8
version 3.46.0 2019-07-19 08:49:21 +05:30
Kovid Goyal
54094a9fa7
Fix #1837102 ["Toolbox and Menu" configuration window jumps around on descriptions](https://bugs.launchpad.net/calibre/+bug/1837102) 2019-07-19 08:36:03 +05:30
Kovid Goyal
f7aace3ff8
py3: Another __future__ import 2019-07-18 09:01:37 +05:30
Kovid Goyal
ed06633253
Manage tags dialog: When searching for a tag also search the "Was" column to see if the original tag name matches. Fixes #1836813 [[Enhancement]Tag Manager edits lost with Find](https://bugs.launchpad.net/calibre/+bug/1836813) 2019-07-18 08:57:03 +05:30
Kovid Goyal
449240222b
Fix a regression that broke msgfmt for non-ascii strings in 3.45 on python2 2019-07-17 18:22:36 +05:30
Kovid Goyal
78f1896c69
Windows: Fix calibre-server --manage-users not working correctly
Apparently when running in the windows command prompy raw_input()
returns a trailing carriage return
2019-07-17 14:53:29 +05:30
Kovid Goyal
2a6e7ea82d
MOBI Input: Fix conversion of MOBI files with malformed markup and embeded <guide> tags not working. Fixes #1836548 [Private bug](https://bugs.launchpad.net/calibre/+bug/1836548) 2019-07-15 22:34:20 +05:30
Kovid Goyal
8dc5c82fa0
more py3 porting
Also DRYer the socket addresses creation
2019-07-15 22:10:53 +05:30
Kovid Goyal
8d73d33733
Print out failing IPC address 2019-07-15 21:41:00 +05:30
Kovid Goyal
ae02e93b22
Edit book: Allow the search expression history to remember very short terms and also preserve leading and trailing whitespace
Fixes #1836559 [leading and trailing spaces are trimmed from old  search and replace values in e-book editor](https://bugs.launchpad.net/calibre/+bug/1836559)
2019-07-15 18:14:55 +05:30
Kovid Goyal
e06d268dad
Ignore --auto-reload if --manage-users is specified 2019-07-15 09:56:29 +05:30
Kovid Goyal
c1e6aca8e0
Fix a regression in 3.45.0 caused by py3 porting that broke rasterization of SVG images when converting to formats such as MOBI that do not support SVG. Fixes #1836463 [Private bug](https://bugs.launchpad.net/calibre/+bug/1836463) 2019-07-15 09:21:22 +05:30
Kovid Goyal
bae5d86600
Remove the pipelining test
HTTP 1.1 pipelining is not used by any major HTTP clients
and the internal state hackery required to make the HTTPCOnnection class
do it was fragile on python 3, making the test flakey
2019-07-15 09:05:39 +05:30
Kovid Goyal
cb14986b8d
Fix a regression in 3.45.0 that broke parsing of old-style .py config files
unicode_literals means we now have to mark bytestrings explicitly before
trying to exec the source
2019-07-14 15:24:01 +05:30
Kovid Goyal
312332a847
version 3.45.2 2019-07-12 20:23:35 +05:30
Kovid Goyal
3d3b469572
Get rid of remaining uses of expanduser from calibre.utils.filenames
os.path.expanduser is now monkeypatched at startup on windows.
2019-07-12 20:21:14 +05:30
Kovid Goyal
ad3156a58f
Fix a regression caused by py3 porting that is preventing calibre from starting up on windows machines with non UTF-8 locales. Fixes #1836360 [no RUN ver 3.45.0 or 3.45.1](https://bugs.launchpad.net/calibre/+bug/1836360)
os.path.expanduser is broken in python2. When passed a unicode object it
concatenates it to a bytestring, which will lead to UnicodeDecodeError
if the bytestring happens to not be in the default encoding, ususally
UTF-8
2019-07-12 20:10:40 +05:30
Kovid Goyal
a5bf5344ec
version 3.45.1 2019-07-12 13:49:12 +05:30
Kovid Goyal
15f69b8fa3
Clean up usage of app uids on windows 2019-07-12 13:43:48 +05:30
Kovid Goyal
f09f10ab8b
Fix incorrect conversion of python unicode objects to wchar_t strings in the winutil module
This fixes the various strange windows specific errors or viewer/editor
shutdown in windows
2019-07-12 13:42:33 +05:30
Kovid Goyal
e52d62e71d
Fix ordered_dither not building on older gcc 2019-07-12 06:17:01 +05:30
Kovid Goyal
44fe5e7793
Fix some warnings from sphinx 2019-07-12 05:52:29 +05:30
Kovid Goyal
36ff1b15b8
py3: port a bunch of places where individual byes are accessed from a bytestring 2019-07-12 05:52:07 +05:30
Kovid Goyal
1b0ce5c17f
version 3.45.0 2019-07-12 04:55:42 +05:30
Kovid Goyal
081f4989b7
pep8 2019-07-11 14:10:39 +05:30
Kovid Goyal
b0d18ffb41
Content server: Allow adding or removing formats to a book via the edit metadata page. Fixes #1831304 [Request: Delete Formats on Content Server](https://bugs.launchpad.net/calibre/+bug/1831304) 2019-07-10 10:41:22 +05:30
Kovid Goyal
46afc39739
misc fixes for last py3 merge 2019-07-07 19:03:41 +05:30
Kovid Goyal
ec4d9f109d
Remove unused code 2019-07-07 18:44:28 +05:30
Kovid Goyal
b86e9f0f27
py3: Various MOBI fixes found while reviewing the previous py3 merge 2019-07-07 18:14:13 +05:30
Kovid Goyal
134692af38
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-07-07 10:31:51 +05:30
Kovid Goyal
224d35cb79
EPUB Output: If there are no guide elements do not output an empty guide tag. Makes the asinine epubcheck happy. Fixes #1835560 [epub file fails at epub check](https://bugs.launchpad.net/calibre/+bug/1835560) 2019-07-07 09:11:59 +05:30
Eli Schwartz
cc30b3f408
py3: port oeb rasterize string types
The problem is I'm not sure what manifest's item.data is supposed to be.
The docs for calibre.ebooks.oeb.base.Manifest.Item.data say "it should
be a str type", but that doesn't seem to make sense for a binary file
(at least for python3). More likely it should be a string_or_bytes, and
consumers should check whether the item data is an instance of bytes
(which it should be for image files that aren't representable as decoded
bytes).
2019-07-05 16:51:45 -04:00
Eli Schwartz
73ea548159
py3: name for file-from-fd is unneeded, since py3 won't show it anyway
"Changed in version 3.2: Ignore name attribute."
2019-07-05 16:51:45 -04:00
Eli Schwartz
de17dd27c9
use context managers to open files where possible 2019-07-05 16:51:45 -04:00
Eli Schwartz
31bd771cf9
misc cleanup 2019-07-05 16:51:45 -04:00
Eli Schwartz
2d3d1aca50
py3: more work towards universal __future__s 2019-07-05 16:51:45 -04:00
Eli Schwartz
436f864371
py3: use unicode_literals string type in dynamically updated code 2019-07-05 16:51:45 -04:00
Eli Schwartz
6ca1739d6b
use raw strings where possible to avoid escaping issues 2019-07-05 16:51:45 -04:00
Kovid Goyal
7f978f859c
Use a less intrusive workaround for the Linux kernel bug causing Kindle disconnects 2019-07-04 11:01:50 +05:30
Kovid Goyal
f27b3d7c28
py3: More unicode literals porting 2019-07-03 18:09:15 +05:30
Kovid Goyal
e2b51378ad
... 2019-07-02 16:20:46 +05:30
Kovid Goyal
8088902fa8
Workaround for sortByColumn being partially broken in Qt 5.13.0
Fixes #1834989 [Qt 5.13 seems to break sorting the book list](https://bugs.launchpad.net/calibre/+bug/1834989)
2019-07-02 16:18:16 +05:30
Kovid Goyal
a48220a182
Merge branch 'master' of https://github.com/cbhaley/calibre 2019-07-02 13:22:50 +05:30
Kovid Goyal
fbc5d44435
Fix some incorrect rgb specs being passed to Qt 2019-07-02 11:46:33 +05:30
Kovid Goyal
8eac004f89
py3: Ensure all builting recipes are in utf-8 and have the functions to get recipe code return unicode 2019-07-02 07:30:16 +05:30
Charles Haley
d034b81ce3 Corrected CC URLs. 2019-07-01 22:49:12 +01:00
Kovid Goyal
745a3ef952
py3: Fix bulk convert not working 2019-07-01 11:27:58 +05:30
Charles Haley
04322bdb39 Change URLs for CC 2019-06-30 13:54:08 +01:00
Kovid Goyal
0f4c2c23bd
py3: Fix #1834768 [Unable to customise builtin recipe (Python 3)](https://bugs.launchpad.net/calibre/+bug/1834768) 2019-06-30 13:31:16 +05:30
Kovid Goyal
465ca0573b
News download: Fix the check for empty feeds when generating man ToC page
Fixes #1834684 [TOC missing in news download (Python 3)](https://bugs.launchpad.net/calibre/+bug/1834684)
2019-06-30 07:07:10 +05:30
Kovid Goyal
07f80229e9
ToC Editor: Allow user to control whether duplicate headings are included or not when generating ToC from headings 2019-06-29 13:34:58 +05:30
Kovid Goyal
0d9047cfa3
DOCX Input: When autodetecting the Table of Contents from headings, work even if the headings use numbering. Fixes #1834661 [Private bug](https://bugs.launchpad.net/calibre/+bug/1834661) 2019-06-29 12:16:42 +05:30
Kovid Goyal
ce01b4c571
Dont fail if the workaround for linux brokenness raise an exception 2019-06-29 11:09:52 +05:30
Kovid Goyal
5b1941a833
... 2019-06-29 10:23:34 +05:30
Kovid Goyal
a4de767848
Linux: Workaround for bug in recent Linux kernels that causes the Kindle to eject after calibre connects to it. Fixes #1834641 [Opening Kindle devices in Calibre will cause a disconnect from Linux LTS 4.19.51+ onwards](https://bugs.launchpad.net/calibre/+bug/1834641) 2019-06-29 10:17:50 +05:30
Kovid Goyal
0d1ab933c9
py3: unicode literals porting 2019-06-27 06:19:51 +05:30
Kovid Goyal
099b0cd726
py3: Fix icon theme download not working 2019-06-26 09:00:57 +05:30
Kovid Goyal
73493976e8
Sending email: Fix an error on some windows machines with non-ASCII hostnames 2019-06-26 08:41:36 +05:30
Kovid Goyal
f663fff3ad
py3: Fix extracting raster cover from titlepage
Fixes #1012 (py3: fix 'in' operation)
2019-06-25 13:45:26 +05:30
Kovid Goyal
1b6b234c59
Various cleanups and fixes for the last py3 merge 2019-06-23 10:59:27 +05:30
Kovid Goyal
2c1a1813ce
Use cp1252 instead of utf-8 for ereader metadata as per spec 2019-06-22 05:09:33 +05:30
Kovid Goyal
cc7eaf016a
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-06-22 05:04:22 +05:30
Kovid Goyal
abee667506
py3: fix py_compress_doc 2019-06-22 04:57:50 +05:30
Eli Schwartz
0048c43a9e
py3: use unicode literals for casting strings
Since unicode_type cannot be used in dynamically updated code, cast to
the same type as type('') -- which we know will be unicode because of
unicode_literals.
2019-06-21 17:29:12 -04:00
Eli Schwartz
7c89277408
fix documentation typos 2019-06-21 17:29:12 -04:00
Eli Schwartz
5c7fa28d38
misc cleanup 2019-06-21 17:29:12 -04:00
Eli Schwartz
7993757099
py3: fix bytes handling by using bytes as needed 2019-06-21 17:29:12 -04:00
Eli Schwartz
2da800aa6e
use context managers for open() 2019-06-21 17:29:12 -04:00
Eli Schwartz
67f8b23baa
use more raw strings to prevent escaping 2019-06-21 17:29:12 -04:00
Eli Schwartz
1f794c4cd2
py3: more work on universal __future__s 2019-06-21 17:29:12 -04:00
Eli Schwartz
824f909627
do not shadow builtins as variable names 2019-06-21 15:27:29 -04:00
Eli Schwartz
c18eb0cb8c
standardize on one is_py3 representation 2019-06-21 15:27:29 -04:00
Kovid Goyal
abd9e6bcf7
py3: Fix None comparison when sorting the device books list 2019-06-21 17:52:35 +05:30
Kovid Goyal
2b639d6ea0
Use QTextBrowser instead of WebKit to display downloaded metadata
We are getting rid of WebKit
2019-06-20 15:10:47 +05:30
Eli Schwartz
0a5dc07da1
fix qt 5.13 compatibility
In 01e1df90a7,
screenAdded was deprecated, and as of qt 5.13 it is fully removed. Adapt
to this change by using the new API in QWindowSystemInterface.
2019-06-19 11:04:06 -04:00
Kovid Goyal
2635e23ed5
calibre now builds fully on windows
The duktape tests are crashing have to figure out why at some point
2019-06-19 17:48:41 +05:30
Kovid Goyal
46bc83be18
Remove webkit from build test since we are transitioning off it 2019-06-19 17:03:57 +05:30
Kovid Goyal
424de7f8fe
Advanced search dialog: Remember the last focused field in the search by ttiel/authors tab 2019-06-18 11:38:49 +05:30
Kovid Goyal
01326d69cf
py3: Use os.cpu_count() 2019-06-16 18:47:36 +05:30
Kovid Goyal
d782fa0ae4
py3: More unicode porting 2019-06-14 18:39:58 +05:30
Kovid Goyal
89284513a7
EPUB Output: When generating EPUB 3 preserve the old style meta tag to identify the cover as Google Play Books does not recognize EPUB 3 cover markup. See #1832660 (add cover to epub) 2019-06-14 11:03:21 +05:30
Kovid Goyal
ca4fd1f381
Conversion: Performance improvement for books that have many HTML files that all include the same CSS stylesheets
Now the conversion engine will flatten the same sequence of sheets
only once.

Merge branch 'master' of https://github.com/princesse-framboise/calibre
2019-06-14 10:10:05 +05:30
Kovid Goyal
b2f299de88
Create catalog: Fix handling of the tilde character in BiBTeX catalogs
Fixes #1832726 [Wrong ASCII conversion when writing bibtex file](https://bugs.launchpad.net/calibre/+bug/1832726)
2019-06-14 09:47:10 +05:30
Kovid Goyal
5a4ca12432
Fix #1832780 [Error when changing libraries](https://bugs.launchpad.net/calibre/+bug/1832780) 2019-06-14 08:40:20 +05:30
Kovid Goyal
4d9c050e03
py3: more unicode porting 2019-06-13 11:11:52 +05:30
Kovid Goyal
a38758ca68
Even better error message when loading .mo file fails 2019-06-13 10:38:52 +05:30
Kovid Goyal
a3bf706825
Fix msgfmt.py broken during unicode porting
Also merge in changes from upstream version
2019-06-13 10:36:53 +05:30
Kovid Goyal
adbd85bf33
News downloads: Fix incorrect font sizes for some text in the index pages. Fixes #1832628 [Calibre viewer freezes when opening news download converted to LRF](https://bugs.launchpad.net/calibre/+bug/1832628)
Conversion now uses a dedicated attribute data-calibre-rescale for
dynamic font sizing rather than relying on class names which can get
mangled by CSS flattening
2019-06-13 09:06:43 +05:30
Kovid Goyal
7394a508e0
Fix an infinite loop in the LRF renderer 2019-06-13 06:03:06 +05:30
Kovid Goyal
57a3121f6c
pep8 2019-06-12 23:18:24 +05:30
Kovid Goyal
7192861301
Merge branch 'master' of https://github.com/davidfor/calibre 2019-06-12 19:42:22 +05:30
David
af5af3d029 Better layout of new cover options in KoboTouch driver. 2019-06-12 22:21:21 +10:00
Kovid Goyal
ea74df97ec
Get rid of the last use of win32com 2019-06-12 07:07:28 +05:30
Kovid Goyal
9844394258
Windows: Dont use a deprecated API for moving to trash 2019-06-12 05:42:03 +05:30
Kovid Goyal
f66a709dfe
Cleanup 2019-06-11 19:52:25 +05:30
Kovid Goyal
59264be1f0
Use RAII in winutil 2019-06-11 18:49:36 +05:30
Kovid Goyal
48e26a754d
Couple more places to get rid of win32com 2019-06-11 18:20:56 +05:30
Kovid Goyal
49f2082ad3
... 2019-06-11 17:11:02 +05:30
Kovid Goyal
1a1db4d1f8
Ensure no trailing NULLs in result of file_association() 2019-06-11 16:35:29 +05:30
Kovid Goyal
000bb4c89e
Better error message when failing to load translations 2019-06-11 16:32:35 +05:30
Kovid Goyal
21fbec2820
Dont use win32com for notifying the OS of file association changes 2019-06-11 16:17:34 +05:30
Kovid Goyal
529033ff78
Dont use win32com for expanduser 2019-06-11 16:04:47 +05:30
Kovid Goyal
57572d977a
Dont use win32com to get file associations 2019-06-11 15:57:12 +05:30
Kovid Goyal
152e823c41
Kobo driver: Add options to more precisely control the generation of cover images, to reduce size and enhance quality
Merge branch 'master' of https://github.com/NiLuJe/calibre
2019-06-11 15:14:26 +05:30
Kovid Goyal
0f3b2e2329
Dont use win32com for adding to recent docs 2019-06-11 14:50:05 +05:30
NiLuJe
09ffb629a1 Tweak checkbox layout to be more logical 2019-06-10 18:35:19 +02:00
Kovid Goyal
c243fa2358
Cleanup getenv 2019-06-10 19:06:36 +05:30
Kovid Goyal
057b873933
Dont depend on win32api in polyglot 2019-06-10 18:21:38 +05:30
Kovid Goyal
f1199035f6
py3: Port winreg imports 2019-06-10 15:41:30 +05:30
Kovid Goyal
549b822f9c
py3: More unicode fixes 2019-06-10 15:39:55 +05:30
Kovid Goyal
ef42213ceb
py3: More unicode porting 2019-06-09 11:22:02 +05:30
Kovid Goyal
9316d8d673
Comic Input: Fix incorrect processing of comics with pages that have the same file names in different folders when using the "No process" option. Fixes #1831487 [Private bug](https://bugs.launchpad.net/calibre/+bug/1831487) 2019-06-09 11:21:04 +05:30
Kovid Goyal
4abffead71
macOS: Fix loading of CoreText font database on newer Qt in the headless plugin 2019-06-08 10:31:18 +05:30
Kovid Goyal
d39087a356
py3: more unicode porting 2019-06-07 16:49:14 +05:30
NiLuJe
474d76e645 Fix that comment ;). 2019-06-07 04:12:34 +02:00
Kovid Goyal
35169e2743
String changes 2019-06-06 09:13:18 +05:30
Kovid Goyal
e2190da060
... 2019-06-06 08:56:43 +05:30
Kovid Goyal
109a052102
Merge branch 'master' of https://github.com/lifanxi/calibre 2019-06-05 21:30:55 +05:30
Li Fanxi
d1a6113a8a Support subtitle in Douban metadata plugin 2019-06-05 23:25:08 +08:00
Kovid Goyal
3f903cbdd1
CHM Input: Fix a regression that broke processing of some CHM files
Fixes #1831511 [Can't open chm file](https://bugs.launchpad.net/calibre/+bug/1831511)

Bug was introduced due to adding of unicode_literals.
Also fix CHM input on python3
2019-06-05 09:08:17 +05:30
Kovid Goyal
fc972b6157
Better error message when loading ICU data fails 2019-06-04 16:22:07 +05:30
Kovid Goyal
cb524b7cc1
Port the macOS headless plugin to work with Qt 5.12 2019-06-04 16:03:08 +05:30
Kovid Goyal
13eb6795e6
Edit book: When auto-closing tags on typing </ fix occasionally incorrect tag being closed in large files because syntax highlighting has not competed 2019-06-03 20:49:34 +05:30
NiLuJe
43d53f8dbe Simplify that
I was *probably* trying to mimic a C ternary operator ;p
2019-06-03 15:59:38 +02:00
NiLuJe
a79f9b9b54 Kill letterboxing in KOBO
It makes no sense without an "honor AR" option ;).
2019-06-03 15:51:31 +02:00
NiLuJe
5883667ebe Forgot the KOBO letterbox checkbox in the settings
Which made me realize that there's no "keep AR" function there,
so this doesn't make sense \o/.
2019-06-03 15:46:28 +02:00
NiLuJe
cff3c4ad68 Tweak the PNG help message a bit
Given that Nickel has handled PNGs as books as early as 2.9.0, if not
earlier, I can't see this actually being an issue anywhere in practice,
but, better be safe than sorry ;).
2019-06-03 14:29:17 +02:00
NiLuJe
62e2925e4b Address some more review comments
No need to handle old settings migration for those new settings in KOBOTOUCH
2019-06-03 14:26:19 +02:00
NiLuJe
d0cf06a5e5 Continue addressing review comments
Less destructive to the legacy KOBO driver (only honor letterboxing,
and only do it to full-screen covers like KOBOTOUCH).

Also, unbreak legacy settings by not re-ordering them.
2019-06-03 14:22:20 +02:00
NiLuJe
7c02419eed Start addressing review comments
Explicit cast to float is superfluous, thanks to __future__.division
2019-06-03 14:09:49 +02:00
Kovid Goyal
cff789f12c
Modernize the code used to interact with macOS
Recycle bin and notifications code. The old recycle bin code was
deprecated. Notifications support has been moved in-process.
2019-06-03 13:37:51 +05:30
NiLuJe
04c7a8aa4a Make the GCC 4.8 bot happy ;). 2019-06-02 20:44:00 +02:00
NiLuJe
aaa2fa936a Use a lower compression level for the first PNG pass
optipng will fix it anyway
2019-06-02 18:29:50 +02:00
NiLuJe
cc8a3b4450 Refactor that to avoid code duplication 2019-06-02 18:29:50 +02:00
NiLuJe
8e7b519b8d Inline the grayscaling pass in ordered_dither
Saving one QImage pixel-loop dance in the process...
2019-06-02 18:29:50 +02:00
NiLuJe
4326bb9d7f Unify indentation style 2019-06-02 18:29:50 +02:00
NiLuJe
c465d7f4e7 Tweak copyright header a bit, now that it's done 2019-06-02 18:29:50 +02:00
NiLuJe
227b5f97bd Stick the commented out Indexed8 code in there, for posterity's sake (in
preparation of a squash)
2019-06-02 18:29:50 +02:00
NiLuJe
d2772a2916 Eh, okay-ish optipng compromise 2019-06-02 18:29:50 +02:00
NiLuJe
bdb767c9b7 Forget about optipng
Granted, it helps, but it's prohibitively expensive.
2019-06-02 18:29:50 +02:00
NiLuJe
d6efb350bf Experiment w/ optipng... 2019-06-02 18:29:50 +02:00
NiLuJe
b5554bd0da Revert "See what happens if we switch to Indexed8..."
This reverts commit a602b8b872c5b4c4c0772b82bb43e2384d92fd63.

What happens is we end up with an alpha channel in our PNGs, which
screws with our first entry in the palette: black, which is no longer at
full opacity :/.
2019-06-02 18:29:50 +02:00
NiLuJe
38ad6a5b2d See what happens if we switch to Indexed8... 2019-06-02 18:29:50 +02:00
NiLuJe
96a98bbc29 Fix syntax error 2019-06-02 18:29:50 +02:00
NiLuJe
4f754d518a I should probably have tried to build that first xD 2019-06-02 18:29:50 +02:00
NiLuJe
81b303aa18 Tweak help messages a bit 2019-06-02 18:29:50 +02:00
NiLuJe
5e7907b0aa Ups, actually Grayscale8, as I'm not writing a palette...
Let's see what QImageWriter makes of that before checking if I really
need to bother with Indexed8...
2019-06-02 18:29:50 +02:00
NiLuJe
90ab7573d9 Return an Indexed8 QImage
Ensures it'll be encoded as such when saved as a PNG
2019-06-02 18:29:50 +02:00
NiLuJe
7e6347486b Port ImageMagick's OrderedDither algorithm, and use that instead of
ImageOps' quantize to dither images to the eInk palette.

It works much better for our intended purpose, and it's pretty fast.
2019-06-02 18:29:49 +02:00
NiLuJe
cf1b855ea0 Rejig thumbnail dimension calculations
Instead of bounding the the requested values, we *expand* around those,
like downloaded thumbnails for store-bought KePubs.

Also handle wonky landscape source ARs properly while we're there.
2019-06-02 18:29:49 +02:00
NiLuJe
1f0bc97a15 Update thumbnail dimensions, based on @geek1011's findings
c.f., https://github.com/shermp/Kobo-UNCaGED/issues/16#issuecomment-494229994
2019-06-02 18:29:49 +02:00
NiLuJe
832ab64c63 Greater control over Kobo covers processing.
* Optional dithering down to the exact eInk color palette.
  Note that, on some devices, FW >= 4.11 will do a much better job of it
  than us.
  That's true on the H2O, for instance, but not on the Forma, where it
  only does so on thumbnails, not on the sleep cover...
  When it does, grayscaling is done in sRGB space, and not linear light,
  like we do, but that's a much more minor issue, and one where no-one
  is actually wrong ;).
  Depends on B&W covers to avoid nonsensical results.
* Optional letterboxing of full-screen covers to avoid extra Nickel
  processing.
  Depends on Keep AR to avoid nonsensical results.
* Optional storage as PNG to avoid JPG wrecking the dithering
  Depends on B&W covers to avoid storing stupidly large color PNGs.
* Fix rounding errors when calculating thumbnail sizes:
  AR should be a float, and we want to honor the *height* expected by
  Nickel when there's potential for rounding mistakes (which is pretty
  much always for thumbnails, given that the perfect AR should be 0.75).
  Meaning we'll want to round properly before truncating ;).
* Fix thumbnail sizes on the Forma. Apparently, quite a few bits of the
  FW behave as if the screen was Aura One sized...
  Try to do it right on our end instead of following suit ;).
  Unfortunately, full-screen cover processing is slightly broken on
  nickel's side right now:
  it appears to be treating them as Aura One sized, which incurs an
  ugly and unavoidable scaling pass, one way or the other...

c.f., http://www.mobileread.com/forums/showpost.php?p=3025725&postcount=225
  and the few pages around it.
2019-06-02 18:29:49 +02:00
Kovid Goyal
b5230d9bd8
py3: more unicode porting 2019-06-02 14:33:27 +05:30
David
469e8cfb55 Correct handling of ContentType for newer Kobo firmware.
The py3 changes highlighted an error in how the ContentType was being
handled. This should have been fixed ages ago.

Also fixed an issue with the Language column and old firmware/database
versions.
2019-06-02 13:01:12 +10:00
Kovid Goyal
7d81b1dddf
Fix for ContentType not being defined error for extension-less non kepub files on a Kobo 2019-06-01 21:34:10 +05:30
Kovid Goyal
e049c10729
py3: Port a few remaining chr() calls 2019-06-01 15:21:01 +05:30
Kovid Goyal
c83cdcf086
py3: More unicode porting 2019-06-01 15:16:57 +05:30
Kovid Goyal
151e736538
py3: more unicode porting 2019-06-01 14:47:05 +05:30
Kovid Goyal
20b065fb49
py3: Various fixes for the last py3 merge 2019-06-01 12:37:04 +05:30
Kovid Goyal
d9fcdbe1a2
Merge branch 'py3' of https://github.com/eli-schwartz/calibre 2019-06-01 08:34:49 +05:30
Kovid Goyal
a0a3f89820
Content server: Book details page: Do not display empty rows for undefined dates 2019-06-01 08:32:57 +05:30
Kovid Goyal
949ac56a5c
Get books: Update Google books plugin for markup changes 2019-06-01 08:07:58 +05:30