12 from PyQt4.QtWebKit import QWebPage |
12 from PyQt4.QtWebKit import QWebPage |
13 |
13 |
14 from .Ui_SearchWidget import Ui_SearchWidget |
14 from .Ui_SearchWidget import Ui_SearchWidget |
15 |
15 |
16 import UI.PixmapCache |
16 import UI.PixmapCache |
|
17 |
17 |
18 |
18 class SearchWidget(QWidget, Ui_SearchWidget): |
19 class SearchWidget(QWidget, Ui_SearchWidget): |
19 """ |
20 """ |
20 Class implementing the search bar for the web browser. |
21 Class implementing the search bar for the web browser. |
21 """ |
22 """ |
22 def __init__(self, mainWindow, parent = None): |
23 def __init__(self, mainWindow, parent=None): |
23 """ |
24 """ |
24 Constructor |
25 Constructor |
25 |
26 |
26 @param mainWindow reference to the main window (QMainWindow) |
27 @param mainWindow reference to the main window (QMainWindow) |
27 @param parent parent widget of this dialog (QWidget) |
28 @param parent parent widget of this dialog (QWidget) |
80 |
81 |
81 if not self.findtextCombo.currentText(): |
82 if not self.findtextCombo.currentText(): |
82 return |
83 return |
83 |
84 |
84 if not self.__mainWindow.currentBrowser().findNextPrev( |
85 if not self.__mainWindow.currentBrowser().findNextPrev( |
85 self.findtextCombo.currentText(), |
86 self.findtextCombo.currentText(), |
86 self.caseCheckBox.isChecked(), |
87 self.caseCheckBox.isChecked(), |
87 self.__findBackwards, |
88 self.__findBackwards, |
88 self.wrapCheckBox.isChecked(), |
89 self.wrapCheckBox.isChecked(), |
89 False): |
90 False): |
90 self.infoLabel.setText(self.trUtf8("Expression was not found.")) |
91 self.infoLabel.setText(self.trUtf8("Expression was not found.")) |
91 self.__setFindtextComboBackground(True) |
92 self.__setFindtextComboBackground(True) |
92 |
93 |
93 @pyqtSlot(bool) |
94 @pyqtSlot(bool) |
100 return |
101 return |
101 cbr.findNextPrev( |
102 cbr.findNextPrev( |
102 "", False, False, False, True) |
103 "", False, False, False, True) |
103 if self.highlightAllCheckBox.isChecked(): |
104 if self.highlightAllCheckBox.isChecked(): |
104 cbr.findNextPrev( |
105 cbr.findNextPrev( |
105 self.findtextCombo.currentText(), |
106 self.findtextCombo.currentText(), |
106 self.caseCheckBox.isChecked(), |
107 self.caseCheckBox.isChecked(), |
107 False, False, True) |
108 False, False, True) |
108 |
109 |
109 @pyqtSlot() |
110 @pyqtSlot() |
110 def on_findNextButton_clicked(self): |
111 def on_findNextButton_clicked(self): |