# standard
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING, Optional

# PyQGIS
from qgis.PyQt import uic

# Project
from oslandia.gui.onboarding.wdg_base_page import WidgetPageBase


if TYPE_CHECKING:
    from qgis.PyQt.QtWidgets import QWidget


class AuthenticationPage(WidgetPageBase):
    def __init__(self, parent: Optional[QWidget] = None):
        """Page that contains the authentification widget.

        :param parent: parent widget, defaults to None
        :type parent: QObject, optional
        """
        # init module and ui
        super().__init__(parent)
        uic.loadUi(Path(__file__).parent / f"{Path(__file__).stem}.ui", self)
        self.wdg_authent.user_connected.connect(lambda: self.next_page_signal.emit(0))
