eric7/UI/FindFileWidget.py

branch
external_find
changeset 9037
907540e4f741
parent 8943
23f9c7b9e18e
child 9038
90bcfdd63d47
equal deleted inserted replaced
9036:58dabebbe022 9037:907540e4f741
246 246
247 if self.__replaceMode != replaceMode: 247 if self.__replaceMode != replaceMode:
248 self.__toggleReplaceMode() 248 self.__toggleReplaceMode()
249 249
250 if searchDir: 250 if searchDir:
251 self.setSearchDirectory(searchDir) 251 self.__setSearchDirectory(searchDir)
252 if openFiles: 252 if openFiles:
253 self.setOpenFiles() 253 self.__setOpenFiles()
254 254
255 @pyqtSlot() 255 @pyqtSlot()
256 def __toggleReplaceMode(self): 256 def __toggleReplaceMode(self):
257 """ 257 """
258 Private slot to toggle the dialog mode. 258 Private slot to toggle the dialog mode.
760 for d in dirs[:]: 760 for d in dirs[:]:
761 if d .startswith("."): 761 if d .startswith("."):
762 dirs.remove(d) 762 dirs.remove(d)
763 return files 763 return files
764 764
765 def setSearchDirectory(self, searchDir): 765 def __setSearchDirectory(self, searchDir):
766 """ 766 """
767 Public slot to set the name of the directory to search in. 767 Private slot to set the name of the directory to search in.
768 768
769 @param searchDir name of the directory to search in 769 @param searchDir name of the directory to search in
770 @type str 770 @type str
771 """ 771 """
772 self.dirButton.setChecked(True) 772 self.dirButton.setChecked(True)
773 self.dirPicker.setEditText(Utilities.toNativeSeparators(searchDir)) 773 self.dirPicker.setEditText(Utilities.toNativeSeparators(searchDir))
774 774
775 @pyqtSlot() 775 @pyqtSlot()
776 def setOpenFiles(self): 776 def __setOpenFiles(self):
777 """ 777 """
778 Public slot to set the mode to search in open files. 778 Private slot to set the mode to search in open files.
779 """ 779 """
780 self.openFilesButton.setChecked(True) 780 self.openFilesButton.setChecked(True)
781 781
782 @pyqtSlot() 782 @pyqtSlot()
783 def on_replaceButton_clicked(self): 783 def on_replaceButton_clicked(self):
895 itm = self.findList.selectedItems()[0] 895 itm = self.findList.selectedItems()[0]
896 fn = itm.parent().text(0) if itm.parent() else itm.text(0) 896 fn = itm.parent().text(0) if itm.parent() else itm.text(0)
897 897
898 cb = QApplication.clipboard() 898 cb = QApplication.clipboard()
899 cb.setText(fn) 899 cb.setText(fn)
900
901 # TODO: add separate dialog variant

eric ide

mercurial