Ejemplo n.º 1
0
    def __init__(self, *, win_id: int, private: bool,
                 parent: QWidget = None) -> None:
        self.is_private = private
        self.win_id = win_id
        self.tab_id = next(tab_id_gen)
        super().__init__(parent)

        self.registry = objreg.ObjectRegistry()
        tab_registry = objreg.get('tab-registry', scope='window',
                                  window=win_id)
        tab_registry[self.tab_id] = self
        objreg.register('tab', self, registry=self.registry)

        self.data = TabData()
        self._layout = miscwidgets.WrapperLayout(self)
        self._widget = None  # type: typing.Optional[QWidget]
        self._progress = 0
        self._has_ssl_errors = False
        self._load_status = usertypes.LoadStatus.none
        self._mouse_event_filter = mouse.MouseEventFilter(
            self, parent=self)
        self.backend = None

        # FIXME:qtwebengine  Should this be public api via self.hints?
        #                    Also, should we get it out of objreg?
        hintmanager = hints.HintManager(win_id, self.tab_id, parent=self)
        objreg.register('hintmanager', hintmanager, scope='tab',
                        window=self.win_id, tab=self.tab_id)

        self.before_load_started.connect(self._on_before_load_started)
Ejemplo n.º 2
0
    def __init__(self,
                 *,
                 win_id: int,
                 mode_manager: modeman.ModeManager,
                 private: bool,
                 parent: QWidget = None) -> None:
        utils.unused(mode_manager)  # needed for mypy
        self.is_private = private
        self.win_id = win_id
        self.tab_id = next(tab_id_gen)
        super().__init__(parent)

        self.registry = objreg.ObjectRegistry()
        tab_registry = objreg.get('tab-registry',
                                  scope='window',
                                  window=win_id)
        tab_registry[self.tab_id] = self
        objreg.register('tab', self, registry=self.registry)

        self.data = TabData()
        self._layout = miscwidgets.WrapperLayout(self)
        self._widget = typing.cast(QWidget, None)
        self._progress = 0
        self._load_status = usertypes.LoadStatus.none
        self._tab_event_filter = eventfilter.TabEventFilter(self, parent=self)
        self.backend = None  # type: typing.Optional[usertypes.Backend]

        # If true, this tab has been requested to be removed (or is removed).
        self.pending_removal = False
        self.shutting_down.connect(
            functools.partial(setattr, self, 'pending_removal', True))

        self.before_load_started.connect(self._on_before_load_started)
Ejemplo n.º 3
0
    def __init__(self, *, win_id, mode_manager, private, parent=None):
        self.private = private
        self.win_id = win_id
        self.tab_id = next(tab_id_gen)
        super().__init__(parent)

        self.registry = objreg.ObjectRegistry()
        tab_registry = objreg.get('tab-registry',
                                  scope='window',
                                  window=win_id)
        tab_registry[self.tab_id] = self
        objreg.register('tab', self, registry=self.registry)

        self.data = TabData()
        self._layout = miscwidgets.WrapperLayout(self)
        self._widget = None
        self._progress = 0
        self._has_ssl_errors = False
        self._mode_manager = mode_manager
        self._load_status = usertypes.LoadStatus.none
        self._mouse_event_filter = mouse.MouseEventFilter(self, parent=self)
        self.backend = None

        # FIXME:qtwebengine  Should this be public api via self.hints?
        #                    Also, should we get it out of objreg?
        hintmanager = hints.HintManager(win_id, self.tab_id, parent=self)
        objreg.register('hintmanager',
                        hintmanager,
                        scope='tab',
                        window=self.win_id,
                        tab=self.tab_id)

        self.predicted_navigation.connect(
            lambda url: self.title_changed.emit(url.toDisplayString()))
Ejemplo n.º 4
0
    def __init__(self, win_id, parent=None):
        self.win_id = win_id
        self.tab_id = next(tab_id_gen)
        super().__init__(parent)

        self.registry = objreg.ObjectRegistry()
        tab_registry = objreg.get('tab-registry', scope='window',
                                  window=win_id)
        tab_registry[self.tab_id] = self
        objreg.register('tab', self, registry=self.registry)

        # self.history = AbstractHistory(self)
        # self.scroller = AbstractScroller(self, parent=self)
        # self.caret = AbstractCaret(win_id=win_id, tab=self, mode_manager=...,
        #                            parent=self)
        # self.zoom = AbstractZoom(win_id=win_id)
        # self.search = AbstractSearch(parent=self)
        # self.printing = AbstractPrinting()
        # self.elements = AbstractElements(self)

        self.data = TabData()
        self._layout = miscwidgets.WrapperLayout(self)
        self._widget = None
        self._progress = 0
        self._has_ssl_errors = False
        self._load_status = usertypes.LoadStatus.none
        self._mouse_event_filter = mouse.MouseEventFilter(
            self, widget_class=self.WIDGET_CLASS, parent=self)
        self.backend = None

        # FIXME:qtwebengine  Should this be public api via self.hints?
        #                    Also, should we get it out of objreg?
        hintmanager = hints.HintManager(win_id, self.tab_id, parent=self)
        objreg.register('hintmanager', hintmanager, scope='tab',
                        window=self.win_id, tab=self.tab_id)
Ejemplo n.º 5
0
 def container(self, qtbot):
     wrapped = WrappedWidget()
     parent = QWidget()
     qtbot.add_widget(wrapped)
     qtbot.add_widget(parent)
     layout = miscwidgets.WrapperLayout(parent)
     layout.wrap(parent, wrapped)
     parent.wrapped = wrapped
     return parent
Ejemplo n.º 6
0
 def __init__(self,
              splitter: 'miscwidgets.InspectorSplitter',
              win_id: int,
              parent: QWidget = None) -> None:
     super().__init__(parent)
     self._widget = typing.cast(QWidget, None)
     self._layout = miscwidgets.WrapperLayout(self)
     self._splitter = splitter
     self._position = None  # type: typing.Optional[Position]
     self._event_filter = _EventFilter(win_id, parent=self)
     self._child_event_filter = eventfilter.ChildEventFilter(
         eventfilter=self._event_filter, win_id=win_id, parent=self)
Ejemplo n.º 7
0
    def __init__(self, *, win_id, mode_manager, private, parent=None):
        self.private = private
        self.win_id = win_id
        self.tab_id = next(tab_id_gen)
        super().__init__(parent)

        self.registry = objreg.ObjectRegistry()
        tab_registry = objreg.get('tab-registry',
                                  scope='window',
                                  window=win_id)
        tab_registry[self.tab_id] = self
        objreg.register('tab', self, registry=self.registry)

        # self.history = AbstractHistory(self)
        # self.scroller = AbstractScroller(self, parent=self)
        # self.caret = AbstractCaret(win_id=win_id, tab=self,
        #                            mode_manager=mode_manager, parent=self)
        # self.zoom = AbstractZoom(win_id=win_id)
        # self.search = AbstractSearch(parent=self)
        # self.printing = AbstractPrinting()
        # self.elements = AbstractElements(self)
        # self.action = AbstractAction()

        # we assume the parent always exists if using tree tabs
        if parent:
            self.node = Node(self, parent=parent.tree_root)
        else:
            self.node = Node(self, parent=None)

        self.data = TabData()
        self._layout = miscwidgets.WrapperLayout(self)
        self._widget = None
        self._progress = 0
        self._has_ssl_errors = False
        self._mode_manager = mode_manager
        self._load_status = usertypes.LoadStatus.none
        self._mouse_event_filter = mouse.MouseEventFilter(self, parent=self)
        self.backend = None

        # FIXME:qtwebengine  Should this be public api via self.hints?
        #                    Also, should we get it out of objreg?
        hintmanager = hints.HintManager(win_id, self.tab_id, parent=self)
        objreg.register('hintmanager',
                        hintmanager,
                        scope='tab',
                        window=self.win_id,
                        tab=self.tab_id)

        self.predicted_navigation.connect(
            lambda url: self.title_changed.emit(url.toDisplayString()))
Ejemplo n.º 8
0
    def __init__(self,
                 splitter: 'miscwidgets.InspectorSplitter',
                 win_id: int,
                 parent: QWidget = None) -> None:
        super().__init__(parent)
        self._widget = cast(QWidget, None)
        self._layout = miscwidgets.WrapperLayout(self)
        self._splitter = splitter
        self._position: Optional[Position] = None
        self._win_id = win_id

        self._event_filter = _EventFilter(parent=self)
        self._event_filter.clicked.connect(self._on_clicked)
        self._child_event_filter = eventfilter.ChildEventFilter(
            eventfilter=self._event_filter, parent=self)
Ejemplo n.º 9
0
 def __init__(self, parent=None):
     super().__init__(parent)
     self._widget = None
     self._layout = miscwidgets.WrapperLayout(self)
     self._load_state_geometry()