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() |