Remove ViewerPlugin since the new viewer currently has no plugin architecture

This commit is contained in:
Kovid Goyal 2019-09-13 20:14:18 +05:30
parent e8f5b51b6c
commit 737bfa44cb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 1 additions and 80 deletions

View File

@ -183,13 +183,3 @@ Preferences plugins
.. autoclass:: calibre.gui2.preferences.ConfigWidgetBase
:members:
:member-order: bysource
Viewer plugins
----------------
.. autoclass:: calibre.customize.ViewerPlugin
:show-inheritance:
:members:
:member-order: bysource

View File

@ -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): # {{{
type = _('Edit book tool')

View File

@ -10,7 +10,7 @@ from calibre.customize import (CatalogPlugin, FileTypePlugin, PluginNotFound,
MetadataReaderPlugin, MetadataWriterPlugin,
InterfaceActionBase as InterfaceAction,
PreferencesPlugin, platform, InvalidPlugin,
StoreBase as Store, ViewerPlugin, EditBookToolPlugin,
StoreBase as Store, EditBookToolPlugin,
LibraryClosedPlugin)
from calibre.customize.conversion import InputFormatPlugin, OutputFormatPlugin
from calibre.customize.zipplugin import loader
@ -644,15 +644,6 @@ def patch_metadata_plugins(possibly_updated_plugins):
_initialized_plugins[i] = pup
# }}}
# Viewer plugins {{{
def all_viewer_plugins():
for plugin in _initialized_plugins:
if isinstance(plugin, ViewerPlugin):
yield plugin
# }}}
# Editor plugins {{{