eric6/UI/FindFileDialog.py

changeset 8235
78e6d29eb773
parent 8220
006ee31b4835
child 8260
2161475d9639
equal deleted inserted replaced
8234:fcb6b4b96274 8235:78e6d29eb773
436 # retrieve the values 436 # retrieve the values
437 reg = self.regexpCheckBox.isChecked() 437 reg = self.regexpCheckBox.isChecked()
438 wo = self.wordCheckBox.isChecked() 438 wo = self.wordCheckBox.isChecked()
439 cs = self.caseCheckBox.isChecked() 439 cs = self.caseCheckBox.isChecked()
440 ct = self.findtextCombo.currentText() 440 ct = self.findtextCombo.currentText()
441 if reg: 441 txt = ct if reg else re.escape(ct)
442 txt = ct
443 else:
444 txt = re.escape(ct)
445 if wo: 442 if wo:
446 txt = "\\b{0}\\b".format(txt) 443 txt = "\\b{0}\\b".format(txt)
447 flags = re.UNICODE 444 flags = re.UNICODE
448 if not cs: 445 if not cs:
449 flags |= re.IGNORECASE 446 flags |= re.IGNORECASE
608 file = itm.text(0) 605 file = itm.text(0)
609 line = 1 606 line = 1
610 start = 0 607 start = 0
611 end = 0 608 end = 0
612 609
613 if self.project: 610 fn = os.path.join(self.project.ppath, file) if self.project else file
614 fn = os.path.join(self.project.ppath, file)
615 else:
616 fn = file
617 if fn.endswith('.ui'): 611 if fn.endswith('.ui'):
618 self.designerFile.emit(fn) 612 self.designerFile.emit(fn)
619 else: 613 else:
620 self.sourceFile.emit(fn, line, "", start, end) 614 self.sourceFile.emit(fn, line, "", start, end)
621 615
775 def __copyToClipboard(self): 769 def __copyToClipboard(self):
776 """ 770 """
777 Private method to copy the path of an entry to the clipboard. 771 Private method to copy the path of an entry to the clipboard.
778 """ 772 """
779 itm = self.findList.selectedItems()[0] 773 itm = self.findList.selectedItems()[0]
780 if itm.parent(): 774 fn = itm.parent().text(0) if itm.parent() else itm.text(0)
781 fn = itm.parent().text(0)
782 else:
783 fn = itm.text(0)
784 775
785 cb = QApplication.clipboard() 776 cb = QApplication.clipboard()
786 cb.setText(fn) 777 cb.setText(fn)

eric ide

mercurial