mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow device drivers to provide a custom message to display to the user for virtual books
This commit is contained in:
parent
58a1365752
commit
ac60235775
@ -79,7 +79,10 @@ class DevicePlugin(Plugin):
|
|||||||
#: Set of extensions that are "virtual books" on the device
|
#: Set of extensions that are "virtual books" on the device
|
||||||
#: and therefore cannot be viewed/saved/added to library.
|
#: and therefore cannot be viewed/saved/added to library.
|
||||||
#: For example: ``frozenset(['kobo'])``
|
#: For example: ``frozenset(['kobo'])``
|
||||||
VIRTUAL_BOOK_EXTENSIONS = frozenset([])
|
VIRTUAL_BOOK_EXTENSIONS = frozenset()
|
||||||
|
|
||||||
|
#: Message to display to user for virtual book extensions.
|
||||||
|
VIRTUAL_BOOK_EXTENSION_MESSAGE = None
|
||||||
|
|
||||||
#: Whether to nuke comments in the copy of the book sent to the device. If
|
#: Whether to nuke comments in the copy of the book sent to the device. If
|
||||||
#: not None this should be short string that the comments will be replaced
|
#: not None this should be short string that the comments will be replaced
|
||||||
|
@ -507,10 +507,10 @@ class AddAction(InterfaceAction):
|
|||||||
remove = set([p for p in paths if ext(p) in ve])
|
remove = set([p for p in paths if ext(p) in ve])
|
||||||
if remove:
|
if remove:
|
||||||
paths = [p for p in paths if p not in remove]
|
paths = [p for p in paths if p not in remove]
|
||||||
info_dialog(self.gui, _('Not Implemented'),
|
vmsg = getattr(self.gui.device_manager.device, 'VIRTUAL_BOOK_EXTENSION_MESSAGE', None) or _(
|
||||||
_('The following books are virtual and cannot be added'
|
'The following books are virtual and cannot be added'
|
||||||
' to the calibre library:'), '\n'.join(remove),
|
' to the calibre library:')
|
||||||
show=True)
|
info_dialog(self.gui, _('Not Implemented'), vmsg, '\n'.join(remove), show=True)
|
||||||
if not paths:
|
if not paths:
|
||||||
return
|
return
|
||||||
if not paths or len(paths) == 0:
|
if not paths or len(paths) == 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user