From b2626bace330aba990a35e5caf15a33193a43652 Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 16 Jan 2011 08:55:26 -0500 Subject: [PATCH 1/2] Fix search_and_replace option names. --- src/calibre/gui2/convert/search_and_replace.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/convert/search_and_replace.py b/src/calibre/gui2/convert/search_and_replace.py index fff75a29ba..34c6cdf1e9 100644 --- a/src/calibre/gui2/convert/search_and_replace.py +++ b/src/calibre/gui2/convert/search_and_replace.py @@ -36,7 +36,7 @@ class SearchAndReplaceWidget(Widget, Ui_Form): self.opt_sr3_search.break_cycles() def pre_commit_check(self): - for x in ('sr1-search', 'sr2-search', 'sr3-search'): + for x in ('sr1_search', 'sr2_search', 'sr3_search'): x = getattr(self, 'opt_'+x) try: pat = unicode(x.regex) From 68587e8679b70463c51bd66bdd78339ea9838a8a Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 16 Jan 2011 09:16:05 -0500 Subject: [PATCH 2/2] Fix GUI dialog errors preventing them from returning properly. --- src/calibre/gui2/convert/heuristics.py | 7 +++++-- src/calibre/gui2/convert/search_and_replace.py | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/convert/heuristics.py b/src/calibre/gui2/convert/heuristics.py index 525d5ba2f1..4735782f52 100644 --- a/src/calibre/gui2/convert/heuristics.py +++ b/src/calibre/gui2/convert/heuristics.py @@ -34,8 +34,11 @@ class HeuristicsWidget(Widget, Ui_Form): def break_cycles(self): Widget.break_cycles(self) - self.opt_enable_heuristics.stateChanged.disconnect() - self.opt_unwrap_lines.stateChanged.disconnect() + try: + self.opt_enable_heuristics.stateChanged.disconnect() + self.opt_unwrap_lines.stateChanged.disconnect() + except: + pass def set_value_handler(self, g, val): if val is None and g is self.opt_html_unwrap_factor: diff --git a/src/calibre/gui2/convert/search_and_replace.py b/src/calibre/gui2/convert/search_and_replace.py index 34c6cdf1e9..af944a74d1 100644 --- a/src/calibre/gui2/convert/search_and_replace.py +++ b/src/calibre/gui2/convert/search_and_replace.py @@ -45,5 +45,4 @@ class SearchAndReplaceWidget(Widget, Ui_Form): error_dialog(self, _('Invalid regular expression'), _('Invalid regular expression: %s')%err).exec_() return False - - + return True