8 """ |
8 """ |
9 |
9 |
10 import os |
10 import os |
11 import re |
11 import re |
12 |
12 |
13 from PyQt4.QtCore import * |
13 from PyQt4.QtCore import pyqtSignal, Qt, pyqtSlot |
14 from PyQt4.QtGui import * |
14 from PyQt4.QtGui import QCursor, QDialog, QApplication, QMenu, QDialogButtonBox, \ |
|
15 QTreeWidgetItem |
15 |
16 |
16 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
17 from E5Gui import E5MessageBox, E5FileDialog |
18 from E5Gui import E5MessageBox, E5FileDialog |
18 |
19 |
19 from .Ui_FindFileDialog import Ui_FindFileDialog |
20 from .Ui_FindFileDialog import Ui_FindFileDialog |
588 # read the file and split it into textlines |
589 # read the file and split it into textlines |
589 try: |
590 try: |
590 text, encoding, hash = \ |
591 text, encoding, hash = \ |
591 Utilities.readEncodedFileWithHash(fn) |
592 Utilities.readEncodedFileWithHash(fn) |
592 lines = text.splitlines(True) |
593 lines = text.splitlines(True) |
593 except (UnicodeError, IOError): |
594 except (UnicodeError, IOError) as err: |
594 E5MessageBox.critical(self, |
595 E5MessageBox.critical(self, |
595 self.trUtf8("Replace in Files"), |
596 self.trUtf8("Replace in Files"), |
596 self.trUtf8( |
597 self.trUtf8( |
597 """<p>Could not read the file <b>{0}</b>.""" |
598 """<p>Could not read the file <b>{0}</b>.""" |
598 """ Skipping it.</p><p>Reason: {1}</p>""")\ |
599 """ Skipping it.</p><p>Reason: {1}</p>""")\ |