UI/FindFileDialog.py

changeset 6
52e8c820d0dd
parent 0
de9c2efb9d02
child 7
c679fb30c8f3
--- a/UI/FindFileDialog.py	Mon Dec 28 17:05:28 2009 +0000
+++ b/UI/FindFileDialog.py	Mon Dec 28 18:31:37 2009 +0000
@@ -321,7 +321,18 @@
         flags = re.UNICODE | re.LOCALE
         if not cs:
             flags |= re.IGNORECASE
-        search = re.compile(txt, flags)
+        try:
+            search = re.compile(txt, flags)
+        except re.error, why:
+            QMessageBox.critical(None,
+                self.trUtf8("Invalid search expression"),
+                self.trUtf8("""<p>The search expression is not valid.</p>"""
+                            """<p>Error: {0}</p>""").format(unicode(why)))
+            self.stopButton.setEnabled(False)
+            self.findButton.setEnabled(True)
+            self.findButton.setDefault(True)
+            return
+
         
         # reset the findtextCombo
         if ct in self.searchHistory:

eric ide

mercurial