Skip to content

Commit 876bbbc

Browse files
committed
add DJVU sub-menu item to book context and document menu configuration
1 parent 2a91985 commit 876bbbc

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Files can be converted through a GUI menu and optionally as FileType hook for au
66
![GUI menu](/screenshot_menu.png?raw=true)
77
![Job log](/screenshot_job.png?raw=true)
88

9-
DjVU files are best for rendering large image-based documents (100+ pg. black-and-white-scaned archive-books) on markup-ebook readers with sub-300MiB memory and sub-2GiB storage capacities.
10-
The community-made Kindle readers kindlepdfviewer & koreader support DjVu files and can deliver noticable speed increase over PDF originals of such documents.
11-
Some massive 1000+ page books can only be read unsplit on these devices in DjVu format.
9+
DjVU format is ideal for reading large black & white scanned Google Books on E-Readers with >300MB RAM and >2GB flash.
10+
Big 100+ page books scanned into PDF format usually slow these devices' built-in software to a halt.
11+
12+
To read DJVU files on the Kindle, I suggest koreader/koreader.
1213

1314
PDF is still better for vector/markup based "ebooks" so this plugin will not try to convert documents it detects having less than 1 raster image per page.
1415

@@ -26,6 +27,8 @@ Installation
2627
```calibre-debug -R djvumaker install_deps```
2728
3. (Re)start Calibre and start converting your PDF books!
2829

30+
4. [Optional] go to Preferences -> Interface::Toolbars so you can place the DJVU menu where you see fit.
31+
2932
Under the Hood
3033
---
3134
There are a few implementations of DjVU tools in the wild, but the fastest and most robust free one is the DjVuLibre suite and its Ghostscript plugin "GsDjvu".

gui.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ConvertToDJVUAction(InterfaceAction):
1717
action_spec = (_('Convert to DJVU'), 'mimetypes/djvu.png', _('engage the djvumaker plugin on this book'), None)
1818
# (label, icon_path, tooltip, keyboard shortcut)
1919

20-
action_type = 'current'
20+
action_type = 'global'
2121

2222
#don't auto-add the button to any menus' top-level
2323
dont_add_to = frozenset(['toolbar', 'toolbar-device', 'context-menu',
@@ -27,12 +27,15 @@ class ConvertToDJVUAction(InterfaceAction):
2727
def genesis(self):
2828
self.qaction.triggered.connect(self.convert_book)
2929

30-
def gui_layout_complete(self):
31-
#append my top-level DJVU action to the built-in conversion menus
32-
#https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/actions/convert.py
30+
#def gui_layout_complete(self):
31+
def initialization_complete(self):
32+
# append my top-level DJVU action to the built-in conversion menus
33+
# https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/actions/convert.py
34+
# https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/__init__.py#L26
3335
cb = self.gui.iactions['Convert Books']
3436
cm = partial(cb.create_menu_action, cb.qaction.menu())
3537
cm('convert-djvu-cvtm', _('Convert to DJVU'), icon=self.qaction.icon(), triggered=self.convert_book)
38+
cb.qaction.setMenu(cb.qaction.menu())
3639

3740
def location_selected(self, loc):
3841
# Currently values for loc are: ``library, main, card and cardb``.

0 commit comments

Comments
 (0)