UI/FindFileDialog.py

changeset 1112
8a7d1b9d18db
parent 945
8cd4d08fa9f6
child 1131
7781e396c903
equal deleted inserted replaced
1109:9552b5e16a07 1112:8a7d1b9d18db
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>""")\

eric ide

mercurial