diff --git a/src/calibre/ebooks/conversion/plumber.py b/src/calibre/ebooks/conversion/plumber.py index 948f38e8b1..70b6ca657e 100644 --- a/src/calibre/ebooks/conversion/plumber.py +++ b/src/calibre/ebooks/conversion/plumber.py @@ -532,7 +532,7 @@ OptionRecommendation(name='format_scene_breaks', 'horizontal rules.')), OptionRecommendation(name='replace_scene_breaks', - recommended_value=None, level=OptionRecommendation.LOW, + recommended_value='', level=OptionRecommendation.LOW, help=_('Replace scene breaks with the specified text. By default, the ' 'text from the input document is used.')), diff --git a/src/calibre/ebooks/txt/txtml.py b/src/calibre/ebooks/txt/txtml.py index bf33e5540a..660fd9d38a 100644 --- a/src/calibre/ebooks/txt/txtml.py +++ b/src/calibre/ebooks/txt/txtml.py @@ -218,7 +218,7 @@ class TXTMLizer(object): if tag in SPACE_TAGS: text.append(u' ') - + # Scene breaks. if tag == 'hr': text.append('\n\n* * *\n\n') diff --git a/src/calibre/gui2/convert/heuristics.py b/src/calibre/gui2/convert/heuristics.py index 8ca4cab455..77fadf059c 100644 --- a/src/calibre/gui2/convert/heuristics.py +++ b/src/calibre/gui2/convert/heuristics.py @@ -27,7 +27,8 @@ class HeuristicsWidget(Widget, Ui_Form): 'dehyphenate', 'renumber_headings'] ) self.db, self.book_id = db, book_id - self.rssb_defaults = ['', '
', '* * *'] + self.rssb_defaults = [u'', u'
', u'* * *', u'• • •', u'✦ ✦ ✦', + u'✮ ✮ ✮', u'☆ ☆ ☆', u'❂ ❂ ❂', u'✣ ✣ ✣', u'❖ ❖ ❖', u'☼ ☼ ☼', u'✠ ✠ ✠'] self.initialize_options(get_option, get_help, db, book_id) self.load_histories() @@ -39,16 +40,18 @@ class HeuristicsWidget(Widget, Ui_Form): def restore_defaults(self, get_option): Widget.restore_defaults(self, get_option) - + + self.save_histories() rssb_hist = gprefs['replace_scene_breaks_history'] for x in self.rssb_defaults: if x in rssb_hist: del rssb_hist[rssb_hist.index(x)] gprefs['replace_scene_breaks_history'] = self.rssb_defaults + gprefs['replace_scene_breaks_history'] + self.load_histories() def commit_options(self, save_defaults=False): self.save_histories() - + return Widget.commit_options(self, save_defaults) def break_cycles(self): @@ -69,6 +72,9 @@ class HeuristicsWidget(Widget, Ui_Form): return True def load_histories(self): + self.opt_replace_scene_breaks.clear() + self.opt_replace_scene_breaks.lineEdit().setText('') + val = unicode(self.opt_replace_scene_breaks.currentText()) rssb_hist = gprefs.get('replace_scene_breaks_history', self.rssb_defaults) if val in rssb_hist: