Helpviewer/SearchWidget.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2999
28c75409a78f
child 3145
a9de05d4a22f
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
46 46
47 self.findHistory = [] 47 self.findHistory = []
48 self.havefound = False 48 self.havefound = False
49 self.__findBackwards = False 49 self.__findBackwards = False
50 50
51 self.findtextCombo.lineEdit().returnPressed.connect(self.__findByReturnPressed) 51 self.findtextCombo.lineEdit().returnPressed.connect(
52 self.findtextCombo.lineEdit().textEdited.connect(self.__searchTextEdited) 52 self.__findByReturnPressed)
53 self.findtextCombo.lineEdit().textEdited.connect(
54 self.__searchTextEdited)
53 55
54 if hasattr(QWebPage, "HighlightAllOccurrences"): 56 if hasattr(QWebPage, "HighlightAllOccurrences"):
55 self.highlightAllCheckBox.setChecked(True) 57 self.highlightAllCheckBox.setChecked(True)
56 else: 58 else:
57 self.highlightAllCheckBox.setVisible(False) 59 self.highlightAllCheckBox.setVisible(False)
67 69
68 def __searchTextEdited(self, txt): 70 def __searchTextEdited(self, txt):
69 """ 71 """
70 Private slot to perform an incremental search. 72 Private slot to perform an incremental search.
71 73
72 @param txt current text of the search combos line edit (string) (unused) 74 @param txt current text of the search combos line edit (string)
75 (unused)
73 """ 76 """
74 self.on_highlightAllCheckBox_toggled(True) 77 self.on_highlightAllCheckBox_toggled(True)
75 self.__findNextPrev() 78 self.__findNextPrev()
76 79
77 def __findNextPrev(self): 80 def __findNextPrev(self):
94 self.__setFindtextComboBackground(True) 97 self.__setFindtextComboBackground(True)
95 98
96 @pyqtSlot(bool) 99 @pyqtSlot(bool)
97 def on_highlightAllCheckBox_toggled(self, checked): 100 def on_highlightAllCheckBox_toggled(self, checked):
98 """ 101 """
99 Private slot to toggle the highlight of all occurences. 102 Private slot to toggle the highlight of all occurrences.
103
104 @param checked flag indicating the check box toggle state (boolean)
100 """ 105 """
101 cbr = self.__mainWindow.currentBrowser() 106 cbr = self.__mainWindow.currentBrowser()
102 if cbr is None: 107 if cbr is None:
103 return 108 return
104 cbr.findNextPrev( 109 cbr.findNextPrev(
165 170
166 self.on_findPrevButton_clicked() 171 self.on_findPrevButton_clicked()
167 172
168 def __findByReturnPressed(self): 173 def __findByReturnPressed(self):
169 """ 174 """
170 Private slot to handle the returnPressed signal of the findtext combobox. 175 Private slot to handle the returnPressed signal of the findtext
176 combobox.
171 """ 177 """
172 if self.__findBackwards: 178 if self.__findBackwards:
173 self.on_findPrevButton_clicked() 179 self.on_findPrevButton_clicked()
174 else: 180 else:
175 self.on_findNextButton_clicked() 181 self.on_findNextButton_clicked()
215 event.accept() 221 event.accept()
216 self.close() 222 self.close()
217 223
218 def __setFindtextComboBackground(self, error): 224 def __setFindtextComboBackground(self, error):
219 """ 225 """
220 Private slot to change the findtext combo background to indicate errors. 226 Private slot to change the findtext combo background to indicate
227 errors.
221 228
222 @param error flag indicating an error condition (boolean) 229 @param error flag indicating an error condition (boolean)
223 """ 230 """
224 le = self.findtextCombo.lineEdit() 231 le = self.findtextCombo.lineEdit()
225 p = le.palette() 232 p = le.palette()

eric ide

mercurial