mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Workaround the broken hackery that the DOC Input plugin does, that causes it to break the Input Options Preferences in calibre 2.0
This commit is contained in:
parent
24ae2e1d75
commit
2c4ffa1700
@ -1048,6 +1048,11 @@ class InputOptions(PreferencesPlugin):
|
||||
config_widget = 'calibre.gui2.preferences.conversion:InputOptions'
|
||||
description = _('Set conversion options specific to each input format')
|
||||
|
||||
def create_widget(self, *args, **kwargs):
|
||||
# The DOC Input plugin tries to override this
|
||||
self.config_widget = 'calibre.gui2.preferences.conversion:InputOptions'
|
||||
return PreferencesPlugin.create_widget(self, *args, **kwargs)
|
||||
|
||||
class CommonOptions(PreferencesPlugin):
|
||||
name = 'Common Options'
|
||||
icon = I('convert.png')
|
||||
|
@ -27,13 +27,14 @@ def config_widget_for_input_plugin(plugin):
|
||||
'calibre.gui2.convert.'+name).PluginWidget
|
||||
except ImportError:
|
||||
# If this is not a builtin plugin, we have to import it differently
|
||||
try:
|
||||
ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget
|
||||
except (ImportError, AttributeError, TypeError):
|
||||
pass
|
||||
else:
|
||||
if issubclass(ans, Widget):
|
||||
return ans
|
||||
if plugin.__module__ and plugin.__module__.startswith('calibre_plugins.'):
|
||||
try:
|
||||
ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget
|
||||
except (ImportError, AttributeError, TypeError):
|
||||
pass
|
||||
else:
|
||||
if issubclass(ans, Widget):
|
||||
return ans
|
||||
|
||||
def bulk_defaults_for_input_format(fmt):
|
||||
plugin = plugin_for_input_format(fmt)
|
||||
|
Loading…
x
Reference in New Issue
Block a user