mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Remove ViewerPlugin since the new viewer currently has no plugin architecture
This commit is contained in:
parent
e8f5b51b6c
commit
737bfa44cb
@ -183,13 +183,3 @@ Preferences plugins
|
|||||||
.. autoclass:: calibre.gui2.preferences.ConfigWidgetBase
|
.. autoclass:: calibre.gui2.preferences.ConfigWidgetBase
|
||||||
:members:
|
:members:
|
||||||
:member-order: bysource
|
:member-order: bysource
|
||||||
|
|
||||||
Viewer plugins
|
|
||||||
----------------
|
|
||||||
|
|
||||||
.. autoclass:: calibre.customize.ViewerPlugin
|
|
||||||
:show-inheritance:
|
|
||||||
:members:
|
|
||||||
:member-order: bysource
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -727,66 +727,6 @@ class StoreBase(Plugin): # {{{
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class ViewerPlugin(Plugin): # {{{
|
|
||||||
|
|
||||||
type = _('Viewer')
|
|
||||||
|
|
||||||
'''
|
|
||||||
These plugins are used to add functionality to the calibre E-book viewer.
|
|
||||||
'''
|
|
||||||
|
|
||||||
def load_fonts(self):
|
|
||||||
'''
|
|
||||||
This method is called once at viewer startup. It should load any fonts
|
|
||||||
it wants to make available. For example::
|
|
||||||
|
|
||||||
def load_fonts():
|
|
||||||
from PyQt5.Qt import QFontDatabase
|
|
||||||
font_data = get_resources(['myfont1.ttf', 'myfont2.ttf'])
|
|
||||||
for raw in font_data.values():
|
|
||||||
QFontDatabase.addApplicationFontFromData(raw)
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
def load_javascript(self, evaljs):
|
|
||||||
'''
|
|
||||||
This method is called every time a new HTML document is loaded in the
|
|
||||||
viewer. Use it to load javascript libraries into the viewer. For
|
|
||||||
example::
|
|
||||||
|
|
||||||
def load_javascript(self, evaljs):
|
|
||||||
js = get_resources('myjavascript.js')
|
|
||||||
evaljs(js)
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
def run_javascript(self, evaljs):
|
|
||||||
'''
|
|
||||||
This method is called every time a document has finished loading. Use
|
|
||||||
it in the same way as load_javascript().
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
def customize_ui(self, ui):
|
|
||||||
'''
|
|
||||||
This method is called once when the viewer is created. Use it to make
|
|
||||||
any customizations you want to the viewer's user interface. For
|
|
||||||
example, you can modify the toolbars via ui.tool_bar and ui.tool_bar2.
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
def customize_context_menu(self, menu, event, hit_test_result):
|
|
||||||
'''
|
|
||||||
This method is called every time the context (right-click) menu is
|
|
||||||
shown. You can use it to customize the context menu. ``event`` is the
|
|
||||||
context menu event and hit_test_result is the QWebHitTestResult for this
|
|
||||||
event in the currently loaded document.
|
|
||||||
'''
|
|
||||||
pass
|
|
||||||
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
|
|
||||||
class EditBookToolPlugin(Plugin): # {{{
|
class EditBookToolPlugin(Plugin): # {{{
|
||||||
|
|
||||||
type = _('Edit book tool')
|
type = _('Edit book tool')
|
||||||
|
@ -10,7 +10,7 @@ from calibre.customize import (CatalogPlugin, FileTypePlugin, PluginNotFound,
|
|||||||
MetadataReaderPlugin, MetadataWriterPlugin,
|
MetadataReaderPlugin, MetadataWriterPlugin,
|
||||||
InterfaceActionBase as InterfaceAction,
|
InterfaceActionBase as InterfaceAction,
|
||||||
PreferencesPlugin, platform, InvalidPlugin,
|
PreferencesPlugin, platform, InvalidPlugin,
|
||||||
StoreBase as Store, ViewerPlugin, EditBookToolPlugin,
|
StoreBase as Store, EditBookToolPlugin,
|
||||||
LibraryClosedPlugin)
|
LibraryClosedPlugin)
|
||||||
from calibre.customize.conversion import InputFormatPlugin, OutputFormatPlugin
|
from calibre.customize.conversion import InputFormatPlugin, OutputFormatPlugin
|
||||||
from calibre.customize.zipplugin import loader
|
from calibre.customize.zipplugin import loader
|
||||||
@ -644,15 +644,6 @@ def patch_metadata_plugins(possibly_updated_plugins):
|
|||||||
_initialized_plugins[i] = pup
|
_initialized_plugins[i] = pup
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
# Viewer plugins {{{
|
|
||||||
|
|
||||||
|
|
||||||
def all_viewer_plugins():
|
|
||||||
for plugin in _initialized_plugins:
|
|
||||||
if isinstance(plugin, ViewerPlugin):
|
|
||||||
yield plugin
|
|
||||||
# }}}
|
|
||||||
|
|
||||||
# Editor plugins {{{
|
# Editor plugins {{{
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user