mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3458 (error when first click on 'Preference')
This commit is contained in:
parent
7f09917600
commit
3cb06a21c2
@ -238,7 +238,7 @@ class HTMLPreProcessor(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
end_rules = []
|
end_rules = []
|
||||||
if getattr(self.extra_opts, 'unwrap_factor', None):
|
if getattr(self.extra_opts, 'unwrap_factor', 0.0) > 0.01:
|
||||||
length = line_length(html, getattr(self.extra_opts, 'unwrap_factor'))
|
length = line_length(html, getattr(self.extra_opts, 'unwrap_factor'))
|
||||||
if length:
|
if length:
|
||||||
end_rules.append(
|
end_rules.append(
|
||||||
|
@ -262,9 +262,10 @@ class HTMLInput(InputFormatPlugin):
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
OptionRecommendation(name='unwrap_factor', recommended_value=None,
|
OptionRecommendation(name='unwrap_factor', recommended_value=0.0,
|
||||||
help=_('Average line length for line breaking if the HTML is from a '
|
help=_('Average line length for line breaking if the HTML is from a '
|
||||||
'previous partial conversion of a PDF file. Default is %default.')),
|
'previous partial conversion of a PDF file. Default is %default '
|
||||||
|
'which disables this.')),
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ __copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
|||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from calibre.gui2.convert.pdf_input_ui import Ui_Form
|
from calibre.gui2.convert.pdf_input_ui import Ui_Form
|
||||||
from calibre.gui2.convert import Widget
|
from calibre.gui2.convert import Widget, QDoubleSpinBox
|
||||||
|
|
||||||
class PluginWidget(Widget, Ui_Form):
|
class PluginWidget(Widget, Ui_Form):
|
||||||
|
|
||||||
@ -17,3 +17,8 @@ class PluginWidget(Widget, Ui_Form):
|
|||||||
['no_images', 'unwrap_factor'])
|
['no_images', 'unwrap_factor'])
|
||||||
self.db, self.book_id = db, book_id
|
self.db, self.book_id = db, book_id
|
||||||
self.initialize_options(get_option, get_help, db, book_id)
|
self.initialize_options(get_option, get_help, db, book_id)
|
||||||
|
|
||||||
|
def set_value_handler(self, g, val):
|
||||||
|
if val is None and isinstance(g, QDoubleSpinBox):
|
||||||
|
g.setValue(0.0)
|
||||||
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user