From 68587e8679b70463c51bd66bdd78339ea9838a8a Mon Sep 17 00:00:00 2001 From: John Schember Date: Sun, 16 Jan 2011 09:16:05 -0500 Subject: [PATCH] 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