eric7/UI/FindFileWidget.py

branch
eric7
changeset 8846
4196ec4c37a5
parent 8809
29471a3867ac
child 8859
64252c7bfb87
equal deleted inserted replaced
8845:3d3c1b812fe4 8846:4196ec4c37a5
73 """ 73 """
74 super().__init__(parent) 74 super().__init__(parent)
75 self.setupUi(self) 75 self.setupUi(self)
76 76
77 self.layout().setContentsMargins(0, 3, 0, 0) 77 self.layout().setContentsMargins(0, 3, 0, 0)
78
79 self.caseToolButton.setIcon(UI.PixmapCache.getIcon("caseSensitive"))
80 self.wordToolButton.setIcon(UI.PixmapCache.getIcon("wholeWord"))
81 self.regexpToolButton.setIcon(UI.PixmapCache.getIcon("regexp"))
78 82
79 self.dirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) 83 self.dirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
80 self.dirPicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop) 84 self.dirPicker.setInsertPolicy(QComboBox.InsertPolicy.InsertAtTop)
81 self.dirPicker.setSizeAdjustPolicy( 85 self.dirPicker.setSizeAdjustPolicy(
82 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon) 86 QComboBox.SizeAdjustPolicy.AdjustToMinimumContentsLengthWithIcon)
520 QApplication.processEvents() 524 QApplication.processEvents()
521 QApplication.processEvents() 525 QApplication.processEvents()
522 self.findProgress.setMaximum(len(files)) 526 self.findProgress.setMaximum(len(files))
523 527
524 # retrieve the values 528 # retrieve the values
525 reg = self.regexpCheckBox.isChecked() 529 reg = self.regexpToolButton.isChecked()
526 wo = self.wordCheckBox.isChecked() 530 wo = self.wordToolButton.isChecked()
527 cs = self.caseCheckBox.isChecked() 531 cs = self.caseToolButton.isChecked()
528 ct = self.findtextCombo.currentText() 532 ct = self.findtextCombo.currentText()
529 txt = ct if reg else re.escape(ct) 533 txt = ct if reg else re.escape(ct)
530 if wo: 534 if wo:
531 txt = "\\b{0}\\b".format(txt) 535 txt = "\\b{0}\\b".format(txt)
532 flags = re.UNICODE 536 flags = re.UNICODE
593 self.__lastFileItem = None 597 self.__lastFileItem = None
594 found = False 598 found = False
595 if self.__cancelSearch: 599 if self.__cancelSearch:
596 break 600 break
597 601
598 self.findProgressLabel.setPath(file) 602 # self.findProgressLabel.setPath(file)
599 603
600 fn = ( 604 fn = (
601 os.path.join(self.project.getProjectPath(), file) 605 os.path.join(self.project.getProjectPath(), file)
602 if self.projectButton.isChecked() else 606 if self.projectButton.isChecked() else
603 file 607 file
670 Private slot to clear the current search results. 674 Private slot to clear the current search results.
671 """ 675 """
672 self.findList.clear() 676 self.findList.clear()
673 self.replaceButton.setEnabled(False) 677 self.replaceButton.setEnabled(False)
674 self.clearButton.setEnabled(False) 678 self.clearButton.setEnabled(False)
679 self.findProgressLabel.setPath("")
680 self.findProgress.setValue(0)
675 681
676 @pyqtSlot(QTreeWidgetItem, int) 682 @pyqtSlot(QTreeWidgetItem, int)
677 def on_findList_itemDoubleClicked(self, itm, column): 683 def on_findList_itemDoubleClicked(self, itm, column):
678 """ 684 """
679 Private slot to handle the double click on a file item. 685 Private slot to handle the double click on a file item.
782 if itm.checkState(0) in [Qt.CheckState.PartiallyChecked, 788 if itm.checkState(0) in [Qt.CheckState.PartiallyChecked,
783 Qt.CheckState.Checked]: 789 Qt.CheckState.Checked]:
784 file = itm.text(0) 790 file = itm.text(0)
785 origHash = itm.data(0, self.md5Role) 791 origHash = itm.data(0, self.md5Role)
786 792
787 self.findProgressLabel.setPath(file) 793 # self.findProgressLabel.setPath(file)
788 794
789 if self.projectButton.isChecked(): 795 if self.projectButton.isChecked():
790 fn = os.path.join(self.project.getProjectPath(), file) 796 fn = os.path.join(self.project.getProjectPath(), file)
791 else: 797 else:
792 fn = file 798 fn = file

eric ide

mercurial