UI/FindFileNameDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3190
a9a94491c4fd
child 3591
2f2a4a76dd22
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
18 18
19 from E5Gui.E5Completers import E5DirCompleter 19 from E5Gui.E5Completers import E5DirCompleter
20 from E5Gui import E5FileDialog 20 from E5Gui import E5FileDialog
21 21
22 from .Ui_FindFileNameDialog import Ui_FindFileNameDialog 22 from .Ui_FindFileNameDialog import Ui_FindFileNameDialog
23
23 from Utilities import direntries 24 from Utilities import direntries
24 import Utilities 25 import Utilities
26 import UI.PixmapCache
25 27
26 28
27 class FindFileNameDialog(QWidget, Ui_FindFileNameDialog): 29 class FindFileNameDialog(QWidget, Ui_FindFileNameDialog):
28 """ 30 """
29 Class implementing a dialog to search for files. 31 Class implementing a dialog to search for files.
46 @param parent parent widget of this dialog (QWidget) 48 @param parent parent widget of this dialog (QWidget)
47 """ 49 """
48 super(FindFileNameDialog, self).__init__(parent) 50 super(FindFileNameDialog, self).__init__(parent)
49 self.setupUi(self) 51 self.setupUi(self)
50 52
53 self.searchDirButton.setIcon(UI.PixmapCache.getIcon("open.png"))
54
51 self.searchDirCompleter = E5DirCompleter(self.searchDirEdit) 55 self.searchDirCompleter = E5DirCompleter(self.searchDirEdit)
52 56
53 self.fileList.headerItem().setText(self.fileList.columnCount(), "") 57 self.fileList.headerItem().setText(self.fileList.columnCount(), "")
54 58
55 self.stopButton = self.buttonBox.addButton( 59 self.stopButton = self.buttonBox.addButton(
56 self.trUtf8("Stop"), QDialogButtonBox.ActionRole) 60 self.tr("Stop"), QDialogButtonBox.ActionRole)
57 self.stopButton.setToolTip(self.trUtf8("Press to stop the search")) 61 self.stopButton.setToolTip(self.tr("Press to stop the search"))
58 self.stopButton.setEnabled(False) 62 self.stopButton.setEnabled(False)
59 self.buttonBox.button(QDialogButtonBox.Open).setToolTip( 63 self.buttonBox.button(QDialogButtonBox.Open).setToolTip(
60 self.trUtf8("Opens the selected file")) 64 self.tr("Opens the selected file"))
61 self.buttonBox.button(QDialogButtonBox.Open).setEnabled(False) 65 self.buttonBox.button(QDialogButtonBox.Open).setEnabled(False)
62 66
63 self.project = project 67 self.project = project
64 self.extsepLabel.setText(os.extsep) 68 self.extsepLabel.setText(os.extsep)
65 69
198 Private slot to handle the clicked signal of the search directory 202 Private slot to handle the clicked signal of the search directory
199 selection button. 203 selection button.
200 """ 204 """
201 searchDir = E5FileDialog.getExistingDirectory( 205 searchDir = E5FileDialog.getExistingDirectory(
202 None, 206 None,
203 self.trUtf8("Select search directory"), 207 self.tr("Select search directory"),
204 self.searchDirEdit.text(), 208 self.searchDirEdit.text(),
205 E5FileDialog.Options(E5FileDialog.ShowDirsOnly)) 209 E5FileDialog.Options(E5FileDialog.ShowDirsOnly))
206 210
207 if searchDir: 211 if searchDir:
208 self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir)) 212 self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir))

eric ide

mercurial