# standard
from __future__ import annotations

from pathlib import Path
from typing import TYPE_CHECKING, Optional

# PyQGIS
from qgis.PyQt import uic
from qgis.PyQt.QtGui import QIcon

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


if TYPE_CHECKING:
    from qgis.PyQt.QtWidgets import QWidget


class HelpdeskFeaturesPage(WidgetPageBase):
    def __init__(self, parent: Optional[QWidget] = None):
        super().__init__(parent)
        uic.loadUi(Path(__file__).parent / f"{Path(__file__).stem}.ui", self)

        self.wdg_settings_notif.load_settings()
        self.btn_next.clicked.connect(lambda: self.next_page_signal.emit(0))
        self.btn_next.clicked.connect(self.wdg_settings_notif.save_settings)
        self.btn_next.setIcon(QIcon(":images/themes/default/mActionArrowRight.svg"))

        img_list = [
            DIR_PLUGIN_ROOT
            / "resources/images/onboarding/featured_screenshot_gitlab_01.png",
            DIR_PLUGIN_ROOT
            / "resources/images/onboarding/featured_screenshot_gitlab_02.png",
        ]
        self.wdg_images.set_image_list(img_list)

        self.wdg_settings_notif.grp_notifications.setTitle("")
