eric4.UI.FindFileDialog

Module implementing a dialog to search for text in files.

Classes

FindFileDialog Class implementing a dialog to search for text in files.
FindFileTreeWidgetItem Class implementing a custom QTreeWidgetItem to customize sorting.

Functions

None


FindFileDialog

Class implementing a dialog to search for text in files.

The occurences found are displayed in a QTreeWidget showing the filename, the linenumber and the found text. The file will be opened upon a double click onto the respective entry of the list.

Signals

designerFile(string)
emitted to open a Qt-Designer file
sourceFile(string, int, string, (int, int)
) emitted to open a source file at a line

Derived from

QDialog, Ui_FindFileDialog

Methods

FindFileDialog Constructor
__createItem Private method to create an entry in the file list.
__doSearch Private slot to handle the find button being pressed.
__enableFindButton Private slot called to enable the find button.
__getFileList Private method to get a list of files to search.
__stopSearch Private slot to handle the stop button being pressed.
on_buttonBox_clicked Private slot called by a button of the button box clicked.
on_dirButton_clicked Private slot to handle the selection of the project radio button.
on_dirEdit_textChanged Private slot to handle the textChanged signal of the directory edit.
on_dirSelectButton_clicked Private slot to display a directory selection dialog.
on_findList_itemDoubleClicked Private slot to handle the double click on a file item.
on_findtextCombo_editTextChanged Private slot to handle the editTextChanged signal of the find text combo.
on_projectButton_clicked Private slot to handle the selection of the project radio button.
setSearchDirectory Public slot to set the name of the directory to search in.
show Overwritten method to enable/disable the project button.

FindFileDialog (Constructor)

FindFileDialog(project, parent=None)

Constructor

project
reference to the project object
parent
parent widget of this dialog (QWidget)

FindFileDialog.__createItem

__createItem(file, line, text, start, end)

Private method to create an entry in the file list.

file
filename of file (string or QString)
line
line number (integer)
text
text found (string or QString)
start
start position of match (integer)
end
end position of match (integer)

FindFileDialog.__doSearch

__doSearch()

Private slot to handle the find button being pressed.

FindFileDialog.__enableFindButton

__enableFindButton()

Private slot called to enable the find button.

FindFileDialog.__getFileList

__getFileList(path)

Private method to get a list of files to search.

path
the root directory to search in (string)
Returns:
list of files to be processed (list of strings)

FindFileDialog.__stopSearch

__stopSearch()

Private slot to handle the stop button being pressed.

FindFileDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button
button that was clicked (QAbstractButton)

FindFileDialog.on_dirButton_clicked

on_dirButton_clicked()

Private slot to handle the selection of the project radio button.

FindFileDialog.on_dirEdit_textChanged

on_dirEdit_textChanged(text)

Private slot to handle the textChanged signal of the directory edit.

text
(ignored)

FindFileDialog.on_dirSelectButton_clicked

on_dirSelectButton_clicked()

Private slot to display a directory selection dialog.

FindFileDialog.on_findList_itemDoubleClicked

on_findList_itemDoubleClicked(itm, column)

Private slot to handle the double click on a file item.

It emits the signal sourceFile or designerFile depending on the file extension.

itm
the double clicked tree item (FindFileTreeWidgetItem)
column
column that was double clicked (integer) (ignored)

FindFileDialog.on_findtextCombo_editTextChanged

on_findtextCombo_editTextChanged(text)

Private slot to handle the editTextChanged signal of the find text combo.

text
(ignored)

FindFileDialog.on_projectButton_clicked

on_projectButton_clicked()

Private slot to handle the selection of the project radio button.

FindFileDialog.setSearchDirectory

setSearchDirectory(searchDir)

Public slot to set the name of the directory to search in.

searchDir
name of the directory to search in (string or QString)

FindFileDialog.show

show(txt = "")

Overwritten method to enable/disable the project button.

txt
text to be shown in the searchtext combo (string or QString)
Up


FindFileTreeWidgetItem

Class implementing a custom QTreeWidgetItem to customize sorting.

Derived from

QTreeWidgetItem

Methods

__lt__ Public method to check, if the item is less than the other one.

FindFileTreeWidgetItem.__lt__

__lt__(other)

Public method to check, if the item is less than the other one.

other
reference to item to compare against (ProfileTreeWidgetItem)
Returns:
true, if this item is less than other (boolean)
Up