Make tab attributes more consistent

This commit is contained in:
Florian Bruhin 2018-09-28 19:48:24 +02:00
parent 2f121d77df
commit 2630f779cd
3 changed files with 10 additions and 10 deletions

View File

@ -258,8 +258,9 @@ class AbstractSearch(QObject):
finished = pyqtSignal(bool)
cleared = pyqtSignal()
def __init__(self, parent=None):
def __init__(self, tab, parent=None):
super().__init__(parent)
self._tab = tab
self._widget = None
self.text = None
self.search_displayed = False

View File

@ -163,10 +163,9 @@ class WebEngineSearch(browsertab.AbstractSearch):
"""
def __init__(self, tab, parent=None):
super().__init__(parent)
super().__init__(tab, parent)
self._flags = QWebEnginePage.FindFlags(0)
self._pending_searches = 0
self._tab = tab
def _find(self, text, flags, callback, caller):
"""Call findText on the widget."""
@ -1026,8 +1025,8 @@ class WebEngineTab(browsertab.AbstractTab):
private=private, parent=parent)
widget = webview.WebEngineView(tabdata=self.data, win_id=win_id,
private=private)
self.history = WebEngineHistory(self)
self.scroller = WebEngineScroller(self, parent=self)
self.history = WebEngineHistory(tab=self)
self.scroller = WebEngineScroller(tab=self, parent=self)
self.caret = WebEngineCaret(mode_manager=mode_manager,
tab=self, parent=self)
self.zoom = WebEngineZoom(tab=self, parent=self)

View File

@ -84,8 +84,8 @@ class WebKitSearch(browsertab.AbstractSearch):
"""QtWebKit implementations related to searching on the page."""
def __init__(self, parent=None):
super().__init__(parent)
def __init__(self, tab, parent=None):
super().__init__(tab, parent)
self._flags = QWebPage.FindFlags(0)
def _call_cb(self, callback, found, text, flags, caller):
@ -662,12 +662,12 @@ class WebKitTab(browsertab.AbstractTab):
private=private, tab=self)
if private:
self._make_private(widget)
self.history = WebKitHistory(self)
self.scroller = WebKitScroller(self, parent=self)
self.history = WebKitHistory(tab=self)
self.scroller = WebKitScroller(tab=self, parent=self)
self.caret = WebKitCaret(mode_manager=mode_manager,
tab=self, parent=self)
self.zoom = WebKitZoom(tab=self, parent=self)
self.search = WebKitSearch(parent=self)
self.search = WebKitSearch(tab=self, parent=self)
self.printing = WebKitPrinting(tab=self)
self.elements = WebKitElements(tab=self)
self.action = WebKitAction(tab=self)