mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -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'
|
config_widget = 'calibre.gui2.preferences.conversion:InputOptions'
|
||||||
description = _('Set conversion options specific to each input format')
|
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):
|
class CommonOptions(PreferencesPlugin):
|
||||||
name = 'Common Options'
|
name = 'Common Options'
|
||||||
icon = I('convert.png')
|
icon = I('convert.png')
|
||||||
|
@ -27,13 +27,14 @@ def config_widget_for_input_plugin(plugin):
|
|||||||
'calibre.gui2.convert.'+name).PluginWidget
|
'calibre.gui2.convert.'+name).PluginWidget
|
||||||
except ImportError:
|
except ImportError:
|
||||||
# If this is not a builtin plugin, we have to import it differently
|
# If this is not a builtin plugin, we have to import it differently
|
||||||
try:
|
if plugin.__module__ and plugin.__module__.startswith('calibre_plugins.'):
|
||||||
ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget
|
try:
|
||||||
except (ImportError, AttributeError, TypeError):
|
ans = importlib.import_module(plugin.__module__+'.'+name).PluginWidget
|
||||||
pass
|
except (ImportError, AttributeError, TypeError):
|
||||||
else:
|
pass
|
||||||
if issubclass(ans, Widget):
|
else:
|
||||||
return ans
|
if issubclass(ans, Widget):
|
||||||
|
return ans
|
||||||
|
|
||||||
def bulk_defaults_for_input_format(fmt):
|
def bulk_defaults_for_input_format(fmt):
|
||||||
plugin = plugin_for_input_format(fmt)
|
plugin = plugin_for_input_format(fmt)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user